# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

$(eval $(call gb_Module_Module,libpng))

$(eval $(call gb_Module_add_targets,libpng,\
	StaticLibrary_png \
	UnpackedTarball_png \
))

# vim: set noet sw=4 ts=4:

Revert "no need to double the conditional, once is enough"

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

$(eval $(call gb_Module_Module,libpng))

ifeq ($(SYSTEM_LIBPNG),NO)

$(eval $(call gb_Module_add_targets,libpng,\
	StaticLibrary_png \
	UnpackedTarball_png \
))

endif

# vim: set noet sw=4 ts=4:


RUSTC   ?= rustc
CC      ?= cc
AR      ?= ar
TMPDIR  ?= /youneedtosupply/tmpdir
BINDGEN ?= cargo run --bin=peasy --
EXTRACXXRSFLAGS := -lstdc++

BARE_RUSTC := $(RUSTC)
RUSTC      := $(BARE_RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)

BARE_BINDGEN := $(BINDGEN)
BINDGEN      := $(BARE_BINDGEN) --out-dir $(TMPDIR)

$(TMPDIR)/lib%.o: %.cc
	$(CC) -c -o $@ -I. $<
$(TMPDIR)/lib%.o: $(TMPDIR)/%.cc
	$(CC) -c -o $@ -I. $<
%.a: %.o
	$(AR) crs $@ $<

$(TMPDIR)/%_bind.rs $(TMPDIR)/%_bind.cc: %.h
	$(BINDGEN) $<
%_bind.rlib: %_bind.rs lib%_bind.a
	$(RUSTC) --crate-type=lib -lstatic=$(notdir $*)_bind $(EXTRACXXRSFLAGS) $<

Use compiletest tools.mk from run-make tests

RUSTC   ?= rustc
TMPDIR  ?= /youneedtosupply/tmpdir
BINDGEN ?= cargo run --bin=peasy --

LD_LIB_PATH_ENVVAR ?= LD_LIBRARY_PATH
include ../../../third_party/rust/run-make-fulldeps/tools.mk

CXX := $(CXX) -I.

BARE_BINDGEN := $(BINDGEN)
BINDGEN      := $(BARE_BINDGEN) --out-dir $(TMPDIR)

$(TMPDIR)/lib%.o: %.cc
	$(call COMPILE_OBJ_CXX,$@,$<)
$(TMPDIR)/lib%.o: $(TMPDIR)/%.cc
	$(call COMPILE_OBJ_CXX,$@,$<)

$(TMPDIR)/%_bind.rs $(TMPDIR)/%_bind.cc: %.h
	$(BINDGEN) $<
$(TMPDIR)/%_bind.rlib: $(TMPDIR)/%_bind.rs $(TMPDIR)/lib%_bind.a
	$(RUSTC) --crate-type=lib -lstatic=$(notdir $*)_bind $(EXTRARSCXXFLAGS) $<


include build/platform-msvc-common.mk
ASM = nasm
CFLAGS += -DMT_ENABLED
LDFLAGS += user32.lib
ifeq ($(ENABLE64BIT), Yes)
ASMFLAGS += -f win64
ASMFLAGS_PLATFORM = -DWIN64
CFLAGS += -DWIN64
else
ASMFLAGS += -f win32 -DPREFIX
CFLAGS += -DWIN32
endif

Include the x86 common header for x86 MSVC as well

include build/platform-x86-common.mk
include build/platform-msvc-common.mk
ASM = nasm
CFLAGS += -DMT_ENABLED
LDFLAGS += user32.lib
ifeq ($(ENABLE64BIT), Yes)
ASMFLAGS += -f win64
ASMFLAGS_PLATFORM = -DWIN64
CFLAGS += -DWIN64
else
ASMFLAGS += -f win32 -DPREFIX
CFLAGS += -DWIN32
endif


# $Header: /cvsroot/pgsql/src/backend/nls.mk,v 1.4 2003/06/28 22:30:59 petere Exp $
CATALOG_NAME	:= postgres
AVAIL_LANGUAGES	:= cs de es hr hu ru sv tr zh_CN zh_TW
GETTEXT_FILES	:= + gettext-files
GETTEXT_TRIGGERS:= elog:2 postmaster_error yyerror

gettext-files:
	find $(srcdir)/ -name '*.c' -print >$@

my-maintainer-clean:
	rm -f gettext-files

.PHONY: my-maintainer-clean
maintainer-clean: my-maintainer-clean

Add ereport-related functions to GETTEXT_TRIGGERS list.

# $Header: /cvsroot/pgsql/src/backend/nls.mk,v 1.5 2003/07/19 20:32:12 tgl Exp $
CATALOG_NAME	:= postgres
AVAIL_LANGUAGES	:= cs de es hr hu ru sv tr zh_CN zh_TW
GETTEXT_FILES	:= + gettext-files
# elog should eventually be removed from this list:
GETTEXT_TRIGGERS:= elog:2 errmsg errdetail errhint errcontext postmaster_error yyerror

gettext-files:
	find $(srcdir)/ -name '*.c' -print >$@

my-maintainer-clean:
	rm -f gettext-files

.PHONY: my-maintainer-clean
maintainer-clean: my-maintainer-clean


SDK_MODULES ?=

ifeq ($(SD), s1xx)
	SDK_MODULES = iot_0.9.0
else ifeq ($(SD), s110)
    SDK_MODULES = sdk_10.0.0
else ifeq ($(SD), s120)
	SDK_MODULES = sdk_10.0.0
	$(error No supported BLE wrapper)
else ifeq ($(SD), s130)
    SDK_MODULES = sdk_10.0.0
else ifeq ($(SD), s132)
	SDK_MODULES = sdk_12.1.0
	SDK_COMPONENTS = 0
else
	$(error No SDK configured for this SD)
endif

SDK_MODULES_PATH = sdk/$(SDK_MODULES)/

include $(SDK_MODULES_PATH)sdk.mk

INC += -I./sdk

SRC_C += \
        sdk/modble.c \
        sdk/ble_drv.c

Add ble_uart.c to source list

SDK_MODULES ?=

ifeq ($(SD), s1xx)
	SDK_MODULES = iot_0.9.0
else ifeq ($(SD), s110)
    SDK_MODULES = sdk_10.0.0
else ifeq ($(SD), s120)
	SDK_MODULES = sdk_10.0.0
	$(error No supported BLE wrapper)
else ifeq ($(SD), s130)
    SDK_MODULES = sdk_10.0.0
else ifeq ($(SD), s132)
	SDK_MODULES = sdk_12.1.0
	SDK_COMPONENTS = 0
else
	$(error No SDK configured for this SD)
endif

SDK_MODULES_PATH = sdk/$(SDK_MODULES)/

include $(SDK_MODULES_PATH)sdk.mk

INC += -I./sdk

SRC_C += \
        sdk/modble.c \
        sdk/ble_drv.c \
        sdk/ble_uart.c


USB_VID = 0X1B4F

# TODO: Replace the Product ID below with the official value once known.
USB_PID = 0x0027  # Same PID as the SparkFun MicroMod STM32

USB_PRODUCT = "SparkFun Thing Plus - STM32"
USB_MANUFACTURER = "SparkFun Electronics"

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = W25Q128JVxM

MCU_SERIES = F4
MCU_VARIANT = STM32F405xx
MCU_PACKAGE = LQFP64

LD_COMMON = boards/common_default.ld
LD_DEFAULT = boards/STM32F405_default.ld

# UF2 boot option
LD_BOOT = boards/STM32F405_boot.ld
UF2_OFFSET = 0x8010000

CIRCUITPY_RGBMATRIX ?= 1

Use correct PID for SparkFun Thing Plus - STM32

USB_VID = 0X1B4F
USB_PID = 0x0028

USB_PRODUCT = "SparkFun Thing Plus - STM32"
USB_MANUFACTURER = "SparkFun Electronics"

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = W25Q128JVxM

MCU_SERIES = F4
MCU_VARIANT = STM32F405xx
MCU_PACKAGE = LQFP64

LD_COMMON = boards/common_default.ld
LD_DEFAULT = boards/STM32F405_default.ld

# UF2 boot option
LD_BOOT = boards/STM32F405_boot.ld
UF2_OFFSET = 0x8010000

CIRCUITPY_RGBMATRIX ?= 1


# Prototype for loadable module
# See: https://blog.melski.net/2013/11/29/whats-new-in-gnu-make-4-0/

define source
#include <stdlib.h>
#include <stdio.h>
#include <gnumake.h>

int plugin_is_GPL_compatible;

int fibonacci(int n)
{
    if (n < 2) {
        return n;
    }
    return fibonacci(n - 1) + fibonacci(n - 2);
}

char *gm_fibonacci(const char *nm, unsigned int argc, char **argv)
{
    char *buf  = gmk_alloc(33);
    snprintf(buf, 32, "%d", fibonacci(atoi(argv[0])));
    return buf;
}

int fibonacci_gmk_setup ()
{
    gmk_add_function ("fibonacci", gm_fibonacci, 1, 1, 0);
    return 1;
}
endef

fibonacci.so: fibonacci.c
	clang --shared -undefined dynamic_lookup -o $@ $^

fibonacci.c: $(lastword $(MAKEFILE_LIST))
	$(file >$@, $(source))

-load ./fibonacci.so

%:
	@echo $(fibonacci $@)

Use gcc to build fibonacci.so and fix cygwin support

# Prototype for loadable module
# See: https://blog.melski.net/2013/11/29/whats-new-in-gnu-make-4-0/

define source
#include <stdlib.h>
#include <stdio.h>
#include <gnumake.h>

int plugin_is_GPL_compatible;

int fibonacci(int n)
{
    if (n < 2) {
        return n;
    }
    return fibonacci(n - 1) + fibonacci(n - 2);
}

char *gm_fibonacci(const char *nm, unsigned int argc, char **argv)
{
    char *buf  = gmk_alloc(33);
    snprintf(buf, 32, "%d", fibonacci(atoi(argv[0])));
    return buf;
}

int fibonacci_gmk_setup ()
{
    gmk_add_function ("fibonacci", gm_fibonacci, 1, 1, 0);
    return 1;
}
endef

ifdef WINDIR
# ASSUMES we have makenew and libgnumake-1.dll.a in this directory
cygwin_opts = -L. -lgnumake-1.dll
endif

fibonacci.so: fibonacci.c
	gcc -shared -o $@ $^ $(cygwin_opts)

fibonacci.c: $(lastword $(MAKEFILE_LIST))
	$(file >$@, $(source))

-load ./fibonacci.so

%:
	@echo $(fibonacci $@)


ARCH = armv7
include $(SRC_PATH)build/platform-darwin.mk
CXX = clang++
CC = clang
ifneq ($(filter %86 x86_64, $(ARCH)),)
SDKTYPE = iPhoneSimulator
else
SDKTYPE = iPhoneOS
endif
SDK = $(shell xcrun --sdk $(shell echo $(SDKTYPE) | tr A-Z a-z) --show-sdk-version)
SDK_MIN = 5.1

XCODE=$(shell xcode-select -p)
SDKROOT = $(XCODE)/Platforms/$(SDKTYPE).platform/Developer/SDKs/$(SDKTYPE)$(SDK).sdk
CFLAGS += -arch $(ARCH) -isysroot $(SDKROOT) -miphoneos-version-min=$(SDK_MIN) -DAPPLE_IOS
LDFLAGS += -arch $(ARCH) -isysroot $(SDKROOT) -miphoneos-version-min=$(SDK_MIN)

Enable bitcode for iOS 9

ARCH = armv7
include $(SRC_PATH)build/platform-darwin.mk
CXX = clang++
CC = clang
ifneq ($(filter %86 x86_64, $(ARCH)),)
SDKTYPE = iPhoneSimulator
else
SDKTYPE = iPhoneOS
endif
SDK = $(shell xcrun --sdk $(shell echo $(SDKTYPE) | tr A-Z a-z) --show-sdk-version)
SDK_MIN = 5.1

XCODE=$(shell xcode-select -p)
SDKROOT = $(XCODE)/Platforms/$(SDKTYPE).platform/Developer/SDKs/$(SDKTYPE)$(SDK).sdk
CFLAGS += -arch $(ARCH) -isysroot $(SDKROOT) -miphoneos-version-min=$(SDK_MIN) -DAPPLE_IOS -fembed-bitcode
LDFLAGS += -arch $(ARCH) -isysroot $(SDKROOT) -miphoneos-version-min=$(SDK_MIN)


package=native_ccache
$(package)_version=3.4.1
$(package)_download_path=https://samba.org/ftp/ccache
$(package)_file_name=ccache-$($(package)_version).tar.bz2
$(package)_sha256_hash=ca5a01fb4868cdb5176c77b8b4a390be7929a6064be80741217e0686f03f8389

define $(package)_set_vars
$(package)_config_opts=
endef

define $(package)_config_cmds
  $($(package)_autoconf)
endef

define $(package)_build_cmds
  $(MAKE)
endef

define $(package)_stage_cmds
  $(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

define $(package)_postprocess_cmds
  rm -rf lib include
endef

Change to ccache 3.4.3 for depends

package=native_ccache
$(package)_version=3.4.3
$(package)_download_path=https://samba.org/ftp/ccache
$(package)_file_name=ccache-$($(package)_version).tar.bz2
$(package)_sha256_hash=38decec3eed6524a002ffae52b25781843553c28e2d840e7e55e6831c40264d2

define $(package)_set_vars
$(package)_config_opts=
endef

define $(package)_config_cmds
  $($(package)_autoconf)
endef

define $(package)_build_cmds
  $(MAKE)
endef

define $(package)_stage_cmds
  $(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

define $(package)_postprocess_cmds
  rm -rf lib include
endef


LOCAL_PATH := $(call my-dir)

# prepare librealm-android
include $(CLEAR_VARS)
LOCAL_MODULE    := librealm-android
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/librealm-android.a
include $(PREBUILT_STATIC_LIBRARY)

#include $(CLEAR_VARS)
LOCAL_MODULE := wrappers
LOCAL_CFLAGS :=
LOCAL_SRC_FILES := ../wrappers.cpp
LOCAL_LDLIBS := -llog
LOCAL_LDLIBS += -lstdc++
LOCAL_CPPFLAGS := -DHAVE_PTHREADS
LOCAL_C_INCLUDES += core/include
LOCAL_STATIC_LIBRARIES := realm-android
include $(BUILD_SHARED_LIBRARY)

Update android.mk to use all c++ files

LOCAL_PATH := $(call my-dir)

# prepare librealm-android
include $(CLEAR_VARS)
LOCAL_MODULE    := librealm-android
LOCAL_SRC_FILES := ../core-android/$(TARGET_ARCH_ABI)/librealm-android.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)

OS_SRCS=$(wildcard object-store/*.cpp)
ECH_SRCS=object-store/impl/apple/external_commit_helper.cpp
SRCS=$(wildcard *.cpp) $(OS_SRCS) $(ECH_SRCS)

LOCAL_MODULE := wrappers
LOCAL_CFLAGS :=
LOCAL_SRC_FILES := $(OS_SRCS)
LOCAL_SRC_FILES += $(ECH_SRCS)
LOCAL_SRC_FILES += $(SRCS)
LOCAL_LDLIBS := -llog
LOCAL_LDLIBS += -lstdc++
LOCAL_CPPFLAGS := -DHAVE_PTHREADS
LOCAL_C_INCLUDES += core/include
LOCAL_STATIC_LIBRARIES := realm-android
include $(BUILD_SHARED_LIBRARY)


# -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------

utils/hp2ps_dist_C_SRCS = AreaBelow.c Curves.c Error.c Main.c \
                          Reorder.c TopTwenty.c AuxFile.c Deviation.c \
                          HpFile.c Marks.c Scale.c TraceElement.c \
                          Axes.c Dimensions.c Key.c PsFile.c Shade.c \
                          Utilities.c
utils/hp2ps_dist_PROG    = hp2ps$(exeext)
utils/hp2ps_dist_INSTALL = YES

$(eval $(call build-prog,utils/hp2ps,dist,0))

Add -Iincludes to hp2ps's CC_OPTS Making C deps for hp2ps always failed, but we used to carry on regardless

# -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------

utils/hp2ps_dist_C_SRCS = AreaBelow.c Curves.c Error.c Main.c \
                          Reorder.c TopTwenty.c AuxFile.c Deviation.c \
                          HpFile.c Marks.c Scale.c TraceElement.c \
                          Axes.c Dimensions.c Key.c PsFile.c Shade.c \
                          Utilities.c
utils/hp2ps_dist_PROG    = hp2ps$(exeext)
utils/hp2ps_dist_INSTALL = YES

utils/hp2ps_CC_OPTS += -Iincludes

$(eval $(call build-prog,utils/hp2ps,dist,0))


VERSION=0.5.3
TIMESTAMP:=$(shell date "+%F %T%z")

#MANCOUNTRIES=en_GB

CFLAGS=-I. -I.. -ggdb -Wall -O2
LDFLAGS=-nopie -lsqlite3 -lwrap

CC=gcc
INSTALL=install
XGETTEXT=xgettext
MSGMERGE=msgmerge
MSGFMT=msgfmt
DOCBOOK2MAN=docbook2man.pl

prefix=/usr/local
mandir=${prefix}/share/man
localedir=${prefix}/share/locale

Change version to allow creation of pre-release tarballs.

VERSION=0.5.4~pre1
TIMESTAMP:=$(shell date "+%F %T%z")

#MANCOUNTRIES=en_GB

CFLAGS=-I. -I.. -ggdb -Wall -O2
LDFLAGS=-nopie -lsqlite3 -lwrap

CC=gcc
INSTALL=install
XGETTEXT=xgettext
MSGMERGE=msgmerge
MSGFMT=msgfmt
DOCBOOK2MAN=docbook2man.pl

prefix=/usr/local
mandir=${prefix}/share/man
localedir=${prefix}/share/locale


APP_ABI := all
APP_ABI := armeabi-v7a mips mips64 x86 x86_64 arm64-v8a
APP_STL := gnustl_static
APP_PLATFORM := android-9

Fix up android jni makefiles


# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := guava
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := jsr305

include $(BUILD_STATIC_JAVA_LIBRARY)

# Include this library in the build server's output directory
$(call dist-for-goals, droid, $(LOCAL_BUILT_MODULE):guava.jar)

Change LOCAL_SDK_VERSION from current to 8

# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := guava
LOCAL_SDK_VERSION := 8
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := jsr305

include $(BUILD_STATIC_JAVA_LIBRARY)

# Include this library in the build server's output directory
$(call dist-for-goals, droid, $(LOCAL_BUILT_MODULE):guava.jar)


# Container section of standard makefile
##### PLEASE DO NOT CHANGE THIS FILE #####
##### If one of these sections does not meet your needs, consider copying its
##### contents into ../Makefile and commenting out the include and adding a
##### comment about what you did and why.

SANITIZED_DOCKER_REPO = $(subst /,_,$(DOCKER_REPO))

DOTFILE_IMAGE = $(subst /,_,$(IMAGE))-$(VERSION)

container: linux .container-$(DOTFILE_IMAGE) container-name

.container-$(DOTFILE_IMAGE): linux Dockerfile.in
	@sed -e 's|UPSTREAM_REPO|$(UPSTREAM_REPO)|g' Dockerfile.in > .dockerfile
	@echo "\n\n$(DOCKER_REPO):$(VERSION) commit=$(shell git describe --tags --always)"  >.docker_image
	@echo "ADD .docker_image /$(SANITIZED_DOCKER_REPO)_VERSION_INFO.txt" >>.dockerfile
	docker build -t $(DOCKER_REPO):$(VERSION) $(DOCKER_ARGS) -f .dockerfile .
	@docker images -q $(DOCKER_REPO):$(VERSION) > $@

container-name:
	@echo "container: $(DOCKER_REPO):$(VERSION)"

Remove failed newlines from .docker_image

# Container section of standard makefile
##### PLEASE DO NOT CHANGE THIS FILE #####
##### If one of these sections does not meet your needs, consider copying its
##### contents into ../Makefile and commenting out the include and adding a
##### comment about what you did and why.

SANITIZED_DOCKER_REPO = $(subst /,_,$(DOCKER_REPO))

DOTFILE_IMAGE = $(subst /,_,$(IMAGE))-$(VERSION)

container: linux .container-$(DOTFILE_IMAGE) container-name

.container-$(DOTFILE_IMAGE): linux Dockerfile.in
	@sed -e 's|UPSTREAM_REPO|$(UPSTREAM_REPO)|g' Dockerfile.in > .dockerfile
	@echo "$(DOCKER_REPO):$(VERSION) commit=$(shell git describe --tags --always)"  >.docker_image
	@echo "ADD .docker_image /$(SANITIZED_DOCKER_REPO)_VERSION_INFO.txt" >>.dockerfile
	docker build -t $(DOCKER_REPO):$(VERSION) $(DOCKER_ARGS) -f .dockerfile .
	@docker images -q $(DOCKER_REPO):$(VERSION) > $@

container-name:
	@echo "container: $(DOCKER_REPO):$(VERSION)"


    <%def name="footer()">

                    Copyright © 2008-2009 Red Hat, Inc. and others.

                    The Fedora Project is maintained and driven by the community and sponsored by Red Hat.  This is a community maintained site.  Red Hat is not responsible for content.

Sponsors

Legal

Trademark Guidelines

Get the source for Fedora Community

Get the source for Moksha

    </%def>

Add a link for reporting bugs and suggestions

    <%def name="footer()">

                    Copyright © 2008-2009 Red Hat, Inc. and others.

                    The Fedora Project is maintained and driven by the community and sponsored by Red Hat.  This is a community maintained site.  Red Hat is not responsible for content.

Sponsors

Legal

Trademark Guidelines

Get the source for Fedora Community

Get the source for Moksha

Report a bug or send a suggestion

    </%def>


ifneq ($(strip $(LOCAL_SRC_FILES)),)
$(error LOCAL_SRC_FILES are not allowed for phony packages)
endif

ifeq ($(strip $(LOCAL_REQUIRED_MODULES)),)
$(error LOCAL_REQUIRED_MODULES is required for phony packages)
endif

LOCAL_MODULE_CLASS := FAKE
LOCAL_MODULE_SUFFIX := -timestamp

include $(BUILD_SYSTEM)/base_rules.mk

$(LOCAL_BUILT_MODULE):
	$(hide) echo "Fake: $@"
	$(hide) mkdir -p $(dir $@)
	$(hide) touch $@

Remove the restriction that PHONY_PACKAGE needs LOCAL_REQUIRED_MODULES

ifneq ($(strip $(LOCAL_SRC_FILES)),)
$(error LOCAL_SRC_FILES are not allowed for phony packages)
endif

LOCAL_MODULE_CLASS := FAKE
LOCAL_MODULE_SUFFIX := -timestamp

include $(BUILD_SYSTEM)/base_rules.mk

$(LOCAL_BUILT_MODULE):
	$(hide) echo "Fake: $@"
	$(hide) mkdir -p $(dir $@)
	$(hide) touch $@


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9a/procedures/hwp/memory/p9a_mss_volt.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2018,2019
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG

Add L1 procedures for p9a and makefiles

# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9a/procedures/hwp/memory/p9a_mss_volt.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2018,2019
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG

# Include the macros and things for MSS procedures
-include 00p9a_common.mk

PROCEDURE=p9a_mss_volt
$(eval $(call ADD_MEMORY_INCDIRS,$(PROCEDURE)))
$(call BUILD_PROCEDURE)


CONFIG_APP_SETUP = stadt/settings.py
CONFIG_APP_SETUP_TEMPLATE = stadt/settings.py.development

$(CONFIG_APP_SETUP): $(GROUPRISE_MAKEFILES)
	cp "$(CONFIG_APP_SETUP_TEMPLATE)" "$(CONFIG_APP_SETUP)"

.PHONY: app_migrate
app_migrate: virtualenv-check app_local_settings
	( . "$(ACTIVATE_VIRTUALENV)" && "$(PYTHON_BIN)" manage.py migrate )

.PHONY: app_run
app_run: app_migrate app_collect_static
	( . "$(ACTIVATE_VIRTUALENV)" && STADTGESTALTEN_PRESET=development "$(PYTHON_BIN)" manage.py runserver )

.PHONY: app_collect_static
app_collect_static: virtualenv-check app_local_settings assets
	( . "$(ACTIVATE_VIRTUALENV)" && STADTGESTALTEN_PRESET=packaging "$(PYTHON_BIN)" manage.py collectstatic --no-input )

.PHONY: app_local_settings
app_local_settings: $(CONFIG_APP_SETUP)

Fix path to settings files

CONFIG_APP_SETUP = grouprise/settings.py
CONFIG_APP_SETUP_TEMPLATE = grouprise/settings.py.development

$(CONFIG_APP_SETUP): $(GROUPRISE_MAKEFILES)
	cp "$(CONFIG_APP_SETUP_TEMPLATE)" "$(CONFIG_APP_SETUP)"

.PHONY: app_migrate
app_migrate: virtualenv-check app_local_settings
	( . "$(ACTIVATE_VIRTUALENV)" && "$(PYTHON_BIN)" manage.py migrate )

.PHONY: app_run
app_run: app_migrate app_collect_static
	( . "$(ACTIVATE_VIRTUALENV)" && STADTGESTALTEN_PRESET=development "$(PYTHON_BIN)" manage.py runserver )

.PHONY: app_collect_static
app_collect_static: virtualenv-check app_local_settings assets
	( . "$(ACTIVATE_VIRTUALENV)" && STADTGESTALTEN_PRESET=packaging "$(PYTHON_BIN)" manage.py collectstatic --no-input )

.PHONY: app_local_settings
app_local_settings: $(CONFIG_APP_SETUP)


ARCH = arm
include $(SRC_PATH)build/msvc-common.mk
CFLAGS_OPT += -MD
CFLAGS_DEBUG += -MDd
CFLAGS += -DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -DWINDOWS_PHONE -DUNICODE
# Ignore warnings about the main function prototype when building with -ZW
CXXFLAGS += -ZW -wd4447
LDFLAGS += -nodefaultlib:kernel32.lib -nodefaultlib:ole32.lib WindowsPhoneCore.lib
UTSHLDFLAGS=-def:ut.def
# Ignore warnings about code built with -ZW in .lib files
AR_OPTS += -ignore:4264

# WelsThreadLib requires building with -ZW, since it uses new Windows Runtime
# classes for creating threads.
# If linking an .exe that contains Windows Runtime code, the first object
# file linked into the exe also needs to be built with -ZW (otherwise the build
# fails with "vccorlib_lib_should_be_specified_before_msvcrt_lib_to_linker",
# so set it on all files.

Add spaces around an assignment to match the surrounding style

ARCH = arm
include $(SRC_PATH)build/msvc-common.mk
CFLAGS_OPT += -MD
CFLAGS_DEBUG += -MDd
CFLAGS += -DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -DWINDOWS_PHONE -DUNICODE
# Ignore warnings about the main function prototype when building with -ZW
CXXFLAGS += -ZW -wd4447
LDFLAGS += -nodefaultlib:kernel32.lib -nodefaultlib:ole32.lib WindowsPhoneCore.lib
UTSHLDFLAGS = -def:ut.def
# Ignore warnings about code built with -ZW in .lib files
AR_OPTS += -ignore:4264

# WelsThreadLib requires building with -ZW, since it uses new Windows Runtime
# classes for creating threads.
# If linking an .exe that contains Windows Runtime code, the first object
# file linked into the exe also needs to be built with -ZW (otherwise the build
# fails with "vccorlib_lib_should_be_specified_before_msvcrt_lib_to_linker",
# so set it on all files.


# scc version
VERSION = 0.1

## Customize below to fit your system
ARCHS = z80 i386-sysv amd64-sysv qbe
# default architecure used in nested makefiles
ARCH = qbe
DRIVER = posix

# Can be c89 or c99
STD = c99

# paths
PREFIX    = $(HOME)
MANPREFIX = $(PREFIX)/share/man

# scc expects to be built by a C99 compiler
# if your system is not at least POSIX 2004 compatible, adjust CC
# CC = c99
# AR = ar

# for Plan9 add -D_SUSV2_SOURCE
SCC_CFLAGS = -DARCH=\"$(ARCH)\" \
             $(CSTDINC) \
             -DPREFIX=\"$(PREFIX)\" \
             -DNDEBUG \
             $(CFLAGS)

SCC_LDFLAGS = $(LDFLAGS)

.c.o:
	$(CC) $(SCC_CFLAGS) -o $@ -c $<

.c:
	$(CC) $(SCC_CFLAGS) $(SCC_LDFLAGS) -o $@ $<

Change default build to debug

# scc version
VERSION = 0.1

## Customize below to fit your system
ARCHS = z80 i386-sysv amd64-sysv qbe
# default architecure used in nested makefiles
ARCH = qbe
DRIVER = posix

# Can be c89 or c99
STD = c99

# paths
PREFIX    = $(HOME)
MANPREFIX = $(PREFIX)/share/man

# scc expects to be built by a C99 compiler
# if your system is not at least POSIX 2004 compatible, adjust CC
# CC = c99
# AR = ar

# for Plan9 add -D_SUSV2_SOURCE
SCC_CFLAGS = -DARCH=\"$(ARCH)\" \
             $(CSTDINC) \
             -DPREFIX=\"$(PREFIX)\" \
             -g \
             $(CFLAGS)

SCC_LDFLAGS = $(LDFLAGS)

.c.o:
	$(CC) $(SCC_CFLAGS) -o $@ -c $<

.c:
	$(CC) $(SCC_CFLAGS) $(SCC_LDFLAGS) -o $@ $<


DIST ?= jessie
DISTS ?= Debian Bluefalls
DIST_ARCH ?= armhf
ifeq ($(findstring armel, $(DIST_ARCH)), armel)
  ARCH := rpi
else ifeq ($(findstring arm64, $(DIST_ARCH)), arm64)
  ARCH := rpi3
else
  ARCH := rpi2
endif

U-BOOT ?= false

ifeq ($(findstring true, $(U-BOOT)), true)
  ARCH := rpi2
  DIST_ARCH := armhf
  ifneq ($(findstring Debian, $(DISTS)), Debian)
    DISTS += Debian
  endif
endif

ROOT_DEV := /dev/mmcblk0p2

UNAME ?= pi
UPASS ?= pi
RPASS ?= pi

LOCALE ?= en_US.UTF-8

IMAGE_MB ?= -1
BOOT_MB ?= 38
ifeq ($(shell test $(BOOT_MB) -lt 38; echo $$?),0)
  BOOT_MB := 38
endif
ifeq ($(IMAGE_MB),-1)
  ROOT_MB := -1
else
  ROOT_MB=$(shell expr $(IMAGE_MB) - $(BOOT_MB))
endif

BOOT_DIR := boot
ROOTFS_DIR := rootfs
IMAGE_FILE := debian-$(DIST)-$(ARCH).img

Use tabs and fix spacing

DIST ?= jessie
DISTS ?= Debian Bluefalls
DIST_ARCH ?= armhf
ifeq ($(findstring armel,$(DIST_ARCH)),armel)
	ARCH := rpi
else ifeq ($(findstring arm64,$(DIST_ARCH)),arm64)
	ARCH := rpi3
else
	ARCH := rpi2
endif

U-BOOT ?= false

ifeq ($(findstring true,$(U-BOOT)),true)
	ARCH := rpi2
	DIST_ARCH := armhf
	ifneq ($(findstring Debian,$(DISTS)),Debian)
		DISTS += Debian
	endif
endif

ROOT_DEV := /dev/mmcblk0p2

UNAME ?= pi
UPASS ?= pi
RPASS ?= pi

LOCALE ?= en_US.UTF-8

IMAGE_MB ?= -1
BOOT_MB ?= 38
ifeq ($(shell test $(BOOT_MB) -lt 38; echo $$?),0)
	BOOT_MB := 38
endif
ifeq ($(IMAGE_MB),-1)
	ROOT_MB := -1
else
	ROOT_MB=$(shell expr $(IMAGE_MB) - $(BOOT_MB))
endif

BOOT_DIR := boot
ROOTFS_DIR := rootfs
IMAGE_FILE := debian-$(DIST)-$(ARCH).img


utils/haddock_USES_CABAL = YES
utils/haddock_PACKAGE = haddock
utils/haddock_CONFIGURE_OPTS = --flag in-ghc-tree
# XXX This is a temporary hack:
utils/haddock_HC_OPTS += -Wwarn -DNEW_GHC_LAYOUT
utils/haddock_dist_SHELL_WRAPPER = YES
utils/haddock_dist_INSTALL_SHELL_WRAPPER = YES
utils/haddock_dist_PROG = haddock$(exeext)

ifneq "$(BINDIST)" "YES"

$(INPLACE_BIN)/$(utils/haddock_dist_PROG): $(INPLACE_LIB)/html

$(INPLACE_LIB)/html:
	"$(RM)" $(RM_OPTS) -r $@
	"$(CP)" -R utils/haddock/html $@

$(eval $(call build-prog,utils/haddock,dist,2))

utils/haddock_dist_MODULES += Paths_haddock

endif

install: install_utils/haddock_html
.PHONY: install_utils/haddock_html
install_utils/haddock_html:
	"$(RM)" $(RM_OPTS) -r $(DESTDIR)$(datadir)/html
	"$(CP)" -R utils/haddock/html $(DESTDIR)$(datadir)/html

BINDIST_EXTRAS += $(addprefix utils/haddock/,html/*)

Include haddock in GHC bindists

utils/haddock_USES_CABAL = YES
utils/haddock_PACKAGE = haddock
utils/haddock_CONFIGURE_OPTS = --flag in-ghc-tree
# XXX This is a temporary hack:
utils/haddock_HC_OPTS += -Wwarn -DNEW_GHC_LAYOUT
utils/haddock_dist_SHELL_WRAPPER = YES
utils/haddock_dist_INSTALL_SHELL_WRAPPER = YES
utils/haddock_dist_PROG = haddock$(exeext)

ifneq "$(BINDIST)" "YES"

$(INPLACE_BIN)/$(utils/haddock_dist_PROG): $(INPLACE_LIB)/html

$(INPLACE_LIB)/html:
	"$(RM)" $(RM_OPTS) -r $@
	"$(CP)" -R utils/haddock/html $@

endif

$(eval $(call build-prog,utils/haddock,dist,2))

utils/haddock_dist_MODULES += Paths_haddock

install: install_utils/haddock_html
.PHONY: install_utils/haddock_html
install_utils/haddock_html:
	"$(RM)" $(RM_OPTS) -r $(DESTDIR)$(datadir)/html
	"$(CP)" -R utils/haddock/html $(DESTDIR)$(datadir)/html

BINDIST_EXTRAS += $(addprefix utils/haddock/,html/*)


# ===============================================================
# This is where all of the top-level, project-specific
# information is supplied.
# ===============================================================

HIDE_SYMS         = 1
VISIBILITY_HIDDEN = $(if $(HIDE_SYMS),-fvisibility=hidden,)
CXXFLAGS         += $(VISIBILITY_HIDDEN)

# Flex seems to put the 'register' keyword in generated code
# which is deprecated by c++1z and so causes a warning to be
# emitted which we can ignore.
CXXFLAGS += -std=c++1z -Wno-register

STATIC_LIBSTDCXX=

MAIN.deps    := ICALCTERM_INTERFACE
DEFCALC.deps := ICALCTERM_INTERFACE

main_is      := MAIN

# ===============================================================
# Here we traverse the source tree
# ===============================================================
$(call enter,src)

Update makefiles for nr-make changes

# ===============================================================
# This is where all of the top-level, project-specific
# information is supplied.
# ===============================================================

HIDE_SYMS         = 1
VISIBILITY_HIDDEN = $(if $(HIDE_SYMS),-fvisibility=hidden,)
CXXFLAGS         += $(VISIBILITY_HIDDEN)

# Flex seems to put the 'register' keyword in generated code
# which is deprecated by c++1z and so causes a warning to be
# emitted which we can ignore.
CXXFLAGS += -std=c++1z -Wno-register

# Enable if you need to
#STATIC_LIBSTDCXX=

MAIN.deps    := ICALCTERM_INTERFACE
DEFCALC.deps := ICALCTERM_INTERFACE

main_is      := MAIN

# ===============================================================
# Here we traverse the source tree
# ===============================================================
$(call enter,src)


# Common definitions, shared by all makefiles

# all will be the default target, regardless of what is defined in the other
# makefiles.
default: all

# Stop on first error
SHELL := $(SHELL) -e

# Display message in a consistent way
MSG = echo "===> "

# Launch command in the working dir of a software with the right environment
RUN = cd $(WORK_DIR)/$(PKG_DIR) && env $(ENV)

# Pip command
PIP = pip
PIP_WHEEL = $(PIP) wheel --no-use-wheel --no-deps --wheel-dir $(STAGING_DIR)/wheelhouse

# Available languages
LANGUAGES = chs cht csy dan enu fre ger hun ita jpn krn nld nor plk ptb ptg rus spn sve trk

# Available Arches
ARM5_ARCHES = 88f5281 88f6281
ARM7_ARCHES = armada370 armadaxp armada375 alpine comcerto2k
ARM_ARCHES = $(ARM5_ARCHES) $(ARM7_ARCHES)
PPC_ARCHES = powerpc ppc824x ppc853x ppc854x qoriq
x86_ARCHES = evansport
x64_ARCHES = avoton bromolow cedarview x86 x64

# Load local configuration
LOCAL_CONFIG_MK = ../../local.mk
ifneq ($(wildcard $(LOCAL_CONFIG_MK)),)
include $(LOCAL_CONFIG_MK)
endif

Allow pip override in Makefile

# Common definitions, shared by all makefiles

# all will be the default target, regardless of what is defined in the other
# makefiles.
default: all

# Stop on first error
SHELL := $(SHELL) -e

# Display message in a consistent way
MSG = echo "===> "

# Launch command in the working dir of a software with the right environment
RUN = cd $(WORK_DIR)/$(PKG_DIR) && env $(ENV)

# Pip command
PIP ?= pip
PIP_WHEEL = $(PIP) wheel --no-use-wheel --no-deps --wheel-dir $(STAGING_DIR)/wheelhouse

# Available languages
LANGUAGES = chs cht csy dan enu fre ger hun ita jpn krn nld nor plk ptb ptg rus spn sve trk

# Available Arches
ARM5_ARCHES = 88f5281 88f6281
ARM7_ARCHES = armada370 armadaxp armada375 alpine comcerto2k
ARM_ARCHES = $(ARM5_ARCHES) $(ARM7_ARCHES)
PPC_ARCHES = powerpc ppc824x ppc853x ppc854x qoriq
x86_ARCHES = evansport
x64_ARCHES = avoton bromolow cedarview x86 x64

# Load local configuration
LOCAL_CONFIG_MK = ../../local.mk
ifneq ($(wildcard $(LOCAL_CONFIG_MK)),)
include $(LOCAL_CONFIG_MK)
endif


top = `{pwd}
root = ${top}/root
#arch = i486
arch = x86_64
libcroot = ${root}/opt/cross/${arch}-linux-musl/${arch}-linux-musl
nprocs = 4
version = 0.0
mirror = http://dl.2f30.org/morpheus-pkgs/${arch}/${version}
CC = ${arch}-linux-musl-gcc

optldflags = -s -Wl,--gc-sections -Wl,-z,relro,-z,now
optcflags = -fdata-sections -ffunction-sections -Os -g0 -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa,--noexecstack

CFLAGS = -I${libcroot}/include -static ${optcflags}
LDFLAGS = -L${libcroot}/lib -static ${optldflags}

PATH = ${root}/opt/cross/${arch}-linux-musl/bin:${PATH}

Comment out optcflags and optldflags

top = `{pwd}
root = ${top}/root
#arch = i486
arch = x86_64
libcroot = ${root}/opt/cross/${arch}-linux-musl/${arch}-linux-musl
nprocs = 4
version = 0.0
mirror = http://dl.2f30.org/morpheus-pkgs/${arch}/${version}
CC = ${arch}-linux-musl-gcc

# these don't work for all packages yet...
optldflags = -s -Wl,--gc-sections -Wl,-z,relro,-z,now
optcflags = -fdata-sections -ffunction-sections -Os -g0 -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa,--noexecstack

CFLAGS = -I${libcroot}/include -static # ${optcflags}
LDFLAGS = -L${libcroot}/lib -static # ${optldflags}

PATH = ${root}/opt/cross/${arch}-linux-musl/bin:${PATH}


#
# %CopyrightBegin%
#
# Copyright Ericsson AB 1997-2012. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# %CopyrightEnd%
#

VSN = 5.10
SYSTEM_VSN = R16B

# Port number 4365 in 4.2
# Port number 4366 in 4.3
# Port number 4368 in 4.4.0 - 4.6.2
# Port number 4369 in 4.6.3 -

ERLANG_DAEMON_PORT = 4369

Change system version to R16A

#
# %CopyrightBegin%
#
# Copyright Ericsson AB 1997-2012. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# %CopyrightEnd%
#

VSN = 5.10
SYSTEM_VSN = R16A

# Port number 4365 in 4.2
# Port number 4366 in 4.3
# Port number 4368 in 4.4.0 - 4.6.2
# Port number 4369 in 4.6.3 -

ERLANG_DAEMON_PORT = 4369


PREFIX ?= /usr/local
DEBUG ?= 0
ICEPROG ?= 1
PROGRAM_PREFIX ?=

CXX ?= clang++
CC ?= clang
PKG_CONFIG ?= pkg-config

C_STD ?= c99
CXX_STD ?= c++11
ifeq ($(DEBUG),1)
OPT_LEVEL ?= 0
DBG_LEVEL ?= -ggdb
else
OPT_LEVEL ?= 2
DBG_LEVEL ?=
endif
WARN_LEVEL ?= all

LDLIBS = -lm -lstdc++
CFLAGS += -MD -O$(OPT_LEVEL) $(DBG_LEVEL) -W$(WARN_LEVEL) -std=$(C_STD) -I$(PREFIX)/include
CXXFLAGS += -MD -O$(OPT_LEVEL) $(DBG_LEVEL) -W$(WARN_LEVEL) -std=$(CXX_STD) -I$(PREFIX)/include

DESTDIR ?=
CHIPDB_SUBDIR ?= $(PROGRAM_PREFIX)icebox

ifeq ($(MXE),1)
EXE = .exe
CXX = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-gcc
CC = $(CXX)
PKG_CONFIG = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-pkg-config
endif

ifeq ($(EMCC),1)
EXE = .js
CC = emcc
CXX = emcc
PREFIX = /
LDFLAGS = -O2 --memory-init-file 0 -s TOTAL_MEMORY=64*1024*1024
SUBDIRS = icebox icepack icemulti icepll icetime icebram
endif

Add -MP to CFLAGS and CXXFLAGS, making it harder for make to get confused out of even trying to build

PREFIX ?= /usr/local
DEBUG ?= 0
ICEPROG ?= 1
PROGRAM_PREFIX ?=

CXX ?= clang++
CC ?= clang
PKG_CONFIG ?= pkg-config

C_STD ?= c99
CXX_STD ?= c++11
ifeq ($(DEBUG),1)
OPT_LEVEL ?= 0
DBG_LEVEL ?= -ggdb
else
OPT_LEVEL ?= 2
DBG_LEVEL ?=
endif
WARN_LEVEL ?= all

LDLIBS = -lm -lstdc++
CFLAGS += -MD -MP -O$(OPT_LEVEL) $(DBG_LEVEL) -W$(WARN_LEVEL) -std=$(C_STD) -I$(PREFIX)/include
CXXFLAGS += -MD -MP -O$(OPT_LEVEL) $(DBG_LEVEL) -W$(WARN_LEVEL) -std=$(CXX_STD) -I$(PREFIX)/include

DESTDIR ?=
CHIPDB_SUBDIR ?= $(PROGRAM_PREFIX)icebox

ifeq ($(MXE),1)
EXE = .exe
CXX = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-gcc
CC = $(CXX)
PKG_CONFIG = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-pkg-config
endif

ifeq ($(EMCC),1)
EXE = .js
CC = emcc
CXX = emcc
PREFIX = /
LDFLAGS = -O2 --memory-init-file 0 -s TOTAL_MEMORY=64*1024*1024
SUBDIRS = icebox icepack icemulti icepll icetime icebram
endif


top = `{pwd}
root = ${top}/root
#arch = i486
arch = x86_64
libcroot = ${root}/opt/cross/${arch}-linux-musl/${arch}-linux-musl
nprocs = 4   # number of processes for building separate packages
NPROC = 4    # number of processes for mk concurrency
version = 0.0
mirror = http://dl.2f30.org/morpheus-pkgs/${arch}/${version}
CC = ${arch}-linux-musl-gcc

# these don't work for all packages yet...
optldflags = -s -Wl,--gc-sections -Wl,-z,relro,-z,now
optcflags = -fdata-sections -ffunction-sections -Os -g0 -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa,--noexecstack

CFLAGS = -I${libcroot}/include -static # ${optcflags}
LDFLAGS = -L${libcroot}/lib -static # ${optldflags}

PATH = ${root}/opt/cross/${arch}-linux-musl/bin:${PATH}

Set NPROC to 1 by default

top = `{pwd}
root = ${top}/root
#arch = i486
arch = x86_64
libcroot = ${root}/opt/cross/${arch}-linux-musl/${arch}-linux-musl
nprocs = 4   # number of processes for building separate packages
NPROC = 1    # number of processes for mk concurrency
version = 0.0
mirror = http://dl.2f30.org/morpheus-pkgs/${arch}/${version}
CC = ${arch}-linux-musl-gcc

# these don't work for all packages yet...
optldflags = -s -Wl,--gc-sections -Wl,-z,relro,-z,now
optcflags = -fdata-sections -ffunction-sections -Os -g0 -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa,--noexecstack

CFLAGS = -I${libcroot}/include -static # ${optcflags}
LDFLAGS = -L${libcroot}/lib -static # ${optldflags}

PATH = ${root}/opt/cross/${arch}-linux-musl/bin:${PATH}


LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

appcompat_dir := ../../../frameworks/support/v7/appcompat
design_dir := ../../../frameworks/support/design
res_dir := app/src/main/res $(appcompat_dir)/res $(design_dir)/res

LOCAL_MODULE_TAGS := optional

LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dir))

LOCAL_SRC_FILES := \
        $(call all-java-files-under, app/src/main/java) \
        $(call all-java-files-under, app/src/androidx86/java)

LOCAL_MANIFEST_FILE := app/src/androidx86/AndroidManifest.xml

LOCAL_STATIC_JAVA_LIBRARIES := \
        android-support-v4 \
        android-support-v7-appcompat \
        android-support-v7-recyclerview \
        android-support-transition \
        android-support-design

LOCAL_PROGUARD_ENABLED := disabled

LOCAL_PACKAGE_NAME := Taskbar

LOCAL_JAVA_LANGUAGE_VERSION := 1.8

LOCAL_AAPT_FLAGS := \
        --auto-add-overlay \
        --rename-manifest-package com.farmerbb.taskbar.androidx86 \
        --extra-packages android.support.v7.appcompat \
        --extra-packages android.support.v7.recyclerview \
        --extra-packages android.support.transition \
        --extra-packages android.support.design

include $(BUILD_PACKAGE)

Build Taskbar as a privileged app when building from source

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

appcompat_dir := ../../../frameworks/support/v7/appcompat
design_dir := ../../../frameworks/support/design
res_dir := app/src/main/res $(appcompat_dir)/res $(design_dir)/res

LOCAL_MODULE_TAGS := optional

LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dir))

LOCAL_SRC_FILES := \
        $(call all-java-files-under, app/src/main/java) \
        $(call all-java-files-under, app/src/androidx86/java)

LOCAL_MANIFEST_FILE := app/src/androidx86/AndroidManifest.xml

LOCAL_STATIC_JAVA_LIBRARIES := \
        android-support-v4 \
        android-support-v7-appcompat \
        android-support-v7-recyclerview \
        android-support-transition \
        android-support-design

LOCAL_PROGUARD_ENABLED := disabled

LOCAL_PACKAGE_NAME := Taskbar

LOCAL_JAVA_LANGUAGE_VERSION := 1.8

LOCAL_PRIVILEGED_MODULE := true

LOCAL_AAPT_FLAGS := \
        --auto-add-overlay \
        --rename-manifest-package com.farmerbb.taskbar.androidx86 \
        --extra-packages android.support.v7.appcompat \
        --extra-packages android.support.v7.recyclerview \
        --extra-packages android.support.transition \
        --extra-packages android.support.design

include $(BUILD_PACKAGE)


# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_MODULE := easymock

include $(BUILD_HOST_JAVA_LIBRARY)

Build easymock as a target static library too.

# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#

LOCAL_PATH := $(call my-dir)

# Build an easymock.jar to use for host side tests
include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_MODULE := easymock

include $(BUILD_HOST_JAVA_LIBRARY)

# Build an easymocklib.jar to use on device
include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_MODULE := easymocklib

include $(BUILD_STATIC_JAVA_LIBRARY)


LIB_TARGETS += libtenyrjit$(DYLIB_SUFFIX)

# TODO keep these changes from affecting Makefiles that include this one
CXXFLAGS += -g
CXXFLAGS += -std=c++11
CXXFLAGS += -fPIC

ASMJIT_BASE = $(TOP)/3rdparty/asmjit
ASMJIT_SRC = $(ASMJIT_BASE)/src
vpath %.cpp $(ASMJIT_SRC)/asmjit/base
vpath %.cpp $(ASMJIT_SRC)/asmjit/x86

ASMJIT_OBJS = \
    assembler.o codegen.o compiler.o constpool.o containers.o context.o \
    cpuinfo.o cputicks.o error.o globals.o intutil.o logger.o operand.o \
    runtime.o string.o vmem.o zone.o \
    x86assembler.o x86compiler.o x86context.o x86cpuinfo.o x86inst.o \
    x86operand.o x86operand_regs.o x86scheduler.o

# Suppress warnings on code we do not control
$(ASMJIT_OBJS): CXXFLAGS := $(filter-out -W%,$(CXXFLAGS))

libtenyrjit$(DYLIB_SUFFIX): CPPFLAGS += -I$(ASMJIT_SRC)
libtenyrjit$(DYLIB_SUFFIX): LDFLAGS  += -fPIC -shared
libtenyrjit$(DYLIB_SUFFIX): $(ASMJIT_OBJS)

CLEAN_FILES += libtenyrjit$(DYLIB_SUFFIX)

Remove needless flag breaking Travis

LIB_TARGETS += libtenyrjit$(DYLIB_SUFFIX)

# TODO keep these changes from affecting Makefiles that include this one
CXXFLAGS += -g
CXXFLAGS += -fPIC

ASMJIT_BASE = $(TOP)/3rdparty/asmjit
ASMJIT_SRC = $(ASMJIT_BASE)/src
vpath %.cpp $(ASMJIT_SRC)/asmjit/base
vpath %.cpp $(ASMJIT_SRC)/asmjit/x86

ASMJIT_OBJS = \
    assembler.o codegen.o compiler.o constpool.o containers.o context.o \
    cpuinfo.o cputicks.o error.o globals.o intutil.o logger.o operand.o \
    runtime.o string.o vmem.o zone.o \
    x86assembler.o x86compiler.o x86context.o x86cpuinfo.o x86inst.o \
    x86operand.o x86operand_regs.o x86scheduler.o

# Suppress warnings on code we do not control
$(ASMJIT_OBJS): CXXFLAGS := $(filter-out -W%,$(CXXFLAGS))

libtenyrjit$(DYLIB_SUFFIX): CPPFLAGS += -I$(ASMJIT_SRC)
libtenyrjit$(DYLIB_SUFFIX): LDFLAGS  += -fPIC -shared
libtenyrjit$(DYLIB_SUFFIX): $(ASMJIT_OBJS)

CLEAN_FILES += libtenyrjit$(DYLIB_SUFFIX)


ifneq ($(SDL),0)
sdl2_pkg_config ?= $(shell $(SDL2_PKGCONFIG) $1 $2)
SDL_VERSION := $(call sdl2_pkg_config,--modversion,sdl2)
ifneq ($(SDL_VERSION),)
PDEVICES_SDL += sdlled sdlvga
PDEVICES += $(PDEVICES_SDL)
libtenyrsdl%$(DYLIB_SUFFIX) $(PDEVICES_SDL:%=devices/%.d): \
    CPPFLAGS += $(call sdl2_pkg_config,--cflags,sdl2 SDL2_image)
libtenyrsdl%$(DYLIB_SUFFIX): LDLIBS += $(call sdl2_pkg_config,--libs,sdl2 SDL2_image)
libtenyrsdlvga$(DYLIB_SUFFIX): | $(TOP)rsrc/font10x15/invert.font10x15.png
$(TOP)rsrc/font10x15/%:
	$(MAKE) -C $(@D) $(@F)

# Do not halt the build for platforms on which the feature-flag _BSD_SOURCE is
# unused.
sdl%.o: CFLAGS += -W$(PEDANTRY_EXCEPTION)unused-macros -W'$(PEDANTRY_EXCEPTION)\#warnings'
endif
endif

Mark SDL include directories with -isystem

ifneq ($(SDL),0)
sdl2_pkg_config ?= $(shell $(SDL2_PKGCONFIG) $1 $2)
SDL_VERSION := $(call sdl2_pkg_config,--modversion,sdl2)
ifneq ($(SDL_VERSION),)
PDEVICES_SDL += sdlled sdlvga
PDEVICES += $(PDEVICES_SDL)
# Mark SDL header includes as system includes to avoid subjecting them to full
# pedantry
libtenyrsdl%$(DYLIB_SUFFIX) $(PDEVICES_SDL:%=devices/%.d): \
    CPPFLAGS += $(patsubst -I%,-isystem %,$(call sdl2_pkg_config,--cflags-only-I,sdl2 SDL2_image))
libtenyrsdl%$(DYLIB_SUFFIX) $(PDEVICES_SDL:%=devices/%.d): \
    CPPFLAGS += $(call sdl2_pkg_config,--cflags-only-other,sdl2 SDL2_image)
libtenyrsdl%$(DYLIB_SUFFIX): LDLIBS += $(call sdl2_pkg_config,--libs,sdl2 SDL2_image)
libtenyrsdlvga$(DYLIB_SUFFIX): | $(TOP)rsrc/font10x15/invert.font10x15.png
$(TOP)rsrc/font10x15/%:
	$(MAKE) -C $(@D) $(@F)

# Do not halt the build for platforms on which the feature-flag _BSD_SOURCE is
# unused.
sdl%.o: CFLAGS += -W$(PEDANTRY_EXCEPTION)unused-macros -W'$(PEDANTRY_EXCEPTION)\#warnings'
endif
endif


mk_core_cache := mk/cache/mk_core.mk

mk_core_scripts := \
	$(addprefix mk/core/,common.mk string.mk define.mk object.mk)

all : $(mk_core_cache)

$(mk_core_cache) : $(mk_core_scripts)
	$(MAKE) -f mk/cache.mk CACHE_INCLUDES='$^' > $@

Add a few modules for testing: mk_gold, mk_model and mk_mybuild

#
#   Date: Jan 25, 2012
# Author: Eldar Abusalimov
#

CACHE_DIR := mk/cache

# Core scripts: def & obj.
mk_core := $(CACHE_DIR)/mk_core.mk
$(mk_core)/includes := \
	mk/core/string.mk \
	mk/core/define.mk \
	mk/core/object.mk
$(mk_core)/uses :=

# GOLD parser engine.
mk_gold := $(CACHE_DIR)/mk_gold.mk
$(mk_gold)/includes := \
	mk/gold/engine.mk
$(mk_gold)/uses := \
	$(mk_core)

# Tiny version of EMF Ecore.
mk_model := $(CACHE_DIR)/mk_model.mk
$(mk_model)/includes := \
	mk/model/model.mk     \
	mk/model/factory.mk   \
	mk/model/metamodel.mk
$(mk_model)/uses := \
	$(mk_core)

# Mybuild itself.
mk_mybuild := $(CACHE_DIR)/mk_mybuild.mk
$(mk_mybuild)/includes := \
	mk/mybuild/myfile-model.mk     \
	mk/mybuild/myfile-factory.mk   \
	mk/mybuild/myfile-metamodel.mk \
	mk/mybuild/myfile-resource.mk  \
	mk/mybuild/myfile-parser.mk
$(mk_mybuild)/uses := \
	$(mk_core) \
	$(mk_gold) \
	$(mk_model)

all_mk_targets := \
	$(mk_core) \
	$(mk_gold) \
	$(mk_model) \
	$(mk_mybuild)

all : $(all_mk_targets)
	$(MAKE) -f mk/core/common.mk MAKEFILES=$(mk_mybuild)

.SECONDEXPANSION:
$(all_mk_targets) : $$($$@/includes)
$(all_mk_targets) : $$($$@/uses)
$(all_mk_targets) : mk/load.mk
$(all_mk_targets) : mk/cache.mk
	@mkdir -p $(@D)
	$(MAKE) -f mk/cache.mk \
		CACHE_INCLUDES='$(value $@/includes)' \
		CACHE_USES='$(value $@/uses)' > $@


LOCAL_DIR := $(GET_LOCAL_DIR)

MODULE := $(LOCAL_DIR)

MODULE_SRCS += \
	$(LOCAL_DIR)/atoi.c \
	$(LOCAL_DIR)/ctype.c \
	$(LOCAL_DIR)/printf.c \
	$(LOCAL_DIR)/malloc.c \
	$(LOCAL_DIR)/rand.c \
	$(LOCAL_DIR)/stdio.c \
	$(LOCAL_DIR)/qsort.c \
	$(LOCAL_DIR)/eabi.c

include $(LOCAL_DIR)/string/rules.mk

ifeq ($(WITH_CPP_SUPPORT),true)
MODULE_SRCS += \
	$(LOCAL_DIR)/new.c \
	$(LOCAL_DIR)/atexit.c \
	$(LOCAL_DIR)/pure_virtual.cpp
endif

include make/module.mk

Add an ability to build libc with external malloc

LOCAL_DIR := $(GET_LOCAL_DIR)

MODULE := $(LOCAL_DIR)

MODULE_SRCS += \
	$(LOCAL_DIR)/atoi.c \
	$(LOCAL_DIR)/ctype.c \
	$(LOCAL_DIR)/printf.c \
	$(LOCAL_DIR)/rand.c \
	$(LOCAL_DIR)/stdio.c \
	$(LOCAL_DIR)/qsort.c \
	$(LOCAL_DIR)/eabi.c

ifneq ($(WITH_CUSTOM_MALLOC),true)
MODULE_SRCS += $(LOCAL_DIR)/malloc.c
endif

include $(LOCAL_DIR)/string/rules.mk

ifeq ($(WITH_CPP_SUPPORT),true)
MODULE_SRCS += \
	$(LOCAL_DIR)/new.c \
	$(LOCAL_DIR)/atexit.c \
	$(LOCAL_DIR)/pure_virtual.cpp
endif

include make/module.mk


# rules to make a distribution tarball from a git repo
# Copyright 2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

DISTPREFIX?=	${NAME}-${VERSION}
DISTFILE?=	${DISTPREFIX}.tar.bz2

CLEANFILES+=	${DISTFILE}

dist:
	svn export . ${DISTPREFIX}
	tar cjpf ${DISTFILE} ${DISTPREFIX}
	rm -rf ${DISTPREFIX}

Add snapshot and snap targets

# rules to make a distribution tarball from a git repo
# Copyright 2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

DISTPREFIX?=	${NAME}-${VERSION}
DISTFILE?=	${DISTPREFIX}.tar.bz2

CLEANFILES+=	${NAME}-*.tar.bz2

_SNAP_SH=	date -u +%Y%m%d%H%M
_SNAP!=		${_SNAP_SH}
SNAP=		${_SNAP}$(shell ${_SNAP_SH})
SNAPDIR=	${DISTPREFIX}-${SNAP}
SNAPFILE=	${SNAPDIR}.tar.bz2

dist:
	svn export . ${DISTPREFIX}
	tar cjpf ${DISTFILE} ${DISTPREFIX}
	rm -rf ${DISTPREFIX}

snapshot:
	rm -rf /tmp/${SNAPDIR}
	mkdir /tmp/${SNAPDIR}
	cp -RPp * /tmp/${SNAPDIR}
	(cd /tmp/${SNAPDIR}; make clean)
	find /tmp/${SNAPDIR} -name .svn -exec rm -rf -- {} \; 2>/dev/null || true
	tar -cvjpf ${SNAPFILE} -C /tmp ${SNAPDIR}
	rm -rf /tmp/${SNAPDIR}
	ls -l ${SNAPFILE}

snap: snapshot


#
# Copyright (C) 2016 The CyanogenMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := generic

TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := cortex-a53.a57

# Optimizations
TARGET_OPTIMIZED_ARCH_VARIANT := armv8-a+crc
TARGET_OPTIMIZED_CPU_VARIANT := cortex-a53
TARGET_USE_FAST_OPTIMIZATION := true

Revert "zero: set optimized compiler-options"


DIR := $(dir $(lastword $(MAKEFILE_LIST)))

include $(DIR)/path.mk

NIXD_VERSION := fa4fc39e7fd8c9a9183684e349c81931326d7523
NIXD_SHA1SUM := b30e0e2927fef8b492223c1daf35e9f818584065

VENDOR := $(PROJECT_ROOT)/.nixd
nixd := $(VENDOR)/bin/nixd

export VENDOR

$(nixd):
	@$(VENDOR)/bin/nixd-bootstrap $(nixd) $(NIXD_VERSION) sha1 $(NIXD_SHA1SUM)

vendor-%: $(nixd)
	@$(nixd) install $*

Update nixd executable when version spec changes.

__FILE__ := $(lastword $(MAKEFILE_LIST))
DIR := $(dir $(lastword $(MAKEFILE_LIST)))

include $(DIR)/path.mk

NIXD_VERSION := fa4fc39e7fd8c9a9183684e349c81931326d7523
NIXD_SHA1SUM := b30e0e2927fef8b492223c1daf35e9f818584065

VENDOR := $(PROJECT_ROOT)/.nixd
nixd := $(VENDOR)/bin/nixd

export VENDOR

$(nixd): $(__FILE__)
	@rm -f $@
	@$(VENDOR)/bin/nixd-bootstrap $(nixd) $(NIXD_VERSION) sha1 $(NIXD_SHA1SUM)

vendor-%: $(nixd)
	@$(nixd) install $*


ISOLINUX_FILES:=netboot.tar.gz

# debian isolinux files
$(addprefix $(LOCAL_MIRROR_UBUNTU_OS_BASEURL)/installer-amd64/current/images/netboot/,$(ISOLINUX_FILES)):
	@mkdir -p $(@D)
	wget -O $@ http://mirror.yandex.ru/ubuntu/dists/precise-updates/main/installer-amd64/current/images/saucy-netboot/netboot.tar.gz
	tar -xzf $(LOCAL_MIRROR_UBUNTU_OS_BASEURL)/installer-amd64/current/images/netboot/$(@F) -C $(LOCAL_MIRROR_UBUNTU_OS_BASEURL)/installer-amd64/current/images/netboot/

$(BUILD_DIR)/mirror/ubuntu/boot.done: \
		$(addprefix $(LOCAL_MIRROR_UBUNTU_OS_BASEURL)/installer-amd64/current/images/netboot/,$(ISOLINUX_FILES))
	$(ACTION.TOUCH)

Remove mirror yandex.ru from downloading ubuntu kernel

ISOLINUX_FILES:=netboot.tar.gz

# debian isolinux files
$(addprefix $(LOCAL_MIRROR_UBUNTU_OS_BASEURL)/installer-amd64/current/images/netboot/,$(ISOLINUX_FILES)):
	@mkdir -p $(@D)
ifeq ($(USE_MIRROR),none)
	wget -O $@ $(MIRROR_UBUNTU)/ubuntu/dists/precise-updates/main/installer-amd64/current/images/saucy-netboot/netboot.tar.gz
else
	wget -O $@ $(MIRROR_UBUNTU)/installer-amd64/current/images/netboot/netboot.tar.gz
endif

	tar -xzf $(LOCAL_MIRROR_UBUNTU_OS_BASEURL)/installer-amd64/current/images/netboot/$(@F) -C $(LOCAL_MIRROR_UBUNTU_OS_BASEURL)/installer-amd64/current/images/netboot/

$(BUILD_DIR)/mirror/ubuntu/boot.done: \
		$(addprefix $(LOCAL_MIRROR_UBUNTU_OS_BASEURL)/installer-amd64/current/images/netboot/,$(ISOLINUX_FILES))
	$(ACTION.TOUCH)


include build/platform-x86-common.mk
ASM = nasm
SHAREDLIBSUFFIX = dylib
CFLAGS += -Wno-deprecated-declarations -Werror -fPIC -DMACOS -DMT_ENABLED -MMD -MP
LDFLAGS += -lpthread
ASMFLAGS += --prefix _ -DNOPREFIX
ifeq ($(ENABLE64BIT), Yes)
ASMFLAGS += -f macho64
else
ASMFLAGS += -f macho
LDFLAGS += -read_only_relocs suppress
endif

Use -dynamiclib instead of -shared for building shared libraries on OS X

include build/platform-x86-common.mk
ASM = nasm
SHAREDLIBSUFFIX = dylib
SHARED = -dynamiclib
CFLAGS += -Wno-deprecated-declarations -Werror -fPIC -DMACOS -DMT_ENABLED -MMD -MP
LDFLAGS += -lpthread
ASMFLAGS += --prefix _ -DNOPREFIX
ifeq ($(ENABLE64BIT), Yes)
ASMFLAGS += -f macho64
else
ASMFLAGS += -f macho
LDFLAGS += -read_only_relocs suppress
endif


# Copyright 2015 Hippo Seven
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

APP_ABI := all
APP_PLATFORM := android-15
APP_OPTIM := release

APP_CFLAGS += -ffunction-sections -fdata-sections -fPIC
APP_CPPFLAGS += -ffunction-sections -fdata-sections -fvisibility=hidden -fPIC
APP_LDFLAGS += -Wl,--gc-sections -fPIC

NDK_TOOLCHAIN_VERSION := 4.9

Use clang instead of gcc

# Copyright 2015 Hippo Seven
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

APP_ABI := all
APP_PLATFORM := android-15
APP_OPTIM := release

APP_CFLAGS += -ffunction-sections -fdata-sections -fPIC
APP_CPPFLAGS += -ffunction-sections -fdata-sections -fvisibility=hidden -fPIC
APP_LDFLAGS += -Wl,--gc-sections -fPIC

NDK_TOOLCHAIN_VERSION := clang


                Version
                Age
                Status

                  ${c.update_hover_menu(show_package=False, show_version=True)}

                @{date_pushed}
                @{status}

@{karma_str} karma

                  @{package_update_action}

           Viewing @{visible_rows} of @{total_rows} updates

           View more stable updates >

Tweak some of the updates grid columns

                Version
                Age
                Status

                  ${c.update_hover_menu(show_package=False, show_version=True)}

                @{date_pushed_display}
                @{status}

@{karma_str} karma

                  @{details}

           Viewing @{visible_rows} of @{total_rows} updates

           View more stable updates >


all:

install: all simpleinstall
uninstall: simpleuninstall

DOCDIR = $(DOC)
simpleinstall:
	for f in $(DOCS); do \
		$(INSTALL) 0644 $$f $(DOCDIR)/$$f; \
	done
	for f in $(TEXT); do \
		$(INSTALL) 0644 $$f $(DIR)/$$f; \
	done
	for f in $(BINARY); do \
		$(INSTALL) -b 0644 $$f $(DIR)/$$f; \
	done
	for f in $(EXECS); do \
		$(INSTALL) -b 0755 $$f $(DIR)/$$f; \
	done

cleandep:
	echo CLEANDEP
	rm .depend 2>/dev/null || true

tags:
	files=; \
	for f in $(OBJ); do \
		[ -f "$$f.c" ] && files="$$files $$f.c"; \
	done; \
	echo CTAGS $$files $(TAGFILES) || \
	ctags $$files $(TAGFILES)

.PHONY: all options clean dist install uninstall depend cleandep tags
.PHONY: simpleuninstall simpleinstall

Fix installation broken 2 commits prior.

all:

install: all simpleinstall
uninstall: simpleuninstall

DOCDIR = $(DOC)
simpleinstall:
	for f in $(DOCS); do \
		$(INSTALL) 0644 $$f $(DOCDIR) $$f; \
	done
	for f in $(TEXT); do \
		$(INSTALL) 0644 $$f $(DIR) $$f; \
	done
	for f in $(BINARY); do \
		$(INSTALL) -b 0644 $$f $(DIR) $$f; \
	done
	for f in $(EXECS); do \
		$(INSTALL) -b 0755 $$f $(DIR) $$f; \
	done

cleandep:
	echo CLEANDEP
	rm .depend 2>/dev/null || true

tags:
	files=; \
	for f in $(OBJ); do \
		[ -f "$$f.c" ] && files="$$files $$f.c"; \
	done; \
	echo CTAGS $$files $(TAGFILES) || \
	ctags $$files $(TAGFILES)

.PHONY: all options clean dist install uninstall depend cleandep tags
.PHONY: simpleuninstall simpleinstall


# ModuleVars.mk for main module
# Copyright (c) 1995-2016 Rene Brun and Fons Rademakers
#
# Author: Axel Naumann, 2016-12-19

##### rootcling #####
ROOTCLINGEXE    := bin/rootcling$(EXEEXT)
ROOTCLINGSTAGE2 := $(ROOTCLINGEXE) -rootbuild
# Dependencies for all dictionaries
ROOTCLINGSTAGE2DEP := $(ROOTCLINGEXE)

Define the rootcint and genreflex exe variable.

# ModuleVars.mk for main module
# Copyright (c) 1995-2016 Rene Brun and Fons Rademakers
#
# Author: Axel Naumann, 2016-12-19

##### rootcling #####
ROOTCLINGEXE    := bin/rootcling$(EXEEXT)
ROOTCLINGSTAGE2 := $(ROOTCLINGEXE) -rootbuild
# Dependencies for all dictionaries
ROOTCLINGSTAGE2DEP := $(ROOTCLINGEXE)

ROOTCINTEXE     := bin/rootcint$(EXEEXT)
GENREFLEXEXE    := bin/genreflex$(EXEEXT)


## Common definitions
#
# This file must not define rules itself.

# Define rules to generated a single template using PY_TEMPLATIZE
#   py_templatize_rule <template> <output-name> [args] [deps]
define py_templatize_rule
$$(gen_dir)/$(2): $(1) $(4)
	@mkdir -p $$(dir $$@)
	$(PY_TEMPLATIZE) -o $$@ -i $$< -- $(3)
endef

# Define rule to generate templates from a directory using PY_TEMPLATIZE
#   py_templatize_dir_rule <template-dir> <output-names> [args] [deps]
define py_templatize_dir_rule
$$(addprefix $$(gen_dir)/,$(2)): $$(gen_dir)/%: $(1)/% $(4)
	@mkdir -p $$(dir $$@)
	$(PY_TEMPLATIZE) -o $$@ -i $$< -- $(3)
endef

Fix py_templatize_rule when output name is provided with a leading space

## Common definitions
#
# This file must not define rules itself.

# Define rules to generated a single template using PY_TEMPLATIZE
#   py_templatize_rule <template> <output-name> [args] [deps]
define py_templatize_rule
$$(gen_dir)/$(strip $(2)): $(1) $(4)
	@mkdir -p $$(dir $$@)
	$(PY_TEMPLATIZE) -o $$@ -i $$< -- $(3)
endef

# Define rule to generate templates from a directory using PY_TEMPLATIZE
#   py_templatize_dir_rule <template-dir> <output-names> [args] [deps]
define py_templatize_dir_rule
$$(addprefix $$(gen_dir)/,$(2)): $$(gen_dir)/%: $(1)/% $(4)
	@mkdir -p $$(dir $$@)
	$(PY_TEMPLATIZE) -o $$@ -i $$< -- $(3)
endef


# Utilities to set variables and environment for targets
# These functions should help replacing immediate evaluation and global 'export'

# Evaluate a deferred variable only once on its first usage
# Uses after that will be as if it was an immediate evaluation
# This can replace using `:=` by default
#
# The goal is to use it for `shell` commands
#
# variable = $(call memoized,<variable>,<value>)
#
# Parameters
#  variable: name of the variable you set
#  value: value that should be set when evaluated
memoized = $2$(eval $1:=$2)

# Target specific export the variables for that target
#
# target-export-variables <target> <variables>
#
# Parameters
#   target: name of target
#   variables: the variables to export
#
# The variable will only be evaluated when executing the target as when
# doing export
target-export-variables = $(foreach var,$(2),$(call _target-export-variable,$1,$(var)))

# '$1: export $2' cannot be used alone
# By using '?=' the variable is evaluated at runtime only
_target-export-variable = $(eval $1: export $2?=)

Add variable definitions for comma and space

# Utilities to set variables and environment for targets
# The variables defined here cover edge cases in make string handling.
# These functions should help replacing immediate evaluation and global 'export'

comma := ,
blank :=
space := $(blank) $(blank)

# Evaluate a deferred variable only once on its first usage
# Uses after that will be as if it was an immediate evaluation
# This can replace using `:=` by default
#
# The goal is to use it for `shell` commands
#
# variable = $(call memoized,<variable>,<value>)
#
# Parameters
#  variable: name of the variable you set
#  value: value that should be set when evaluated
memoized = $2$(eval $1:=$2)

# Target specific export the variables for that target
#
# target-export-variables <target> <variables>
#
# Parameters
#   target: name of target
#   variables: the variables to export
#
# The variable will only be evaluated when executing the target as when
# doing export
target-export-variables = $(foreach var,$(2),$(call _target-export-variable,$1,$(var)))

# '$1: export $2' cannot be used alone
# By using '?=' the variable is evaluated at runtime only
_target-export-variable = $(eval $1: export $2?=)


LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
	gdir.c \
	gerror.c \
	giochannel.c \
	gkeyfile.c \
	gmain.c \
	gmem.c \
	goption.c \
	gslice.c \
	gslist.c \
	gstring.c \
	gstrfuncs.c \
	gtimer.c \
	giounix.c \
	gmessages.c \
	gutf8.c \
	gfileutils.c \
	gconvert.c \
	gdataset.c \
	gtestutils.c \
	ghash.c \
	glist.c \
	gthread.c \
	garray.c \
	gutils.c \
	gatomic.c \
	gprintf.c \
	gpattern.c \
	guniprop.c \
	gpoll.c \
	grand.c \
	gunidecomp.c \
	gqsort.c \
	gstdio.c

LOCAL_C_INCLUDES:= \
	$(LOCAL_PATH)/../ \
	$(LOCAL_PATH)

LOCAL_CFLAGS:= \
	-DANDROID_STUB

LOCAL_MODULE:=libglib

include $(BUILD_SHARED_LIBRARY)

Fix build - don't prelink glib - do not merge

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
	gdir.c \
	gerror.c \
	giochannel.c \
	gkeyfile.c \
	gmain.c \
	gmem.c \
	goption.c \
	gslice.c \
	gslist.c \
	gstring.c \
	gstrfuncs.c \
	gtimer.c \
	giounix.c \
	gmessages.c \
	gutf8.c \
	gfileutils.c \
	gconvert.c \
	gdataset.c \
	gtestutils.c \
	ghash.c \
	glist.c \
	gthread.c \
	garray.c \
	gutils.c \
	gatomic.c \
	gprintf.c \
	gpattern.c \
	guniprop.c \
	gpoll.c \
	grand.c \
	gunidecomp.c \
	gqsort.c \
	gstdio.c

LOCAL_C_INCLUDES:= \
	$(LOCAL_PATH)/../ \
	$(LOCAL_PATH)

LOCAL_CFLAGS:= \
	-DANDROID_STUB

LOCAL_MODULE:=libglib

LOCAL_PRELINK_MODULE := false

include $(BUILD_SHARED_LIBRARY)


#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# Defines branch-specific values.
#

# BUILD_ID is usually used to specify the branch name
# (like "MAIN") or a branch name and a release candidate
# (like "TC1-RC5").  It must be a single word, and is
# capitalized by convention.
#
BUILD_ID := MASTER

# DISPLAY_BUILD_NUMBER should only be set for development branches,
# If set, the BUILD_NUMBER (cl) is appended to the BUILD_ID for
# a more descriptive BUILD_ID_DISPLAY, otherwise BUILD_ID_DISPLAY
# is the same as BUILD_ID
DISPLAY_BUILD_NUMBER := true

Change branch name to gingerbread, to match reality - DO NOT MERGE

#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# Defines branch-specific values.
#

# BUILD_ID is usually used to specify the branch name
# (like "MAIN") or a branch name and a release candidate
# (like "TC1-RC5").  It must be a single word, and is
# capitalized by convention.
#
BUILD_ID := GINGERBREAD

# DISPLAY_BUILD_NUMBER should only be set for development branches,
# If set, the BUILD_NUMBER (cl) is appended to the BUILD_ID for
# a more descriptive BUILD_ID_DISPLAY, otherwise BUILD_ID_DISPLAY
# is the same as BUILD_ID
DISPLAY_BUILD_NUMBER := true


.ONESHELL:

SHELL = bash
CPU_CORES = $(shell nproc)

# PIP_INSTALL = --editable .
# PYLINT_ARG =
# MYPY_ARG =
# PYTEST_ARG =

SHARED_DEV_REQUIREMENTS = \
	black \
	isort \
	mypy \
	pylint \
	pytest \
	pytest-cov \
	pytest-xdist

VENV = venv
$(VENV):
	python3 -m venv $(VENV)
	source $(VENV)/bin/activate
	pip install --upgrade pip setuptools wheel
	pip install $(SHARED_DEV_REQUIREMENTS) $(PIP_INSTALL)

.PHONY: .format
.format: $(VENV)
	source $(VENV)/bin/activate
	black .
	isort --profile black .

.PHONY: .pylint
.pylint: $(VENV)
	source $(VENV)/bin/activate
	pylint --output-format=colorized $(PYLINT_ARG) || true

.PHONY: .mypy
.mypy: $(VENV)
	source $(VENV)/bin/activate
	mypy $(MYPY_ARG) || true

.PHONY: .pytest
.pytest: $(VENV)
	source venv/bin/activate
	pytest -n $(CPU_CORES) --color=yes -v $(PYTEST_ARG)

.PHONY: .clean
.clean:
	rm -Rf $(VENV)

Split venv setup and package install targets

.ONESHELL:

SHELL = bash
CPU_CORES = $(shell nproc)

# PIP_INSTALL = --editable .
# PYLINT_ARG =
# MYPY_ARG =
# PYTEST_ARG =

SHARED_DEV_REQUIREMENTS = \
	black \
	isort \
	mypy \
	pylint \
	pytest \
	pytest-cov \
	pytest-xdist

VENV = venv
$(VENV):
	python3 -m venv $(VENV)
	source $(VENV)/bin/activate
	$(MAKE) install

install: venv
	source $(VENV)/bin/activate
	pip install --upgrade pip setuptools wheel
	pip install $(SHARED_DEV_REQUIREMENTS) $(PIP_INSTALL)

.PHONY: .format
.format: $(VENV)
	source $(VENV)/bin/activate
	black .
	isort --profile black .

.PHONY: .pylint
.pylint: $(VENV)
	source $(VENV)/bin/activate
	pylint --output-format=colorized $(PYLINT_ARG) || true

.PHONY: .mypy
.mypy: $(VENV)
	source $(VENV)/bin/activate
	mypy $(MYPY_ARG) || true

.PHONY: .pytest
.pytest: $(VENV)
	source venv/bin/activate
	pytest -n $(CPU_CORES) --color=yes -v $(PYTEST_ARG)

.PHONY: .clean
.clean:
	rm -Rf $(VENV)


USE_CAMERA_STUB := true

# inherit from the proprietary version
-include vendor/samsung/schS738c/BoardConfigVendor.mk

TARGET_ARCH := arm
TARGET_NO_BOOTLOADER := true
TARGET_BOARD_PLATFORM := unknown
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_ARCH_VARIANT := armv7-a-neon
ARCH_ARM_HAVE_TLS_REGISTER := true

TARGET_BOOTLOADER_BOARD_NAME := schS738c

BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom loglevel=1
BOARD_KERNEL_BASE := 0x00200000
BOARD_KERNEL_PAGESIZE := 4096

# fix this up by examining /proc/mtd on a running device
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_FLASH_BLOCK_SIZE := 131072

#TARGET_PREBUILT_KERNEL := device/samsung/schS738c/kernel
TARGET_KERNEL_CONFIG := cm_schS738c_defconfig
BOARD_HAS_NO_SELECT_BUTTON := true

Set userimages to use ext4

USE_CAMERA_STUB := true

# inherit from the proprietary version
-include vendor/samsung/schS738c/BoardConfigVendor.mk

TARGET_ARCH := arm
TARGET_NO_BOOTLOADER := true
TARGET_BOARD_PLATFORM := unknown
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_ARCH_VARIANT := armv7-a-neon
TARGET_USERIMAGES_USE_EXT4 := true
ARCH_ARM_HAVE_TLS_REGISTER := true

TARGET_BOOTLOADER_BOARD_NAME := schS738c

BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom loglevel=1
BOARD_KERNEL_BASE := 0x00200000
BOARD_KERNEL_PAGESIZE := 4096

# fix this up by examining /proc/mtd on a running device
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_FLASH_BLOCK_SIZE := 131072

#TARGET_PREBUILT_KERNEL := device/samsung/schS738c/kernel
TARGET_KERNEL_CONFIG := cm_schS738c_defconfig
BOARD_HAS_NO_SELECT_BUTTON := true


# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

$(eval $(call gb_Module_Module,libreofficekit))

ifeq ($(OS),LINUX)

$(eval $(call gb_Module_add_targets,libreofficekit,\
    StaticLibrary_libreofficekit \
))

ifeq ($(MERGELIBS),)
$(eval $(call gb_Module_add_check_targets,libreofficekit,\
    CppunitTest_libreofficekit_tiledrendering \
))
endif

ifneq ($(ENABLE_GTK),)
$(eval $(call gb_Module_add_targets,libreofficekit,\
    Library_libreofficekitgtk \
    Executable_gtktiledviewer \
))
endif # ($(ENABLE_GTK),)

endif # ($(OS),LINUX)

# vim: set ts=4 sw=4 et:

Revert "libreofficekit does not work with libmerged"

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

$(eval $(call gb_Module_Module,libreofficekit))

ifeq ($(OS),LINUX)

$(eval $(call gb_Module_add_targets,libreofficekit,\
    StaticLibrary_libreofficekit \
))

$(eval $(call gb_Module_add_check_targets,libreofficekit,\
    CppunitTest_libreofficekit_tiledrendering \
))

ifneq ($(ENABLE_GTK),)
$(eval $(call gb_Module_add_targets,libreofficekit,\
    Library_libreofficekitgtk \
    Executable_gtktiledviewer \
))
endif # ($(ENABLE_GTK),)

endif # ($(OS),LINUX)

# vim: set ts=4 sw=4 et:


DOCS_DIR = $(ROOT_DIR)/docs
CSS_DIR = $(DOCS_DIR)/css
REPO = $(shell git config --get remote.origin.url)
LOCAL_DOCS_HOST = localhost
LOCAL_DOCS_PORT = 5099
LESS_DIR = src/less
#COLOUR_THEME = dark-green
COLOUR_THEME = elegantblue

blog: blog-clean blog-local

blog-clean:
	@echo "\nCleaning old blog build ..."

blog-pre:
	@echo "\nBuilding blog ...\n"

blog-css:
	@lessc $(LESS_DIR)/styles-$(COLOUR_THEME).less $(CSS_DIR)/styles.css

blog-clojure:
	@frmx gen
	@echo

blog-local: blog-pre blog-css blog-clojure

blog-dev-generated: blog
	@echo "\nRunning blog server from generated static content ..."
	@echo "URL: http://$(LOCAL_DOCS_HOST):$(LOCAL_DOCS_PORT)"
	@lein simpleton $(LOCAL_DOCS_PORT) file :from $(DOCS_DIR)

blog-dev:
	@echo "\nRunning blog server from code ..."
	@echo "URL: http://$(LOCAL_DOCS_HOST):$(LOCAL_DOCS_PORT)"
	@frmx run

.PHONY: blog

Use the port from Clojure config.

DOCS_DIR = $(ROOT_DIR)/docs
CSS_DIR = $(DOCS_DIR)/css
REPO = $(shell git config --get remote.origin.url)
LOCAL_DOCS_HOST = localhost
LOCAL_DOCS_PORT = $(lastword $(shell grep dev-port project.clj))
LESS_DIR = src/less
#COLOUR_THEME = dark-green
COLOUR_THEME = elegantblue

blog: blog-clean blog-local

blog-clean:
	@echo "\nCleaning old blog build ..."

blog-pre:
	@echo "\nBuilding blog ...\n"

blog-css:
	@lessc $(LESS_DIR)/styles-$(COLOUR_THEME).less $(CSS_DIR)/styles.css

blog-clojure:
	@frmx gen
	@echo

blog-local: blog-pre blog-css blog-clojure

blog-dev-generated: blog
	@echo "\nRunning blog server from generated static content ..."
	@echo "URL: http://$(LOCAL_DOCS_HOST):$(LOCAL_DOCS_PORT)"
	@lein simpleton $(LOCAL_DOCS_PORT) file :from $(DOCS_DIR)

blog-dev:
	@echo "\nRunning blog server from code ..."
	@echo "URL: http://$(LOCAL_DOCS_HOST):$(LOCAL_DOCS_PORT)"
	@frmx run

.PHONY: blog


ARMADILLO_VERSION=4.650.3
CMAKE_COMMON_OPTIONS=-DCMAKE_BUILD_TYPE=Release

default:

install-travis:
	sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
	sudo add-apt-repository ppa:smspillaz/cmake-2.8.12 -y
	sudo apt-get update -qq
	sudo apt-get install -y g++-4.8 cmake cmake-data libarmadillo-dev
	wget https://downloads.sourceforge.net/project/arma/armadillo-$(ARMADILLO_VERSION).tar.gz --no-check-certificate
	tar xzf armadillo-$(ARMADILLO_VERSION).tar.gz
	mkdir armadillo-$(ARMADILLO_VERSION)/build
	cd armadillo-$(ARMADILLO_VERSION)/build; \
		cmake .. $(CMAKE_COMMON_OPTIONS); \
		make; \
		sudo make install

.PHONY: default install-travis

Update armadillo version to 6.500.5

ARMADILLO_VERSION=6.500.5
CMAKE_COMMON_OPTIONS=-DCMAKE_BUILD_TYPE=Release

default:

install-travis:
	sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
	sudo add-apt-repository ppa:smspillaz/cmake-2.8.12 -y
	sudo apt-get update -qq
	sudo apt-get install -y g++-4.8 cmake cmake-data libarmadillo-dev
	wget https://downloads.sourceforge.net/project/arma/armadillo-$(ARMADILLO_VERSION).tar.gz --no-check-certificate
	tar xzf armadillo-$(ARMADILLO_VERSION).tar.gz
	mkdir armadillo-$(ARMADILLO_VERSION)/build
	cd armadillo-$(ARMADILLO_VERSION)/build; \
		cmake .. $(CMAKE_COMMON_OPTIONS); \
		make; \
		sudo make install

.PHONY: default install-travis


-load luamake.so

ifdef WINDIR
# ASSUMES we have makenew and libgnumake-1.dll.a in this directory
platform_opts = -L. -lgnumake-1.dll
endif

ifeq ($(shell uname),Darwin)
platform_opts = -undefined dynamic_lookup
endif

luamake.so: luamake.c
	gcc -Wall -shared -o $@ $^ $(platform_opts) -llua5.3 -I/usr/include/lua5.3

.PHONY: test

$(lua require,luamake)

test:
	# Call module function directly
	$(info $(lua proc,hi,another hello))
	# Use eval to convert to string for display
	$(info result is $(lua eval,tostring(55)))

Update link options for Linux

-load luamake.so

ifdef WINDIR
# ASSUMES we have makenew and libgnumake-1.dll.a in this directory
platform_opts = -L. -lgnumake-1.dll
endif

ifeq ($(shell uname),Darwin)
platform_opts = -undefined dynamic_lookup
endif

ifeq ($(shell uname),Linux)
platform_opts = -fPIC
endif

luamake.so: luamake.c
	gcc -Wall -shared -o $@ $^ $(platform_opts) -llua5.3 -I/usr/include/lua5.3

.PHONY: test

$(lua require,luamake)

test:
	# Call module function directly
	$(info $(lua proc,hi,another hello))
	# Use eval to convert to string for display
	$(info result is $(lua eval,tostring(55)))


#-*-makefile-*-   ; force emacs to enter makefile-mode

# %CopyrightBegin%
#
# Copyright Ericsson AB 1997-2011. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# %CopyrightEnd%

APPLICATION = snmp
SNMP_VSN = 4.21.3
PRE_VSN  =
APP_VSN  = "$(APPLICATION)-$(SNMP_VSN)$(PRE_VSN)"

Update snmp to correct version

#-*-makefile-*-   ; force emacs to enter makefile-mode

# %CopyrightBegin%
#
# Copyright Ericsson AB 1997-2011. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# %CopyrightEnd%

APPLICATION = snmp
SNMP_VSN = 4.21.4
PRE_VSN  =
APP_VSN  = "$(APPLICATION)-$(SNMP_VSN)$(PRE_VSN)"


include $(top_srcdir)/build-aux/init.mk
# Get $(libport_la).
# lib_libport = ../lib/libport
# include $(top_srcdir)/lib/libport/libport-sources.mk

# Find the kernel private headers.  location.hh etc. are generated.
AM_CPPFLAGS += -I$(srcdir) -I.

# Find the uobject headers
AM_CPPFLAGS += -I$(srcdir)/uobject

# Find the kernel, libport, etc. headers.
AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include

# lib/network
AM_CPPFLAGS += -I$(top_srcdir)/lib

# Find sdk/config.h.
AM_CPPFLAGS += -I$(top_builddir)

# Find uobject headers.
AM_CPPFLAGS += -I$(srcdir)/uobject

AM_CXXFLAGS += $(WARNING_CXXFLAGS) $(PTHREAD_CFLAGS)

# Add boost libraries.
AM_CPPFLAGS += $(BOOST_CPPFLAGS)
AM_LDFLAGS  += $(BOOST_THREAD_LDFLAGS)
# There is no AM_LIBADD.
LIBS        += $(BOOST_THREAD_LIBS)

Include $(builddir)/uobject during the build

include $(top_srcdir)/build-aux/init.mk
# Get $(libport_la).
# lib_libport = ../lib/libport
# include $(top_srcdir)/lib/libport/libport-sources.mk

# Find the kernel private headers.  location.hh etc. are generated.
AM_CPPFLAGS += -I$(srcdir) -I.

# Find the uobject headers
AM_CPPFLAGS += -I$(srcdir)/uobject -Iuobject

# Find the kernel, libport, etc. headers.
AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include

# lib/network
AM_CPPFLAGS += -I$(top_srcdir)/lib

# Find sdk/config.h.
AM_CPPFLAGS += -I$(top_builddir)

# Find uobject headers.
AM_CPPFLAGS += -I$(srcdir)/uobject

AM_CXXFLAGS += $(WARNING_CXXFLAGS) $(PTHREAD_CFLAGS)

# Add boost libraries.
AM_CPPFLAGS += $(BOOST_CPPFLAGS)
AM_LDFLAGS  += $(BOOST_THREAD_LDFLAGS)
# There is no AM_LIBADD.
LIBS        += $(BOOST_THREAD_LIBS)


mod_sqrl.la: mod_sqrl.slo utils.slo
	$(SH_LINK) -rpath $(libexecdir) -module -avoid-version  mod_sqrl.lo utils.lo

DISTCLEAN_TARGETS = modules.mk
shared =  mod_sqrl.la

Update build system for new files.

mod_sqrl.la: mod_sqrl.slo sqrl.slo sqrl_encodings.slo
	$(SH_LINK) -rpath $(libexecdir) -module -avoid-version  mod_sqrl.lo sqrl.lo sqrl_encodings.lo

DISTCLEAN_TARGETS = modules.mk
shared =  mod_sqrl.la


LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_C_INCLUDES += $(LOCAL_PATH)/src

LOCAL_SRC_FILES := \
	jni/org_pocketworkstation_pckeyboard_BinaryDictionary.cpp \
	src/dictionary.cpp \
	src/char_utils.cpp

ifneq ($(TARGET_ARCH),x86)
LOCAL_NDK_VERSION := 4
LOCAL_SDK_VERSION := 8
endif

LOCAL_MODULE := libjni_pckeyboard

LOCAL_MODULE_TAGS := user

include $(BUILD_SHARED_LIBRARY)

Remove old x86 SDK hack

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_C_INCLUDES += $(LOCAL_PATH)/src

LOCAL_SRC_FILES := \
	jni/org_pocketworkstation_pckeyboard_BinaryDictionary.cpp \
	src/dictionary.cpp \
	src/char_utils.cpp

#ifneq ($(TARGET_ARCH),x86)
#LOCAL_NDK_VERSION := 4
#LOCAL_SDK_VERSION := 8
#endif

LOCAL_MODULE := libjni_pckeyboard

LOCAL_MODULE_TAGS := user

include $(BUILD_SHARED_LIBRARY)


TARGET=GPIMAKEMAKE

all: $(patsubst %.md,%.pdf,$(wildcard *.md))

# Generalized rule: how to build a .pdf from each .md
%.pdf: %.md template.tex
	pandoc --template template.tex -f markdown+tex_math_single_backslash -t latex -o $@ $<

touch:
	touch *.md

again: touch all

clean:
	rm -f *.aux *.log *.nav *.out *.snm *.toc *.vrb || true

veryclean: clean
	rm -f *.pdf

view: $(TARGET).pdf
	if [ "Darwin" = "$(shell uname)" ]; then open $(TARGET).pdf ; else evince $(TARGET).pdf ; fi

submit: $(TARGET).pdf
	cp $(TARGET).pdf ../

print: $(TARGET).pdf
	lpr $(TARGET).pdf

.PHONY: all again touch clean veryclean view print

Add rule for compiling the intermediate TeX

TARGET=GPIMAKEMAKE

all: $(patsubst %.md,%.pdf,$(wildcard *.md))

# Generalized rule: how to build a .pdf from each .md
%.pdf: %.md template.tex
	pandoc --template template.tex -f markdown+tex_math_single_backslash -t latex -o $@ $<

# Generalized rule: how to build a .tex from each .md
%.tex: %.md
	pandoc --standalone --template template.tex -f markdown+tex_math_single_backslash -t latex -o $@ $<

touch:
	touch *.md

again: touch all

clean:
	rm -f *.aux *.log *.nav *.out *.snm *.toc *.vrb || true

veryclean: clean
	rm -f *.pdf

view: $(TARGET).pdf
	if [ "Darwin" = "$(shell uname)" ]; then open $(TARGET).pdf ; else evince $(TARGET).pdf ; fi

submit: $(TARGET).pdf
	cp $(TARGET).pdf ../

print: $(TARGET).pdf
	lpr $(TARGET).pdf

.PHONY: all again touch clean veryclean view print


## Build target for Stack examples

# Queues
build/topostfix.o: examples/stacks/topostfix.c | build
	$(CC) $(CFLAGS) -c $^ -o $@

build/topostfix: examples/stacks/topostfix.o build/sl_stack.o
	$(CC) $(LDFLAGS) $^ -o $@

topostfix: build/topostfix

topostfix_test: topostfix
	echo "123+45+98534" | ./build/$^
	echo "123+45-STRING&8+98534" | ./build/$^

topostfix_vg: topostfix
	echo "123+45+98534-1326847#123276!438947StRiNg222*11111" | valgrind -v --leak-check=full build/$^

Add test coverage to topostfix with some test cases.

## Build target for Stack examples

# Queues
build/topostfix.o: examples/stacks/topostfix.c | build
	$(CC) $(CFLAGS) -c $^ -o $@

build/topostfix: build/topostfix.o build/sl_stack.o
	$(CC) $(LDFLAGS) $^ -o $@

topostfix: build/topostfix

topostfix_test: topostfix
	echo "Test: A*B+C -> AB*C+;"
	echo "A*B+C" | ./build/$^
	echo "Test: A+B*C -> ABC*+;"
	echo "A+B*C" | ./build/$^
	echo "Test: A*(B+C) -> ABC+*;"
	echo "A*(B+C)" | ./build/$^
	echo "Test: A-B+C -> AB-C+;"
	echo "A-B+C" | ./build/$^
	echo "Test: A*B^C+D -> ABC^*D+;"
	echo "A*B^C+D" | ./build/$^
	echo "Test: A*(B+C*D)+E -> ABCD*+*E+;"
	echo "A*(B+C*D)+E" | ./build/$^

topostfix_vg: topostfix
	echo "123+45+98534-1326847#123276!438947StRiNg222*11111" | valgrind -v --leak-check=full build/$^


# vis version
VERSION = devel

# Customize below to fit your system

PREFIX ?= /usr/local
MANPREFIX = ${PREFIX}/share/man

INCS = -I.
LIBS = -lc -lncursesw

ifeq ($(shell uname),Darwin)
	LIBS = -lc -lncurses
	CFLAGS += -D_DARWIN_C_SOURCE
else ifeq ($(shell uname),OpenBSD)
	CFLAGS += -D_BSD_SOURCE
else ifeq ($(shell uname),FreeBSD)
	CFLAGS += -D_BSD_SOURCE
else ifeq ($(shell uname),NetBSD)
	LIBS = -lc -lcurses
	CFLAGS += -D_BSD_SOURCE
else ifeq ($(shell uname),SunOS)
	INCS += -I/usr/include/ncurses
else ifeq ($(shell uname),AIX)
	CFLAGS += -D_ALL_SOURCE
endif

CFLAGS += -std=c99 -Os ${INCS} -DVERSION=\"${VERSION}\" -DNDEBUG -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700

LDFLAGS += ${LIBS}

DEBUG_CFLAGS = ${CFLAGS} -UNDEBUG -O0 -g -ggdb -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter

CC ?= cc
STRIP ?= strip

Add hardening flags for gcc and clang

# vis version
VERSION = devel

# Customize below to fit your system

PREFIX ?= /usr/local
MANPREFIX = ${PREFIX}/share/man

INCS = -I.
LIBS = -lc -lncursesw

ifeq ($(shell uname),Darwin)
	LIBS = -lc -lncurses
	CFLAGS += -D_DARWIN_C_SOURCE
else ifeq ($(shell uname),OpenBSD)
	CFLAGS += -D_BSD_SOURCE
else ifeq ($(shell uname),FreeBSD)
	CFLAGS += -D_BSD_SOURCE
else ifeq ($(shell uname),NetBSD)
	LIBS = -lc -lcurses
	CFLAGS += -D_BSD_SOURCE
else ifeq ($(shell uname),SunOS)
	INCS += -I/usr/include/ncurses
else ifeq ($(shell uname),AIX)
	CFLAGS += -D_ALL_SOURCE
endif

CFLAGS += -std=c99 -Os ${INCS} -DVERSION=\"${VERSION}\" -DNDEBUG -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700

LDFLAGS += ${LIBS}

DEBUG_CFLAGS = ${CFLAGS} -UNDEBUG -O0 -g -ggdb -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter

CC ?= cc
STRIP ?= strip

# Hardening
ifeq (${CC},gcc)
	CFLAGS += -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2
	LDFLAGS += -z now -z relro -pie
else ifeq (${CC},clang)
	CFLAGS += -fPIE -fstack-protector-all -D_FORTIFY_SOURCE=2
	LDFLAGS += -z now -z relro -pie
endif


# Compilation flags for all files.
CFLAGS += -ansi
# X/Open 6.0 standardizes features used in this K&R C source...
CPPDEFINES = -D_XOPEN_SOURCE=600
# utf8proc lib usually lives in here:
CPPFLAGS := $(CPPFLAGS) -I/usr/local/include $(CPPDEFINES)
LDFLAGS += -L/usr/local/lib
LDLIBS = -lm -lutf8proc

Allow extension of CFLAGS on cmdline.

# Compilation flags for all files.
override CFLAGS := $(CFLAGS) -ansi
# X/Open 6.0 standardizes features used in this K&R C source...
CPPDEFINES = -D_XOPEN_SOURCE=600
# utf8proc lib usually lives in here:
CPPFLAGS := $(CPPFLAGS) -I/usr/local/include $(CPPDEFINES)
LDFLAGS += -L/usr/local/lib
LDLIBS = -lm -lutf8proc


# Copyright (C) 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := tests

LOCAL_SDK_VERSION := current

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := SupportAnimatedVectorDrawable

LOCAL_STATIC_JAVA_LIBRARIES := android-support-animatedvectordrawable android-support-v4

LOCAL_AAPT_FLAGS += --auto-add-overlay \
        --extra-packages android.support.graphics.drawable \
        --no-version-vectors

include $(BUILD_PACKAGE)

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))

Fix SupportVectorDrawable sample not building

# Copyright (C) 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := tests

LOCAL_SDK_VERSION := current

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := SupportAnimatedVectorDrawable

LOCAL_STATIC_JAVA_LIBRARIES := android-support-animatedvectordrawable \
        android-support-vectordrawable \
        android-support-v4

LOCAL_AAPT_FLAGS += --auto-add-overlay \
        --extra-packages android.support.graphics.drawable \
        --no-version-vectors

include $(BUILD_PACKAGE)

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))


# wmii version
VERSION = $$(hg tip | awk -F '[: ]+' '/^changeset:/ { print "hg" $$2 }')
CONFVERSION = 3.5

# Customize below to fit your system

# paths
PREFIX = /usr/local
CONFPREFIX = ${PREFIX}/etc
MANPREFIX = ${PREFIX}/share/man

X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib

# includes and libs
INCS = -I. -I${PREFIX}/include -I/usr/include -I${X11INC}
LIBS = -L/usr/lib -lc -lm -L${X11LIB} -lX11 -L${PREFIX}/lib -lixp

# flags
#CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = ${LIBS}
CFLAGS = -g -Wall ${INCS} -DVERSION=\"${VERSION}\"
LDFLAGS = -g ${LIBS}

# Solaris
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = ${LIBS} -R${PREFIX}/lib
#LDFLAGS += -lsocket -lnsl
#CFLAGS += -xtarget=ultra

# compiler and linker
CC = cc

Use --template instead of awk for VERSION as suggested by Maxi

# wmii version
VERSION = $$(hg tip --template 'hg\#rev\#')
CONFVERSION = 3.5

# Customize below to fit your system

# paths
PREFIX = /usr/local
CONFPREFIX = ${PREFIX}/etc
MANPREFIX = ${PREFIX}/share/man

X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib

# includes and libs
INCS = -I. -I${PREFIX}/include -I/usr/include -I${X11INC}
LIBS = -L/usr/lib -lc -lm -L${X11LIB} -lX11 -L${PREFIX}/lib -lixp

# flags
#CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = ${LIBS}
CFLAGS = -g -Wall ${INCS} -DVERSION=\"${VERSION}\"
LDFLAGS = -g ${LIBS}

# Solaris
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = ${LIBS} -R${PREFIX}/lib
#LDFLAGS += -lsocket -lnsl
#CFLAGS += -xtarget=ultra

# compiler and linker
CC = cc


# sinit version
VERSION = 0.7

# paths
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/man

CC = cc
LD = $(CC)
CPPFLAGS =
CFLAGS   = -Wextra -Werror -Wall -Os $(CPPFLAGS)
LDFLAGS  = -static

Bump up version to v0.8

# sinit version
VERSION = 0.8

# paths
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/man

CC = cc
LD = $(CC)
CPPFLAGS =
CFLAGS   = -Wextra -Werror -Wall -Os $(CPPFLAGS)
LDFLAGS  = -static


# swc: config.mk

PREFIX          = /usr/local
BINDIR          = $(PREFIX)/bin
LIBDIR          = $(PREFIX)/lib
INCLUDEDIR      = $(PREFIX)/include
PKGCONFIGDIR    = $(LIBDIR)/pkgconfig

CC              = gcc
CPPFLAGS        = -D_GNU_SOURCE # Required for mkostemp
CFLAGS          = -O2 -pipe -g
PKG_CONFIG      = pkg-config
WAYLAND_SCANNER = wayland-scanner

ENABLE_STATIC   = 1
ENABLE_SHARED   = 1

Allow environment to override PKG_CONFIG and WAYLAND_SCANNER

# swc: config.mk

PREFIX          = /usr/local
BINDIR          = $(PREFIX)/bin
LIBDIR          = $(PREFIX)/lib
INCLUDEDIR      = $(PREFIX)/include
PKGCONFIGDIR    = $(LIBDIR)/pkgconfig

CC              = gcc
CPPFLAGS        = -D_GNU_SOURCE # Required for mkostemp
CFLAGS          = -O2 -pipe -g
PKG_CONFIG      ?= pkg-config
WAYLAND_SCANNER ?= wayland-scanner

ENABLE_STATIC   = 1
ENABLE_SHARED   = 1


###################################

include $(MakePath)/trait/freestanding.mk
include $(MakePath)/trait/ps4.mk

###################################

include $(MakePath)/trait/kernel_execute.mk
include $(MakePath)/trait/common.mk
include $(MakePath)/trait/adaptive.mk
include $(MakePath)/trait/sce.mk
include $(MakePath)/trait/kernel.mk
include $(MakePath)/trait/base.mk
include $(MakePath)/trait/system_call_rop_0x93a4FFFF8.mk

###################################

ifndef KeepElf
ifdef keepelf
KeepElf := $(keepelf)
endif
ifdef KEEPELF
KeepElf := $(KEEPELF)
endif
endif

###################################

#Text ?= 0x926200000
Text ?= 0x93a300000
#Data ?= 0x926300000
Data ?= 0x93a400000

###################################

LinkerFlags += -Wl,-Ttext,$(Text) -Wl,-Tdata,$(Data)
#LinkerFlags += -Wl,--build-id=none -Ttext $(Text) -Tdata $(Data)

###################################

bincopy = $(ObjectCopy) $@ -O binary $@
copy = cp $@ $@.elf

###################################

$(OutPath)/$(TargetFile):: $(ObjectFiles)
	$(dirp)
	$(link)
ifdef KeepElf
	$(copy)
endif
	$(bincopy)

###################################

include $(MakePath)/trait/all_and_clean.mk

###################################

Add linker definition to binary build target

###################################

include $(MakePath)/trait/freestanding.mk
include $(MakePath)/trait/ps4.mk

###################################

include $(MakePath)/trait/kernel_execute.mk
include $(MakePath)/trait/common.mk
include $(MakePath)/trait/adaptive.mk
include $(MakePath)/trait/sce.mk
include $(MakePath)/trait/kernel.mk
include $(MakePath)/trait/base.mk
include $(MakePath)/trait/system_call_rop_0x93a4FFFF8.mk

###################################

ifndef KeepElf
ifdef keepelf
KeepElf := $(keepelf)
endif
ifdef KEEPELF
KeepElf := $(KEEPELF)
endif
endif

###################################

LinkerFlags += -Xlinker -T $(Ps4Sdk)/linker.x -Wl,--build-id=none

###################################

bincopy = $(ObjectCopy) $@ -O binary $@
copy = cp $@ $@.elf

###################################

$(OutPath)/$(TargetFile):: $(ObjectFiles)
	$(dirp)
	$(link)
ifdef KeepElf
	$(copy)
endif
	$(bincopy)

###################################

include $(MakePath)/trait/all_and_clean.mk

###################################


TOPDIR = ..\..

HEADERS			= pkcs11.h
HEADERSDIRFROM2		= rsaref

HEADERSDIR		= $(TOPDIR)\src\include\opensc
HEADERSDIR2		= $(TOPDIR)\src\include\opensc\rsaref

TARGET                  = opensc-pkcs11.dll
TARGET2			= libpkcs11.lib

OBJECTS			= pkcs11-global.obj pkcs11-session.obj pkcs11-object.obj misc.obj slot.obj \
			  secretkey.obj framework-pkcs15.obj framework-pkcs15init.obj mechanism.obj \
			  openssl.obj debug.obj
OBJECTS2		= libpkcs11.obj

all: install-headers install-headers-dir $(TARGET) $(TARGET2)

!INCLUDE $(TOPDIR)\win32\Make.rules.mak

$(TARGET): $(OBJECTS)
	link $(LINKFLAGS) /dll /out:$(TARGET) $(OBJECTS) ..\libopensc\opensc.lib ..\scconf\scconf.lib ..\scrandom\scrandom.lib ..\pkcs15init\pkcs15init.lib winscard.lib

$(TARGET2): $(OBJECTS2)
	lib /nologo /machine:ix86 /out:$(TARGET2) $(OBJECTS2) ..\scdl\scdl.lib

Build the pkcs11 spy on Win32

TOPDIR = ..\..

HEADERS			= pkcs11.h
HEADERSDIRFROM2		= rsaref

HEADERSDIR		= $(TOPDIR)\src\include\opensc
HEADERSDIR2		= $(TOPDIR)\src\include\opensc\rsaref

TARGET                  = opensc-pkcs11.dll
TARGET2			= libpkcs11.lib
TARGET3			= opensc-spy.dll

OBJECTS			= pkcs11-global.obj pkcs11-session.obj pkcs11-object.obj misc.obj slot.obj \
			  secretkey.obj framework-pkcs15.obj framework-pkcs15init.obj mechanism.obj \
			  openssl.obj debug.obj
OBJECTS2		= libpkcs11.obj
OBJECTS3		= pkcs11-spy.obj pkcs11-display.obj libpkcs11.obj

all: install-headers install-headers-dir $(TARGET) $(TARGET2) $(TARGET3)

!INCLUDE $(TOPDIR)\win32\Make.rules.mak

$(TARGET): $(OBJECTS)
	link $(LINKFLAGS) /dll /out:$(TARGET) $(OBJECTS) ..\libopensc\opensc.lib ..\scconf\scconf.lib ..\scrandom\scrandom.lib ..\pkcs15init\pkcs15init.lib winscard.lib

$(TARGET2): $(OBJECTS2)
	lib /nologo /machine:ix86 /out:$(TARGET2) $(OBJECTS2) ..\scdl\scdl.lib

$(TARGET3): $(OBJECTS)
	link $(LINKFLAGS) /dll /out:$(TARGET3) $(OBJECTS3) ..\scdl\scdl.lib


LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := libpomp
LOCAL_MODULE_TAGS := optional
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_CFLAGS := -Wextra -fvisibility=hidden

ifdef NDK_PROJECT_PATH
    LOCAL_CFLAGS += -DANDROID_NDK
    LOCAL_EXPORT_C_INCLUDES := $(LOCAL_EXPORT_C_INCLUDE_DIRS)
endif

LOCAL_SRC_FILES := \
	src/pomp_addr.c \
	src/pomp_conn.c \
	src/pomp_ctx.c \
	src/pomp_decoder.c \
	src/pomp_encoder.c \
	src/pomp_log.c \
	src/pomp_loop.c \
	src/pomp_msg.c \
	src/pomp_prot.c \
	src/pomp_timer.c

ifdef NDK_PROJECT_PATH
include $(BUILD_STATIC_LIBRARY)
else
include $(BUILD_SHARED_LIBRARY)
LOCAL_SHARED_LIBRARIES := liblog
endif

Fix previous commit that break android build

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := libpomp
LOCAL_MODULE_TAGS := optional
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_CFLAGS := -Wextra -fvisibility=hidden

ifdef NDK_PROJECT_PATH
    LOCAL_CFLAGS += -DANDROID_NDK
    LOCAL_EXPORT_C_INCLUDES := $(LOCAL_EXPORT_C_INCLUDE_DIRS)
endif

LOCAL_SRC_FILES := \
	src/pomp_addr.c \
	src/pomp_conn.c \
	src/pomp_ctx.c \
	src/pomp_decoder.c \
	src/pomp_encoder.c \
	src/pomp_log.c \
	src/pomp_loop.c \
	src/pomp_msg.c \
	src/pomp_prot.c \
	src/pomp_timer.c

ifdef NDK_PROJECT_PATH
include $(BUILD_STATIC_LIBRARY)
else
LOCAL_SHARED_LIBRARIES := liblog
include $(BUILD_SHARED_LIBRARY)
endif