# 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-9
APP_OPTIM := release

APP_CFLAGS += -finline-functions -ffast-math -ffunction-sections -fdata-sections -fvisibility=hidden -fPIC
APP_LDFLAGS += -Wl,--gc-sections -fPIC

NDK_TOOLCHAIN_VERSION := clang

Remove PIC flag, Android NDK use it as default

# 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-9
APP_OPTIM := release

APP_CFLAGS += -finline-functions -ffast-math -ffunction-sections -fdata-sections -fvisibility=hidden
APP_LDFLAGS += -Wl,--gc-sections

NDK_TOOLCHAIN_VERSION := clang


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

Use XeLaTeX for compiling with Pandoc

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 --latex-engine=xelatex -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


# Copyright (c) 2013-2016, Loïc Hoguin <essen@ninenines.eu>
# This file is part of erlang.mk and subject to the terms of the ISC License.

.PHONY: distclean-edoc edoc

# Configuration.

EDOC_OPTS ?=
EDOC_SRC_DIRS ?=
EDOC_OUTPUT ?= doc

define edoc.erl
	SrcPaths = lists:foldl(fun(P, Acc) ->
		filelib:wildcard(atom_to_list(P) ++ "/{src,c_src}") ++ Acc
	end, [], [$(call comma_list,$(patsubst %,'%',$(EDOC_SRC_DIRS)))]),
	DefaultOpts = [{dir, "$(EDOC_OUTPUT)"}, {source_path, SrcPaths}, {subpackages, false}],
	edoc:application($(1), ".", [$(2)] ++ DefaultOpts),
	halt(0).
endef

# Core targets.

ifneq ($(strip $(EDOC_SRC_DIRS)$(wildcard doc/overview.edoc)),)
docs:: edoc
endif

distclean:: distclean-edoc

# Plugin-specific targets.

edoc: distclean-edoc doc-deps
	$(gen_verbose) $(call erlang,$(call edoc.erl,$(PROJECT),$(EDOC_OPTS)))

distclean-edoc:
	$(gen_verbose) rm -f $(EDOC_OUTPUT)/*.css $(EDOC_OUTPUT)/*.html $(EDOC_OUTPUT)/*.png $(EDOC_OUTPUT)/edoc-info

Fix the EDOC_SRC_DIRS paths on Windows

# Copyright (c) 2013-2016, Loïc Hoguin <essen@ninenines.eu>
# This file is part of erlang.mk and subject to the terms of the ISC License.

.PHONY: distclean-edoc edoc

# Configuration.

EDOC_OPTS ?=
EDOC_SRC_DIRS ?=
EDOC_OUTPUT ?= doc

define edoc.erl
	SrcPaths = lists:foldl(fun(P, Acc) ->
		filelib:wildcard(atom_to_list(P) ++ "/{src,c_src}") ++ Acc
	end, [], [$(call comma_list,$(patsubst %,'%',$(call core_native_path,$(EDOC_SRC_DIRS))))]),
	DefaultOpts = [{dir, "$(EDOC_OUTPUT)"}, {source_path, SrcPaths}, {subpackages, false}],
	edoc:application($(1), ".", [$(2)] ++ DefaultOpts),
	halt(0).
endef

# Core targets.

ifneq ($(strip $(EDOC_SRC_DIRS)$(wildcard doc/overview.edoc)),)
docs:: edoc
endif

distclean:: distclean-edoc

# Plugin-specific targets.

edoc: distclean-edoc doc-deps
	$(gen_verbose) $(call erlang,$(call edoc.erl,$(PROJECT),$(EDOC_OPTS)))

distclean-edoc:
	$(gen_verbose) rm -f $(EDOC_OUTPUT)/*.css $(EDOC_OUTPUT)/*.html $(EDOC_OUTPUT)/*.png $(EDOC_OUTPUT)/edoc-info


check-coding-style:
	@fail=0; \
	if test -n "$(check_misc_sources)"; then \
		tools_dir=$(top_srcdir)/tools \
		sh $(top_srcdir)/tools/check-misc.sh \
			$(check_misc_sources) || fail=1; \
	fi; \
	if test -n "$(check_c_sources)"; then \
		tools_dir=$(top_srcdir)/tools \
		sh $(top_srcdir)/tools/check-c-style.sh \
			$(check_c_sources) || fail=1; \
	fi;\
	if test yes = "$(ENABLE_CODING_STYLE_CHECKS)"; then \
		exit "$$fail";\
	else \
		exit 0;\
	fi

Fix coding style checks for out-of-tree builds

check-coding-style:
	@fail=0; \
	if test -n "$(check_misc_sources)"; then \
		tools_dir=$(top_srcdir)/tools \
		sh $(top_srcdir)/tools/check-misc.sh \
			$(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \
	fi; \
	if test -n "$(check_c_sources)"; then \
		tools_dir=$(top_srcdir)/tools \
		sh $(top_srcdir)/tools/check-c-style.sh \
			$(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \
	fi;\
	if test yes = "$(ENABLE_CODING_STYLE_CHECKS)"; then \
		exit "$$fail";\
	else \
		exit 0;\
	fi


PLATFORM=__MACH__
PORTDIR=osx
CC=g++
LINK=g++
GCC=gcc
LINK_OPT=
LD_OPT=-undefined dynamic_lookup -shared -fPIC -pthread
JAVA_PLAT_INCLUDE=${JAVA_SDK_INCLUDE}
OBJOPT=-o"$@"
ARCHIVE=ar -r
ARCHIVE_MQTT=ar -r ${MQTT_LIB}
ARC_EXT=a
CFLAGS=-O3 -Wall -pthread -c -fmessage-length=0 -std=c++0x -fPIC
LIB_EXT=so
EXE_EXT=
LIBFLAGS=-shared -fPIC -pthread -ldl
LIB_OBJOPT=-o"$@"
LIBPATH=-L
EXEFLAGS=
LIB_PREFIX=lib
#ifdef NODE_SDK
NODE_GYP=PATH=${NODE_SDK}/bin:$$PATH ${NODE_SDK}/lib/node_modules/npm/bin/node-gyp-bin/node-gyp ${OPT_PYTHON}
#endif

Change gcc compiler to allow -std=c++0x option

PLATFORM=__MACH__
PORTDIR=osx
CC=g++
LINK=g++
GCC=g++
LINK_OPT=
LD_OPT=-undefined dynamic_lookup -shared -fPIC -pthread
JAVA_PLAT_INCLUDE=${JAVA_SDK_INCLUDE}
OBJOPT=-o"$@"
ARCHIVE=ar -r
ARCHIVE_MQTT=ar -r ${MQTT_LIB}
ARC_EXT=a
CFLAGS=-O3 -Wall -pthread -c -fmessage-length=0 -std=c++0x -fPIC
LIB_EXT=so
EXE_EXT=
LIBFLAGS=-shared -fPIC -pthread -ldl
LIB_OBJOPT=-o"$@"
LIBPATH=-L
EXEFLAGS=
LIB_PREFIX=lib
#ifdef NODE_SDK
NODE_GYP=PATH=${NODE_SDK}/bin:$$PATH ${NODE_SDK}/lib/node_modules/npm/bin/node-gyp-bin/node-gyp ${OPT_PYTHON}
#endif


################################################################################
# Automatically-generated file. Do not edit!
################################################################################

# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../model/Model.cpp

OBJS += \
./model/Model.o

CPP_DEPS += \
./model/Model.d

# Each subdirectory must supply rules for building sources it contributes
model/%.o: ../model/%.cpp
	@echo 'Building file: $<'
	@echo 'Invoking: GCC C++ Compiler'
	g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
	@echo 'Finished building: $<'
	@echo ' '

Add BZWParser.cpp to the build

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../model/Model.cpp \
../model/BZWParser.cpp

OBJS += \
./model/Model.o \
./model/BZWParser.o

CPP_DEPS += \
./model/Model.d \
./model/BZWParser.d

# Each subdirectory must supply rules for building sources it contributes
model/%.o: ../model/%.cpp
	@echo 'Building file: $<'
	@echo 'Invoking: GCC C++ Compiler'
	g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
	@echo 'Finished building: $<'
	@echo ' '


LOCAL_DIR := $(GET_LOCAL_DIR)

INCLUDES += -I$(LOCAL_DIR)/include -I$(LK_TOP_DIR)/platform/msm_shared

PLATFORM := mpq8092

MEMBASE := 0x0FF00000 # SDRAM
MEMSIZE := 0x00100000 # 1MB

BASE_ADDR        := 0x00000

TAGS_ADDR        := BASE_ADDR+0x00000100
KERNEL_ADDR      := BASE_ADDR+0x00008000
RAMDISK_ADDR     := BASE_ADDR+0x01000000
SCRATCH_ADDR     := 0x10000000

MODULES += \
	dev/keys \
	lib/ptable \
	dev/pmic/pm8x41 \
	lib/libfdt

DEFINES += \
	MEMSIZE=$(MEMSIZE) \
	MEMBASE=$(MEMBASE) \
	BASE_ADDR=$(BASE_ADDR) \
	TAGS_ADDR=$(TAGS_ADDR) \
	KERNEL_ADDR=$(KERNEL_ADDR) \
	RAMDISK_ADDR=$(RAMDISK_ADDR) \
	SCRATCH_ADDR=$(SCRATCH_ADDR)

OBJS += \
	$(LOCAL_DIR)/init.o \
	$(LOCAL_DIR)/meminfo.o

Correct the memory bases for MPQ8092.

LOCAL_DIR := $(GET_LOCAL_DIR)

INCLUDES += -I$(LOCAL_DIR)/include -I$(LK_TOP_DIR)/platform/msm_shared

PLATFORM := mpq8092

MEMBASE := 0x0FF00000 # SDRAM
MEMSIZE := 0x00100000 # 1MB

BASE_ADDR        := 0x00000

TAGS_ADDR        := BASE_ADDR+0x01000000
KERNEL_ADDR      := BASE_ADDR+0x00008000
RAMDISK_ADDR     := BASE_ADDR+0x01100000
SCRATCH_ADDR     := 0x20000000

MODULES += \
	dev/keys \
	lib/ptable \
	dev/pmic/pm8x41 \
	lib/libfdt

DEFINES += \
	MEMSIZE=$(MEMSIZE) \
	MEMBASE=$(MEMBASE) \
	BASE_ADDR=$(BASE_ADDR) \
	TAGS_ADDR=$(TAGS_ADDR) \
	KERNEL_ADDR=$(KERNEL_ADDR) \
	RAMDISK_ADDR=$(RAMDISK_ADDR) \
	SCRATCH_ADDR=$(SCRATCH_ADDR)

OBJS += \
	$(LOCAL_DIR)/init.o \
	$(LOCAL_DIR)/meminfo.o


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
utils/haddock_dist_SHELL_WRAPPER = YES
utils/haddock_dist_PROG = haddock

$(INPLACE_BIN)/$(utils/haddock_dist_PROG): inplace/lib/html

inplace/lib/html:
	$(RM) -rf $@
	cp -a utils/haddock/html $@

INSTALL_LIBEXECS += utils/haddock/dist/build/$(utils/haddock_dist_PROG)

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

utils/haddock_dist_MODULES += Paths_haddock

Fix (with a hack?) haddock in teh new build system

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
utils/haddock_dist_SHELL_WRAPPER = YES
utils/haddock_dist_PROG = haddock
# XXX Is this a hack? Should it be needed? Done another way?
utils/haddock_dist_DATADIR = lib

$(INPLACE_BIN)/$(utils/haddock_dist_PROG): inplace/lib/html

inplace/lib/html:
	$(RM) -rf $@
	cp -a utils/haddock/html $@

INSTALL_LIBEXECS += utils/haddock/dist/build/$(utils/haddock_dist_PROG)

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

utils/haddock_dist_MODULES += Paths_haddock


# this Makefile holds information about known Ansible roles
# it can be updated from the repository, while the main "Makefile" can be changed

available-roles:
	@echo ""
	@echo "Available roles:"
	@echo ""
	@echo "common:		a common Ansible role to install a host"
	@echo "		https://github.com/andreasscherbaum/ansible-common"
	@echo "gpdb-ansible:	an Ansible role to install Greenplum Database"
	@echo "		https://github.com/andreasscherbaum/gpdb-ansible"

common:
ifneq  (,$(wildcard roles/common))
	cd roles/common && git pull
	ln -s roles/common/ansible.mk ansible-common.mk
else
	git clone https://github.com/andreasscherbaum/ansible-common.git roles/common
endif

gpdb:
ifneq  (,$(wildcard roles/gpdb-ansible))
	cd roles/gpdb-ansible && git pull
	ln -s roles/gpdb-ansible/ansible.mk ansible-gpdb-ansible.mk
else
	git clone https://github.com/andreasscherbaum/gpdb-ansible.git roles/gpdb-ansible
endif

Move link creation into the right place

# this Makefile holds information about known Ansible roles
# it can be updated from the repository, while the main "Makefile" can be changed

available-roles:
	@echo ""
	@echo "Available roles:"
	@echo ""
	@echo "common:		a common Ansible role to install a host"
	@echo "		https://github.com/andreasscherbaum/ansible-common"
	@echo "gpdb-ansible:	an Ansible role to install Greenplum Database"
	@echo "		https://github.com/andreasscherbaum/gpdb-ansible"

common:
ifneq  (,$(wildcard roles/common))
	cd roles/common && git pull
else
	git clone https://github.com/andreasscherbaum/ansible-common.git roles/common
	ln -s roles/common/ansible.mk ansible-common.mk
endif

gpdb:
ifneq  (,$(wildcard roles/gpdb-ansible))
	cd roles/gpdb-ansible && git pull
else
	git clone https://github.com/andreasscherbaum/gpdb-ansible.git roles/gpdb-ansible
	ln -s roles/gpdb-ansible/ansible.mk ansible-gpdb-ansible.mk
endif


# Performance test of nodejs as make shell

SHELL = $(TEST_SHELL)

ifeq ($(SHELL),node)

.SHELLFLAGS = -e
.ONESHELL:

define M.seq
	for(let i = 0; i < $1; ++i) {
		console.log(i);
	}
endef

define M.echo
	shell = require('shelljs');
	shell.echo('$1');
endef

endif

ifeq ($(SHELL),sh)

define M.seq
	seq $1
endef

define M.echo
	echo $1
endef

endif

ifeq ($(SHELL),python)

.SHELLFLAGS = -c
.ONESHELL:

define M.seq
	for i in range($1):
		print(i)
endef

define M.echo
	print($1)
endef

endif

var = $(shell $(call M.seq, 10))
list = $(foreach i, $(var), $(shell $(call M.echo,$i)))
$(info $(list))

.PHONY: test

test:

Add test with lua as make shell

# Performance test of nodejs as make shell

SHELL = $(TEST_SHELL)

ifeq ($(SHELL),lua)

.SHELLFLAGS = -e
.ONESHELL:

define M.seq
for i = 1,$1 do
    print(i);
end
endef

define M.echo
print("$1");
endef

endif

ifeq ($(SHELL),node)

.SHELLFLAGS = -e
.ONESHELL:

define M.seq
	for(let i = 0; i < $1; ++i) {
		console.log(i);
	}
endef

define M.echo
	shell = require('shelljs');
	shell.echo('$1');
endef

endif

ifeq ($(SHELL),sh)

define M.seq
	seq $1
endef

define M.echo
	echo $1
endef

endif

ifeq ($(SHELL),python)

.SHELLFLAGS = -c
.ONESHELL:

define M.seq
	for i in range($1):
		print(i)
endef

define M.echo
	print($1)
endef

endif

var = $(shell $(call M.seq, 100))
list = $(foreach i, $(var), $(shell $(call M.echo,$i)))
$(info $(list))

.PHONY: test

test:


LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := libswscale
LOCAL_SRC_FILES := ffmpeg/$(TARGET_ARCH_ABI)/lib/$(LOCAL_MODULE).so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ffmpeg/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libavcodec
LOCAL_SRC_FILES := ffmpeg/$(TARGET_ARCH_ABI)/lib/$(LOCAL_MODULE).so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ffmpeg/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libavformat
LOCAL_SRC_FILES := ffmpeg/$(TARGET_ARCH_ABI)/lib/$(LOCAL_MODULE).so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ffmpeg/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libavutil
LOCAL_SRC_FILES := ffmpeg/$(TARGET_ARCH_ABI)/lib/$(LOCAL_MODULE).so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ffmpeg/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_SHARED_LIBRARY)

LOCAL_PATH:= $(call my-dir)

Update code to use FFmpegMediaPlayer

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := libavcodec
LOCAL_SRC_FILES := ffmpeg/$(TARGET_ARCH_ABI)/lib/$(LOCAL_MODULE).so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ffmpeg/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libavformat
LOCAL_SRC_FILES := ffmpeg/$(TARGET_ARCH_ABI)/lib/$(LOCAL_MODULE).so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ffmpeg/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libavutil
LOCAL_SRC_FILES := ffmpeg/$(TARGET_ARCH_ABI)/lib/$(LOCAL_MODULE).so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ffmpeg/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libswresample
LOCAL_SRC_FILES := ffmpeg/$(TARGET_ARCH_ABI)/lib/$(LOCAL_MODULE).so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ffmpeg/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libswscale
LOCAL_SRC_FILES := ffmpeg/$(TARGET_ARCH_ABI)/lib/$(LOCAL_MODULE).so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ffmpeg/$(TARGET_ARCH_ABI)/include
include $(PREBUILT_SHARED_LIBRARY)

LOCAL_PATH:= $(call my-dir)


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/nest/p9_build_smp.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,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
PROCEDURE=p9_build_smp
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/initfiles)
OBJS+=p9_fbc_smp_utils.o
OBJS+=p9_build_smp_fbc_ab.o
OBJS+=p9_build_smp_fbc_cd.o
OBJS+=p9_build_smp_adu.o
OBJS+=p9_adu_coherent_utils.o
$(call BUILD_PROCEDURE)

Fix HB build failure and incorrect HWP level lable

# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/nest/p9_build_smp.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,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
PROCEDURE=p9_build_smp
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/initfiles)
OBJS+=p9_fbc_smp_utils.o
OBJS+=p9_build_smp_fbc_ab.o
OBJS+=p9_build_smp_fbc_cd.o
OBJS+=p9_build_smp_adu.o
OBJS+=p9_adu_coherent_utils.o
OBJS+=p9_fbc_utils.o
$(call BUILD_PROCEDURE)


packages:=boost openssl curl
native_packages := native_ccache

qt_packages = qrencode zlib

ifeq ($(QT_59),1)
qt_x86_64_linux_packages:=qt59 expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
qt_i686_linux_packages:=$(qt_x86_64_linux_packages)

qt_darwin_packages=qt59
qt_mingw32_packages=qt59
else
qt_x86_64_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
qt_i686_linux_packages:=$(qt_x86_64_linux_packages)

qt_darwin_packages=qt
qt_mingw32_packages=qt
endif

wallet_packages=bdb

upnp_packages=miniupnpc

darwin_native_packages = native_biplist native_ds_store native_mac_alias

ifneq ($(build_os),darwin)
darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus
endif

Change zlib from qt_package to package in depends

packages:=boost openssl curl zlib
native_packages := native_ccache

qt_packages = qrencode

ifeq ($(QT_59),1)
qt_x86_64_linux_packages:=qt59 expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
qt_i686_linux_packages:=$(qt_x86_64_linux_packages)

qt_darwin_packages=qt59
qt_mingw32_packages=qt59
else
qt_x86_64_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
qt_i686_linux_packages:=$(qt_x86_64_linux_packages)

qt_darwin_packages=qt
qt_mingw32_packages=qt
endif

wallet_packages=bdb

upnp_packages=miniupnpc

darwin_native_packages = native_biplist native_ds_store native_mac_alias

ifneq ($(build_os),darwin)
darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus
endif


CFLAGS_M32=-m32
CFLAGS_M64=-m64
ASM_INCLUDES = -Icodec/common/x86/
ifeq (, $(ENABLE64BIT))
ifeq ($(ARCH), x86_64)
ENABLE64BIT=Yes
endif
endif
ifeq ($(ENABLE64BIT), Yes)
CFLAGS += $(CFLAGS_M64)
LDFLAGS += $(CFLAGS_M64)
ASMFLAGS_PLATFORM = -DUNIX64
else
CFLAGS += $(CFLAGS_M32)
LDFLAGS += $(CFLAGS_M32)
ASMFLAGS_PLATFORM = -DX86_32
endif
ifeq ($(USE_ASM),Yes)
CFLAGS += -DX86_ASM
endif
ASM_ARCH = x86
ASM = nasm
ASMFLAGS += $(ASMFLAGS_PLATFORM)

Revert "Set ASM_ARCH in all cases to fix Win64 Debug build"

CFLAGS_M32=-m32
CFLAGS_M64=-m64
ASM_INCLUDES = -Icodec/common/x86/
ifeq (, $(ENABLE64BIT))
ifeq ($(ARCH), x86_64)
ENABLE64BIT=Yes
endif
endif
ifeq ($(ENABLE64BIT), Yes)
CFLAGS += $(CFLAGS_M64)
LDFLAGS += $(CFLAGS_M64)
ASMFLAGS_PLATFORM = -DUNIX64
else
CFLAGS += $(CFLAGS_M32)
LDFLAGS += $(CFLAGS_M32)
ASMFLAGS_PLATFORM = -DX86_32
endif
ifeq ($(USE_ASM),Yes)
CFLAGS += -DX86_ASM
ASM_ARCH = x86
endif
ASM = nasm
ASMFLAGS += $(ASMFLAGS_PLATFORM)


# Copyright 2004-present Facebook. All Rights Reserved.
APP_BUILD_SCRIPT := Android.mk

APP_ABI := armeabi-v7a armeabi arm64-v8a x86 x86_64
APP_PLATFORM := android-9

APP_MK_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
NDK_MODULE_PATH := $(APP_MK_DIR)$(HOST_DIRSEP)$(APP_MK_DIR)../../../nativedeps/merge

APP_STL := gnustl_static

# Make sure every shared lib includes a .note.gnu.build-id header
APP_LDFLAGS := -Wl,--build-id

NDK_TOOLCHAIN_VERSION := 4.9

# We link our libs with static stl implementation. Because of that we need to
# hide all stl related symbols to make them unaccessible from the outside.
# We also need to make sure that our library does not use any stl functions
# coming from other stl implementations as well

# This hides all symbols exported from libgnustl_static
FRESCO_CPP_LDFLAGS := -Wl,--gc-sections

Update :imagepipeline to use clang

# Copyright 2004-present Facebook. All Rights Reserved.
APP_BUILD_SCRIPT := Android.mk

APP_ABI := armeabi-v7a armeabi arm64-v8a x86 x86_64
APP_PLATFORM := android-9

APP_MK_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
NDK_MODULE_PATH := $(APP_MK_DIR)$(HOST_DIRSEP)$(APP_MK_DIR)../../../nativedeps/merge

APP_STL := gnustl_static

# Make sure every shared lib includes a .note.gnu.build-id header
APP_LDFLAGS := -Wl,--build-id

NDK_TOOLCHAIN_VERSION := clang

# We link our libs with static stl implementation. Because of that we need to
# hide all stl related symbols to make them unaccessible from the outside.
# We also need to make sure that our library does not use any stl functions
# coming from other stl implementations as well

# This hides all symbols exported from libgnustl_static
FRESCO_CPP_LDFLAGS := -Wl,--gc-sections


# $FreeBSD$

.if !target(__<bsd.symver.mk>__)
__<bsd.symver.mk>__:

.include <bsd.init.mk>

# Generate the version map given the version definitions
# and symbol maps.
.if !empty(VERSION_DEF) && !empty(SYMBOL_MAPS)
# Find the awk script that generates the version map.
VERSION_GEN?=	version_gen.awk
VERSION_MAP?=	Version.map

CLEANFILES+=	${VERSION_MAP}

# Compute the make's -m path.
_mpath=
_oarg=
.for _arg in ${.MAKEFLAGS}
.if ${_oarg} == "-m"
_mpath+= ${_arg}
.endif
_oarg=  ${_arg}
.endfor
_mpath+= /usr/share/mk

# Look up ${VERSION_GEN} in ${_mpath}.
_vgen=
.for path in ${_mpath}
.if empty(_vgen)
.if exists(${path}/${VERSION_GEN})
_vgen=  ${path}/${VERSION_GEN}
.endif
.endif
.endfor

${VERSION_MAP}: ${VERSION_DEF} ${_vgen} ${SYMBOL_MAPS}
	awk -v vfile=${VERSION_DEF} -f ${_vgen} ${SYMBOL_MAPS} \
	    > ${.TARGET}
.endif	# !empty(VERSION_DEF) && !empty(SYMBOL_MAPS)
.endif  # !target(__<bsd.symver.mk>__)

Use CPP to preprocess version map files so we can conditionalize symbols.

# $FreeBSD$

.if !target(__<bsd.symver.mk>__)
__<bsd.symver.mk>__:

.include <bsd.init.mk>

# Generate the version map given the version definitions
# and symbol maps.
.if !empty(VERSION_DEF) && !empty(SYMBOL_MAPS)
# Find the awk script that generates the version map.
VERSION_GEN?=	version_gen.awk
VERSION_MAP?=	Version.map

CLEANFILES+=	${VERSION_MAP}

# Compute the make's -m path.
_mpath=
_oarg=
.for _arg in ${.MAKEFLAGS}
.if ${_oarg} == "-m"
_mpath+= ${_arg}
.endif
_oarg=  ${_arg}
.endfor
_mpath+= /usr/share/mk

# Look up ${VERSION_GEN} in ${_mpath}.
_vgen=
.for path in ${_mpath}
.if empty(_vgen)
.if exists(${path}/${VERSION_GEN})
_vgen=  ${path}/${VERSION_GEN}
.endif
.endif
.endfor

# Run the symbol maps through the C preprocessor before passing
# them to the symbol version generator.
${VERSION_MAP}: ${VERSION_DEF} ${_vgen} ${SYMBOL_MAPS}
	cat ${SYMBOL_MAPS} | ${CPP} - - \
	    | awk -v vfile=${VERSION_DEF} -f ${_vgen} > ${.TARGET}
.endif	# !empty(VERSION_DEF) && !empty(SYMBOL_MAPS)
.endif  # !target(__<bsd.symver.mk>__)


################################################################
# project name
################################################################

# This name is used for the distribution tar file.

project_name := ShellCorretta

################################################################
# modules -- list of directories in which to search
# for module.mk include files
################################################################

# Caution: The order in which modules are declares is important, since
# it is also used in linking.  The object/library file for the
# *caller* must precede the object/library file for the *callee* for
# successful linking.

################
# programs
################

modules +=

################
# libraries
################

modules += libraries/pybasis

# additional libraries -- cloned as submodule

modules += libraries/basis  # ordering note: basis depends on am and mcutils
modules += libraries/am libraries/mcutils libraries/cppformat

################################################################
# extras -- list of extra files to be included
# in distribution tar file
################################################################

extras :=

################################################################
# additional project-specific make settings and rules
################################################################

# gsl
LDLIBS += -lgsl
LDLIBS += -lgslcblas
CPPFLAGS += -DHAVE_INLINE

# basis submodule
#   map vs. hash for space lookup in basis library
CPPFLAGS += -DBASIS_HASH

# Python
CPPFLAGS += $(shell python3-config --cflags)
LDFLAGS += $(shell python3-config --ldflags)
search_prefix += ./libraries/pybind11
CPPFLAGS += -fPIC
FFLAGS += -fPIC

# mcutils submodule
#   allow legacy global access to variables now wrapped in mcutils namespace
# CPPFLAGS += -DMCUTILS_ALLOW_LEGACY_GLOBAL

Remove basis dependency on Boost

################################################################
# project name
################################################################

# This name is used for the distribution tar file.

project_name := ShellCorretta

################################################################
# modules -- list of directories in which to search
# for module.mk include files
################################################################

# Caution: The order in which modules are declares is important, since
# it is also used in linking.  The object/library file for the
# *caller* must precede the object/library file for the *callee* for
# successful linking.

################
# programs
################

modules +=

################
# libraries
################

modules += libraries/pybasis

# additional libraries -- cloned as submodule

modules += libraries/basis  # ordering note: basis depends on am and mcutils
modules += libraries/am libraries/mcutils libraries/cppformat

################################################################
# extras -- list of extra files to be included
# in distribution tar file
################################################################

extras :=

################################################################
# additional project-specific make settings and rules
################################################################

# gsl
LDLIBS += -lgsl
LDLIBS += -lgslcblas
CPPFLAGS += -DHAVE_INLINE

# basis submodule
#   map vs. hash for space lookup in basis library
##CPPFLAGS += -DBASIS_HASH

# Python
CPPFLAGS += $(shell python3-config --cflags)
LDFLAGS += $(shell python3-config --ldflags)
search_prefix += ./libraries/pybind11
CPPFLAGS += -fPIC
FFLAGS += -fPIC

# mcutils submodule
#   allow legacy global access to variables now wrapped in mcutils namespace
# CPPFLAGS += -DMCUTILS_ALLOW_LEGACY_GLOBAL


# Defaults for the fake testarch architecture.

DEVICE_DIR     = $(TOP_DIR)/testarch/devices
DEVICE_TYPE   ?= clutff-unidir-s4
DEVICE        ?= 2x4
DEVICE_FULL   = $(DEVICE)
YOSYS_SCRIPT  ?= synth -top top -flatten; abc -lut 4; opt_clean; write_blif -attr -cname -conn -param $@
RR_PATCH_TOOL ?= $(TOP_DIR)/utils/testarch_graph.py
RR_PATCH_CMD  ?= $(RR_PATCH_TOOL) \
	--read_rr_graph $(OUT_RRXML_VIRT) \
	--write_rr_graph $(OUT_RRXML_REAL)
#RR_PATCH_TOOL ?= /bin/cp
#RR_PATCH_CMD  ?= $(RR_PATCH_TOOL) $(OUT_RRXML_VIRT) $(OUT_RRXML_REAL)

Make 4x4 config the default.

# Defaults for the fake testarch architecture.

DEVICE_DIR     = $(TOP_DIR)/testarch/devices
DEVICE_TYPE   ?= clutff-unidir-s4
DEVICE        ?= 4x4
DEVICE_FULL   = $(DEVICE)
YOSYS_SCRIPT  ?= synth -top top -flatten; abc -lut 4; opt_clean; write_blif -attr -cname -conn -param $@
RR_PATCH_TOOL ?= $(TOP_DIR)/utils/testarch_graph.py
RR_PATCH_CMD  ?= $(RR_PATCH_TOOL) \
	--read_rr_graph $(OUT_RRXML_VIRT) \
	--write_rr_graph $(OUT_RRXML_REAL)
#RR_PATCH_TOOL ?= /bin/cp
#RR_PATCH_CMD  ?= $(RR_PATCH_TOOL) $(OUT_RRXML_VIRT) $(OUT_RRXML_REAL)


# Copyright (C) 2013 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)

# This is a "private" module - projects should use "mockito-target" instead!
# It does not provide a MockMaker implementation, hence cannot be used directly.
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := junit4-target objenesis-target
LOCAL_MODULE := mockito-api
LOCAL_SDK_VERSION := 10
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_JAVA_LIBRARY)

# Main target for dependent projects. Pulls in Mockito and the Dexmaker MockMaker.
include $(CLEAR_VARS)
LOCAL_MODULE := mockito-target
LOCAL_STATIC_JAVA_LIBRARIES := mockito-api dexmaker-mockmaker
LOCAL_SDK_VERSION := 10
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_JAVA_LIBRARY)

Include dexmaker library in mockito-target

# Copyright (C) 2013 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)

# This is a "private" module - projects should use "mockito-target" instead!
# It does not provide a MockMaker implementation, hence cannot be used directly.
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := junit4-target objenesis-target
LOCAL_MODULE := mockito-api
LOCAL_SDK_VERSION := 10
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_JAVA_LIBRARY)

# Main target for dependent projects. Pulls in Mockito and the Dexmaker MockMaker.
include $(CLEAR_VARS)
LOCAL_MODULE := mockito-target
LOCAL_STATIC_JAVA_LIBRARIES := mockito-api dexmaker dexmaker-mockmaker
LOCAL_SDK_VERSION := 10
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_JAVA_LIBRARY)


#
# ANT Stack
#
# Copyright 2011 Dynastream Innovations
#
# 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.
#

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

#
# ANT java system service
#

LOCAL_SRC_FILES := \
    $(call all-java-files-under, src) \
    src/com/dsi/ant/server/IAntHal.aidl \
    src/com/dsi/ant/server/IAntHalCallback.aidl

LOCAL_REQUIRED_MODULES := libantradio
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := AntHalService

include $(BUILD_PACKAGE)

endif # BOARD_ANT_WIRELESS_DEVICE defined

Define LOCAL_SDK_VERSION for ant_service module

#
# ANT Stack
#
# Copyright 2011 Dynastream Innovations
#
# 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.
#

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

#
# ANT java system service
#

LOCAL_SRC_FILES := \
    $(call all-java-files-under, src) \
    src/com/dsi/ant/server/IAntHal.aidl \
    src/com/dsi/ant/server/IAntHalCallback.aidl

LOCAL_REQUIRED_MODULES := libantradio
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := AntHalService
ifeq ($(filter 8% O% o%,$(TARGET_PLATFORM_VERSION)),)
LOCAL_SDK_VERSION := system_current
endif
include $(BUILD_PACKAGE)

endif # BOARD_ANT_WIRELESS_DEVICE defined


# Copyright 2007 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.

# This makefile builds both for host and target, and so all the
# common definitions are factored out into a separate file to
# minimize duplication between the build rules.

LOCAL_PATH:= $(call my-dir)

#
# Build rules for the target.
#

# We only build ffi at all for non-arm, non-x86 targets.
ifneq ($(TARGET_ARCH),arm)
    ifneq ($(TARGET_ARCH),x86)

       include $(CLEAR_VARS)

       ffi_arch := $(TARGET_ARCH)
       ffi_os := $(TARGET_OS)

       # This include just keeps the nesting a bit saner.
       include $(LOCAL_PATH)/Libffi.mk

       LOCAL_MODULE := libffi

       include $(BUILD_SHARED_LIBRARY)

    endif
endif

# Also include the rules for the test suite.
include external/libffi/testsuite/Android.mk

Mark libffi as optional for non-ARM/x86 builds

# Copyright 2007 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.

# This makefile builds both for host and target, and so all the
# common definitions are factored out into a separate file to
# minimize duplication between the build rules.

LOCAL_PATH:= $(call my-dir)

#
# Build rules for the target.
#

# We only build ffi at all for non-arm, non-x86 targets.
ifneq ($(TARGET_ARCH),arm)
    ifneq ($(TARGET_ARCH),x86)

       include $(CLEAR_VARS)

       ffi_arch := $(TARGET_ARCH)
       ffi_os := $(TARGET_OS)

       # This include just keeps the nesting a bit saner.
       include $(LOCAL_PATH)/Libffi.mk

       LOCAL_MODULE_TAGS := optional
       LOCAL_MODULE := libffi

       include $(BUILD_SHARED_LIBRARY)

    endif
endif

# Also include the rules for the test suite.
include external/libffi/testsuite/Android.mk


NQPRX_LIB_PBCS = \
    $(LIBRARY_DIR)/Regex.pbc \
    $(LIBRARY_DIR)/HLL.pbc \
    $(LIBRARY_DIR)/P6Regex.pbc \
    $(LIBRARY_DIR)/nqp-rx.pbc \
    $(LIBRARY_DIR)/P6object.pbc \
    $(LIBRARY_DIR)/PCT/HLLCompiler.pbc \
    $(LIBRARY_DIR)/PCT/PAST.pbc

NQPRX_LIB_SETTING = $(LIBRARY_DIR)/nqp-setting.pbc

NQPRX_CLEANUPS = \
    ext/nqp-rx/src/gen/settings.pir \
    ext/nqp-rx/src/stage0/nqp-setting.pir

Remove file from NQPRX_CLEANUPS which no longer is created during build.

NQPRX_LIB_PBCS = \
    $(LIBRARY_DIR)/Regex.pbc \
    $(LIBRARY_DIR)/HLL.pbc \
    $(LIBRARY_DIR)/P6Regex.pbc \
    $(LIBRARY_DIR)/nqp-rx.pbc \
    $(LIBRARY_DIR)/P6object.pbc \
    $(LIBRARY_DIR)/PCT/HLLCompiler.pbc \
    $(LIBRARY_DIR)/PCT/PAST.pbc

NQPRX_LIB_SETTING = $(LIBRARY_DIR)/nqp-setting.pbc

NQPRX_CLEANUPS = \
    ext/nqp-rx/src/stage0/nqp-setting.pir


LOCAL_PATH := $(call my-dir)

GST_PLUGINS_UGLY_TOP := $(LOCAL_PATH)

include $(CLEAR_VARS)

# external dependencies
include $(GST_PLUGINS_UGLY_TOP)/ext/mad/Android.mk
include $(GST_PLUGINS_UGLY_TOP)/gst/mpegaudioparse/Android.mk

Build gst-plugins-ugly only if BUILD_WITH_GST option provided.

ifeq ($(strip $(BUILD_WITH_GST)),true)

LOCAL_PATH := $(call my-dir)

GST_PLUGINS_UGLY_TOP := $(LOCAL_PATH)

include $(CLEAR_VARS)

# external dependencies
include $(GST_PLUGINS_UGLY_TOP)/ext/mad/Android.mk
include $(GST_PLUGINS_UGLY_TOP)/gst/mpegaudioparse/Android.mk

endif


COVERAGE = $(NAME).info

GCNOS = $(SOURCES:%.c=%.gcno)
GCDAS = $(SOURCES:%.c=%.gcda)
GCOVS = $(shell find . -name '*.gcov')

$(COVERAGE): $(GCNOS) $(GCDAS)
	(lcov -t "Coverage on ${TARGET}" -o ${COVERAGE} -c -d . --no-external)
	(gcov *.c)

.PHONY: cov_clean
cov_clean:
	$(RM) $(GCNOS) $(GCDAS) $(GCOVS) $(COVERAGE)

Fix coverage files cleaning on tests

COVERAGE = $(NAME).info

GCNOS = $(SOURCES:%.c=%.gcno)
GCDAS = $(SOURCES:%.c=%.gcda)
GCOVS = $(wildcard *.gcov)

$(COVERAGE): $(GCNOS) $(GCDAS)
	(lcov -t "Coverage on ${TARGET}" -o ${COVERAGE} -c -d . --no-external)
	(gcov *.c)

.PHONY: cov_clean
cov_clean:
	$(RM) $(GCNOS) $(GCDAS) $(GCOVS) $(COVERAGE)


PREFIX?=	/usr/local
EXEC_PREFIX=	${PREFIX}
BINDIR=		${EXEC_PREFIX}/bin
SBINDIR=	${EXEC_PREFIX}/sbin
LIBEXECDIR=	${EXEC_PREFIX}/libexec
DATAROOTDIR=	${PREFIX}/share
DATADIR=	${DATAROOTDIR}
SYSCONFDIR=	${PREFIX}/etc
PROG=		sonatina
LIBS=		libmpdclient gtk+-3.0
CFLAGS=		-std=c99 -D_DEFAULT_SOURCE \
		-Wall -Wextra -pedantic -Wno-unused-parameter -Wno-missing-field-initializers \
		-DDEBUG -g \
		-DPROG=\"${PROG}\" \
		-DDATADIR=\"${DATADIR}\" \
		-DSYSCONFDIR=\"${SYSCONFDIR}\" \
		$(shell pkg-config --cflags ${LIBS})
LDFLAGS=	$(shell pkg-config --libs ${LIBS})

.PHONY: build install uninstall clean

all: build

Remove debug flags from default build.

PREFIX?=	/usr/local
EXEC_PREFIX=	${PREFIX}
BINDIR=		${EXEC_PREFIX}/bin
SBINDIR=	${EXEC_PREFIX}/sbin
LIBEXECDIR=	${EXEC_PREFIX}/libexec
DATAROOTDIR=	${PREFIX}/share
DATADIR=	${DATAROOTDIR}
SYSCONFDIR=	${PREFIX}/etc
DEBUG?=		-O2
PROG=		sonatina
LIBS=		libmpdclient gtk+-3.0
CFLAGS=		-std=c99 -D_DEFAULT_SOURCE \
		-Wall -Wextra -pedantic -Wno-unused-parameter -Wno-missing-field-initializers \
		${DEBUG} \
		-DPROG=\"${PROG}\" \
		-DDATADIR=\"${DATADIR}\" \
		-DSYSCONFDIR=\"${SYSCONFDIR}\" \
		$(shell pkg-config --cflags ${LIBS})
LDFLAGS=	$(shell pkg-config --libs ${LIBS})

.PHONY: build install uninstall clean

all: build


# -*- makefile -*-

include ${srcdir}/libffi.gnu.mk

$(LIBFFI):
	@mkdir -p "$(LIBFFI_BUILD_DIR)"
	@if [ ! -f "$(LIBFFI_BUILD_DIR)"/Makefile ]; then \
	    echo "Configuring libffi"; \
	    cd "$(LIBFFI_BUILD_DIR)" && \
		/usr/bin/env CFLAGS="$(LIBFFI_CFLAGS)" \
		/bin/sh $(LIBFFI_CONFIGURE) $(LIBFFI_HOST) > /dev/null; \
	fi
	$(MAKE) -C "$(LIBFFI_BUILD_DIR)"

Make more dirs based on target stem

# -*- makefile -*-

include ${srcdir}/libffi.gnu.mk

$(LIBFFI):
	@mkdir -p "$(LIBFFI_BUILD_DIR)" "$@(D)"
	@if [ ! -f "$(LIBFFI_BUILD_DIR)"/Makefile ]; then \
	    echo "Configuring libffi"; \
	    cd "$(LIBFFI_BUILD_DIR)" && \
		/usr/bin/env CFLAGS="$(LIBFFI_CFLAGS)" \
		/bin/sh $(LIBFFI_CONFIGURE) $(LIBFFI_HOST) > /dev/null; \
	fi
	$(MAKE) -C "$(LIBFFI_BUILD_DIR)"


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

LOCAL_MODULE_TAGS := optional

LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4

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

LOCAL_PACKAGE_NAME := DeskClock

LOCAL_OVERRIDES_PACKAGES := AlarmClock

LOCAL_SDK_VERSION := 16

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

include $(BUILD_PACKAGE)

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

Revert "Build against SDK 16."

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

LOCAL_MODULE_TAGS := optional

LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4

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

LOCAL_PACKAGE_NAME := DeskClock

LOCAL_OVERRIDES_PACKAGES := AlarmClock

LOCAL_SDK_VERSION := current

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

include $(BUILD_PACKAGE)

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


CXXFLAGS += -std=c++1z

GPLUSPLUS ?= /usr/bin/g++

CC  := $(GPLUSPLUS)
CXX := $(GPLUSPLUS)
LD  := $(GPLUSPLUS)

ifeq ($(OS),Linux)
    # On linux let's do a static linkage
    LDFLAGS += -static-libgcc -static-libstdc++
endif

###############################################################################
# Dependency info

PARSERS.deps          := UTILS
CASNUMBER.deps        := PARSERS UTILS
CASEXPR.deps          := CASNUMBER
CASRENDERING.deps     := CASEXPR UTILS
CASREDUCTION.deps     := CASEXPR

CLI.deps   := NBRS             \
              CASNUMBER        \
              CASREDUCTION     \
              CASEXPR          \
              PARSERS          \
              CASRENDERING

IFACE.deps := NBRS             \
              CASNUMBER        \
              CASREDUCTION     \
              CASEXPR          \
              PARSERS          \
              CASRENDERING

#LIB.deps  := LIB_INT

# This is the location holding the main runnable program
main_is := CLI

################################
$(call enter,src)

Update makefiles for nr-make changes

CXXFLAGS += -std=c++1z

# Enable if you need to
#STATIC_LIBSTDCXX=

###############################################################################
# Dependency info

PARSERS.deps          := UTILS
CASNUMBER.deps        := PARSERS UTILS
CASEXPR.deps          := CASNUMBER
CASRENDERING.deps     := CASEXPR UTILS
CASREDUCTION.deps     := CASEXPR

CLI.deps   := NBRS             \
              CASNUMBER        \
              CASREDUCTION     \
              CASEXPR          \
              PARSERS          \
              CASRENDERING

IFACE.deps := NBRS             \
              CASNUMBER        \
              CASREDUCTION     \
              CASEXPR          \
              PARSERS          \
              CASRENDERING

#LIB.deps  := LIB_INT

# This is the location holding the main runnable program
main_is := CLI

################################
$(call enter,src)


package=libgmp
$(package)_version=6.1.1
$(package)_download_path=https://gmplib.org/download/gmp/
$(package)_file_name=gmp-$($(package)_version).tar.bz2
$(package)_sha256_hash=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
$(package)_dependencies=
$(package)_config_opts=--enable-cxx --disable-shared

define $(package)_config_cmds
  $($(package)_autoconf) --host=$(host) --build=$(build)
endef

define $(package)_build_cmds
  $(MAKE) CPPFLAGS='-fPIC'
endef

define $(package)_stage_cmds
  $(MAKE) DESTDIR=$($(package)_staging_dir) install ; echo '=== staging find for $(package):' ; find $($(package)_staging_dir)
endef

Upgrade GNU MP to 6.1.2

package=libgmp
$(package)_version=6.1.2
$(package)_download_path=https://gmplib.org/download/gmp/
$(package)_file_name=gmp-$($(package)_version).tar.bz2
$(package)_sha256_hash=5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2
$(package)_dependencies=
$(package)_config_opts=--enable-cxx --disable-shared

define $(package)_config_cmds
  $($(package)_autoconf) --host=$(host) --build=$(build)
endef

define $(package)_build_cmds
  $(MAKE) CPPFLAGS='-fPIC'
endef

define $(package)_stage_cmds
  $(MAKE) DESTDIR=$($(package)_staging_dir) install ; echo '=== staging find for $(package):' ; find $($(package)_staging_dir)
endef


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

LOCAL_SRC_FILES := timekeep.c
LOCAL_MODULE := timekeep
LOCAL_SHARED_LIBRARIES := libcutils
LOCAL_MODULE_TAGS := optional
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := TimeKeep
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true

LOCAL_PROGUARD_ENABLED := disabled

include $(BUILD_PACKAGE)

Add liblog as shared library dependency

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

LOCAL_SRC_FILES := timekeep.c
LOCAL_MODULE := timekeep
LOCAL_SHARED_LIBRARIES := libcutils liblog
LOCAL_MODULE_TAGS := optional
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := TimeKeep
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true

LOCAL_PROGUARD_ENABLED := disabled

include $(BUILD_PACKAGE)


LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := NominatimNlpBackend
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := NominatimNlpBackend

nominatem_root  := $(LOCAL_PATH)
nominatem_out   := $(OUT_DIR)/target/common/obj/APPS/$(LOCAL_MODULE)_intermediates
nominatem_build := $(nominatem_root)/build
nominatem_apk   := build/outputs/apk/$(LOCAL_PACKAGE_NAME)-release-unsigned.apk

$(nominatem_root)/$(nominatem_apk):
	rm -Rf $(nominatem_build)
	mkdir -p $(nominatem_out)
	mkdir -p $(nominatem_build)
	ln -sf $(nominatem_out) $(nominatem_build)
	cd $(nominatem_root) && JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" ./gradlew assembleRelease

LOCAL_CERTIFICATE := platform
LOCAL_SRC_FILES := $(nominatem_apk)
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)

include $(BUILD_PREBUILT)

Fix Typo Nominatem -> Nominatim

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := NominatimNlpBackend
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := NominatimNlpBackend

nominatim_root  := $(LOCAL_PATH)
nominatim_out   := $(OUT_DIR)/target/common/obj/APPS/$(LOCAL_MODULE)_intermediates
nominatim_build := $(nominatim_root)/build
nominatim_apk   := build/outputs/apk/NominatimNlpBackend-release-unsigned.apk

$(nominatim_root)/$(nominatim_apk):
	rm -Rf $(nominatim_build)
	mkdir -p $(nominatim_out)
	mkdir -p $(nominatim_build)
	ln -sf $(nominatim_out) $(nominatim_build)
	cd $(nominatim_root) && JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" ./gradlew assembleRelease

LOCAL_CERTIFICATE := platform
LOCAL_SRC_FILES := $(nominatim_apk)
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)

include $(BUILD_PREBUILT)


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

LOCAL_SRC_FILES:= \
    android_renderscript_RenderScript.cpp

LOCAL_SHARED_LIBRARIES := \
        libandroid_runtime \
        libRSSupport \
        libcutils \
        libjnigraphics \
        libskia

LOCAL_STATIC_LIBRARIES :=

rs_generated_include_dir := $(call intermediates-dir-for,SHARED_LIBRARIES,libRSSupport,,)

LOCAL_C_INCLUDES += \
	$(JNI_H_INCLUDE) \
	frameworks/rs \
	$(rs_generated_include_dir)

LOCAL_CFLAGS +=

LOCAL_LDLIBS := -lpthread
LOCAL_ADDITIONAL_DEPENDENCIES := $(addprefix $(rs_generated_include_dir)/,rsgApiFuncDecl.h)
LOCAL_MODULE:= librsjni
LOCAL_ADDITIONAL_DEPENDENCIES += $(rs_generated_source)
LOCAL_MODULE_TAGS := optional
LOCAL_REQUIRED_MODULES := libRSSupport

include $(BUILD_SHARED_LIBRARY)

Fix include path for compat lib.

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

LOCAL_SRC_FILES:= \
    android_renderscript_RenderScript.cpp

LOCAL_SHARED_LIBRARIES := \
        libandroid_runtime \
        libRSSupport \
        libcutils \
        libjnigraphics \
        libskia

LOCAL_STATIC_LIBRARIES :=

rs_generated_include_dir := $(call intermediates-dir-for,SHARED_LIBRARIES,libRSSupport,,)

LOCAL_C_INCLUDES += \
	$(JNI_H_INCLUDE) \
	frameworks/support/renderscript/v8/rs_support \
	$(rs_generated_include_dir)

LOCAL_CFLAGS +=

LOCAL_LDLIBS := -lpthread
LOCAL_ADDITIONAL_DEPENDENCIES := $(addprefix $(rs_generated_include_dir)/,rsgApiFuncDecl.h)
LOCAL_MODULE:= librsjni
LOCAL_ADDITIONAL_DEPENDENCIES += $(rs_generated_source)
LOCAL_MODULE_TAGS := optional
LOCAL_REQUIRED_MODULES := libRSSupport

include $(BUILD_SHARED_LIBRARY)


# Build target for Linked List Tests
build/slist_tests.o: tests/lists/slist_tests.c | build
	$(CC) $(CFLAGS) -c $^ -o $@

build/slist_tests: build/slist_tests.o build/slist.o
	$(LD) $(LDFLAGS) $^ -o $@

slist_tests: build/slist_tests

slist_time: slist_tests
	/usr/bin/time -v build/$^

slist_trace: slist_tests
	strace build/$^

slist_vg: slist_tests
	valgrind -v build/$^

Add parameter to valgrind test.

# Build target for Linked List Tests
build/slist_tests.o: tests/lists/slist_tests.c | build
	$(CC) $(CFLAGS) -c $^ -o $@

build/slist_tests: build/slist_tests.o build/slist.o
	$(LD) $(LDFLAGS) $^ -o $@

slist_tests: build/slist_tests

slist_time: slist_tests
	/usr/bin/time -v build/$^

slist_trace: slist_tests
	strace build/$^

slist_vg: slist_tests
	valgrind -v --leak-check=full build/$^


-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) -llua

.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)))

Fix lua path for Raspbian build

-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)))


.PHONY: all $(SUBDIRS-y) $(SUBDIRS-n) copy_objs

create_objs_lst: $(SUBDIRS-y)
	@echo '$(addprefix $(CURDIR)/,$(OBJS-y)) \' >> $(ROOT_DIR)/objs.lst

create_include_dirs_lst: $(SUBDIRS-y) $(SUBDIRS-n)
	@echo ' -I$(CURDIR)\' >> $(ROOT_DIR)/include_dirs.lst

$(SUBDIRS-y):
	@$(MAKE) --no-print-directory -C $@ $(MAKEOP)

$(SUBDIRS-n):
	@$(MAKE) --no-print-directory -C $@ $(MAKEOP)

all: $(SUBDIRS-y) $(OBJS-y) copy_objs

%.o:%.S
	@$(CC) $(CCFLAGS) $(INCLUDE_DIRS) -I$(INCLUDE_DIR) -o $@ $<
	@printf "  [M]\t$@\n"

%.o:%.c
	@$(CC) $(CCFLAGS) $(INCLUDE_DIRS) -I$(INCLUDE_DIR) -o $@ $<
	@printf "  [M]\t$@\n"

copy_objs:
	  if [ ! -z "$(OBJS-y)" ]; then  cp -f $(OBJS-y) $(OBJ_DIR)/$(BUILD); fi

clean:
	rm -f  $(OBJS-y)

Fix bugs in make clean. Now this work on recursive directories

.PHONY: all $(SUBDIRS-y) $(SUBDIRS-n) copy_objs

create_objs_lst: $(SUBDIRS-y)
	@echo '$(addprefix $(CURDIR)/,$(OBJS-y)) \' >> $(ROOT_DIR)/objs.lst

create_include_dirs_lst: $(SUBDIRS-y) $(SUBDIRS-n)
	@echo ' -I$(CURDIR)\' >> $(ROOT_DIR)/include_dirs.lst

$(SUBDIRS-y):
	@$(MAKE) --no-print-directory -C $@ $(MAKEOP)

$(SUBDIRS-n):
	@$(MAKE) --no-print-directory -C $@ $(MAKEOP)

all: $(SUBDIRS-y) $(OBJS-y) copy_objs

%.o:%.S
	@$(CC) $(CCFLAGS) $(INCLUDE_DIRS) -I$(INCLUDE_DIR) -o $@ $<
	@printf "  [M]\t$@\n"

%.o:%.c
	@$(CC) $(CCFLAGS) $(INCLUDE_DIRS) -I$(INCLUDE_DIR) -o $@ $<
	@printf "  [M]\t$@\n"

copy_objs:
	  if [ ! -z "$(OBJS-y)" ]; then  cp -f $(OBJS-y) $(OBJ_DIR)/$(BUILD); fi

clean: $(SUBDIRS-y)
	rm -f  $(OBJS-y)


#
# Copyright (C) 2012 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.
#

# Don't build the library in unbundled branches.
ifeq (,$(TARGET_BUILD_APPS))

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_CFLAGS += -std=c++11

LOCAL_MODULE := android-support-v8-renderscript
LOCAL_SDK_VERSION := 21
LOCAL_SRC_FILES := $(call all-java-files-under, java/src)
LOCAL_STATIC_JAVA_LIBRARIES := android-support-annotations

include $(BUILD_STATIC_JAVA_LIBRARY)

# TODO: Build the tests as an APK here

include $(call all-makefiles-under, $(LOCAL_PATH))

endif

Make android-support-annotations not included as STATIC LIB.

#
# Copyright (C) 2012 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.
#

# Don't build the library in unbundled branches.
ifeq (,$(TARGET_BUILD_APPS))

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_CFLAGS += -std=c++11

LOCAL_MODULE := android-support-v8-renderscript
LOCAL_SDK_VERSION := 21
LOCAL_SRC_FILES := $(call all-java-files-under, java/src)
LOCAL_JAVA_LIBRARIES := android-support-annotations

include $(BUILD_STATIC_JAVA_LIBRARY)

# TODO: Build the tests as an APK here

include $(call all-makefiles-under, $(LOCAL_PATH))

endif


# rules to build a library
# based on FreeBSD's bsd.prog.mk

# Copyright 2008 Roy Marples

OBJS+=			${SRCS:.c=.o}

include ${MK}/sys.mk
# Some systems don't include /lib in their standard link path
# so we should embed it if different
_RPATH_SH=		if test "${SHLIBDIR}" != "/usr/${LIBNAME}"; then \
				echo "-Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib -R${SHLIBDIR}"; \
			fi
_RPATH!=		${_RPATH_SH}
LDFLAGS+=		${_RPATH}$(shell ${_RPATH_SH})
LDFLAGS+=		${PROGLDFLAGS}

all: depend ${PROG}

${PROG}: ${SCRIPTS} ${OBJS}
	${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}

clean:
	rm -f ${OBJS} ${PROG} ${CLEANFILES}

include ${MK}/depend.mk

Remove non standard -R option.

# rules to build a library
# based on FreeBSD's bsd.prog.mk

# Copyright 2008 Roy Marples

OBJS+=			${SRCS:.c=.o}

include ${MK}/sys.mk
# Some systems don't include /lib in their standard link path
# so we should embed it if different
_RPATH_SH=		if test "${SHLIBDIR}" != "/usr/${LIBNAME}"; then \
				echo "-Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib"; \
			fi
_RPATH!=		${_RPATH_SH}
LDFLAGS+=		${_RPATH}$(shell ${_RPATH_SH})
LDFLAGS+=		${PROGLDFLAGS}

all: depend ${PROG}

${PROG}: ${SCRIPTS} ${OBJS}
	${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}

clean:
	rm -f ${OBJS} ${PROG} ${CLEANFILES}

include ${MK}/depend.mk


NAME = dwmstatus
VERSION = 1.2

# Customize below to fit your system

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

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

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

# flags
CPPFLAGS = -DVERSION=\"${VERSION}\"
CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
#CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
LDFLAGS = -g ${LIBS}
#LDFLAGS = -s ${LIBS}

# Solaris
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = ${LIBS}

# compiler and linker
CC = cc

Install to .local, use ggdb

NAME = dwmstatus
VERSION = 1.2

# Customize below to fit your system

# paths
PREFIX = ${HOME}/.local
MANPREFIX = ${PREFIX}/share/man

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

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

# flags
CPPFLAGS = -DVERSION=\"${VERSION}\"
CFLAGS = -ggdb -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
#CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
LDFLAGS = -ggdb ${LIBS}
#LDFLAGS = -s ${LIBS}

# Solaris
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = ${LIBS}

# compiler and linker
CC = cc


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_scom.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2016,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
PROCEDURE=p9_fbc_ioo_dl_scom
$(call BUILD_PROCEDURE)

Add no variable tracking to initfile procedures to imporve build time

# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_scom.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2016,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
PROCEDURE=p9_fbc_ioo_dl_scom
lib$(PROCEDURE)_COMMONFLAGS+=-fno-var-tracking-assignments
$(call BUILD_PROCEDURE)


# SPDX-License-Identifier: SPDX-License-Identifier: LGPL-2.1-or-later
#
# workarounds.mk - workarounds for weird stuff behavior

LD_FLAVOR := $(shell $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/ .*//g')
LD_VERSION := $(shell $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/.* //')
# 2.35 is definitely broken and 2.36 seems to work
LD_DASH_T := $(shell \
	if [ "x${LD_FLAVOR}" = xLLD ] ; then \
		echo '-T' ; \
	elif [ "x${LD_FLAVOR}" = xGNU ] ; then \
		if echo "${LD_VERSION}" | grep -q -E '^2\.3[6789]|^2\.[456789]|^[3456789]|^[[:digit:]][[:digit:]]' ; then \
			echo '-T' ; \
		else \
			echo "" ; \
		fi ; \
	else \
		echo "Your linker is not supported" ; \
		exit 1 ; \
	fi)

export LD_DASH_T

# vim:ft=make

Set LC_ALL=C to force English output from ld

# SPDX-License-Identifier: SPDX-License-Identifier: LGPL-2.1-or-later
#
# workarounds.mk - workarounds for weird stuff behavior

LD_FLAVOR := $(shell LC_ALL=C $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/ .*//g')
LD_VERSION := $(shell LC_ALL=C $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/.* //')
# 2.35 is definitely broken and 2.36 seems to work
LD_DASH_T := $(shell \
	if [ "x${LD_FLAVOR}" = xLLD ] ; then \
		echo '-T' ; \
	elif [ "x${LD_FLAVOR}" = xGNU ] ; then \
		if echo "${LD_VERSION}" | grep -q -E '^2\.3[6789]|^2\.[456789]|^[3456789]|^[[:digit:]][[:digit:]]' ; then \
			echo '-T' ; \
		else \
			echo "" ; \
		fi ; \
	else \
		echo "Your linker is not supported" ; \
		exit 1 ; \
	fi)

export LD_DASH_T

# vim:ft=make


# Compile settings
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions

# Build all available ABIs
APP_ABI := all
# What platform (API level) to build against
APP_PLATFORM := android-14

Add c++11 flag to native Android build

# Compile settings
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions -std=c++11

# Build all available ABIs
APP_ABI := all
# What platform (API level) to build against
APP_PLATFORM := android-14


TARGET_COMPRESS_MODULE_SYMBOLS := false
TARGET_PRELINK_MODULE := false
TARGET_NO_RECOVERY := true
TARGET_HARDWARE_3D := false
BOARD_USES_GENERIC_AUDIO := true
USE_CAMERA_STUB := true
TARGET_PROVIDES_INIT_RC := true
USE_CUSTOM_RUNTIME_HEAP_MAX := "32M"
TARGET_CPU_ABI := x86
TARGET_USERIMAGES_USE_EXT2 := true
TARGET_BOOTIMAGE_USE_EXT2 := true

BOARD_KERNEL_CMDLINE := init=/init console=tty0 androidboot.hardware=generic_x86 vga=788
TARGET_USE_DISKINSTALLER := true
TARGET_DISK_LAYOUT_CONFIG := build/target/board/generic_x86/disk_layout.conf
BOARD_BOOTIMAGE_MAX_SIZE := 8388608
BOARD_SYSLOADER_MAX_SIZE := 7340032
BOARD_FLASH_BLOCK_SIZE := 512

Use a different kernel boot line for the disk installer.

TARGET_COMPRESS_MODULE_SYMBOLS := false
TARGET_PRELINK_MODULE := false
TARGET_NO_RECOVERY := true
TARGET_HARDWARE_3D := false
BOARD_USES_GENERIC_AUDIO := true
USE_CAMERA_STUB := true
TARGET_PROVIDES_INIT_RC := true
USE_CUSTOM_RUNTIME_HEAP_MAX := "32M"
TARGET_CPU_ABI := x86
TARGET_USERIMAGES_USE_EXT2 := true
TARGET_BOOTIMAGE_USE_EXT2 := true

# For VirtualBox and likely other emulators
BOARD_INSTALLER_CMDLINE := init=/init console=ttyS0 console=tty0 androidboot.hardware=generic_x86 vga=788 verbose
BOARD_KERNEL_CMDLINE := init=/init console=tty0 console=ttyS0 androidboot.hardware=generic_x86 vga=788
TARGET_USE_DISKINSTALLER := true
TARGET_DISK_LAYOUT_CONFIG := build/target/board/generic_x86/disk_layout.conf
BOARD_BOOTIMAGE_MAX_SIZE := 8388608
BOARD_SYSLOADER_MAX_SIZE := 7340032
BOARD_FLASH_BLOCK_SIZE := 512


# $Id$
#
#
# Makefile to generate build tools
#

STAMP = buildmk.stamp

ALWAYS = build2/generated_lists

all: $(STAMP) $(ALWAYS)
	@$(MAKE) -s -f build2/build2.mk

build2/generated_lists:
	@echo config_m4_files = ext/*/config*.m4 >> $@
	if test -f Makefile.global; then echo php_gtk_m4 = php_gtk_new.m4 >> $@; else echo php_gtk_m4 = php_gtk_old.m4 >> $@; fi

$(STAMP):
	phpize
	@test -f php_gtk.m4 && rm php_gtk.m4
	touch $(STAMP)

Use standard 'if' syntax (patch from Alan).

# $Id$
#
#
# Makefile to generate build tools
#

STAMP = buildmk.stamp

ALWAYS = build2/generated_lists

all: $(STAMP) $(ALWAYS)
	@$(MAKE) -s -f build2/build2.mk

build2/generated_lists:
	@echo config_m4_files = ext/*/config*.m4 >> $@
	if test -f Makefile.global; then echo php_gtk_m4 = php_gtk_new.m4 >> $@; else echo php_gtk_m4 = php_gtk_old.m4 >> $@; fi

$(STAMP):
	phpize
	if test -f php_gtk.m4; then rm php_gtk.m4; fi
	touch $(STAMP)


USB_VID = 0x239A
USB_PID = 0x80AA
USB_PRODUCT = "Franzininho WIFI Wrover"
USB_MANUFACTURER = "Espressif"

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ

# The default queue depth of 16 overflows on release builds,
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32

CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB

CIRCUITPY_MODULE=wrover

Update Vendor ID for Espressif

USB_VID = 0x303A
USB_PID = 0x80AA
USB_PRODUCT = "Franzininho WIFI Wrover"
USB_MANUFACTURER = "Espressif"

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ

# The default queue depth of 16 overflows on release builds,
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32

CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB

CIRCUITPY_MODULE=wrover


__FILE__ := $(abspath $(lastword $(MAKEFILE_LIST)))

MAKEFILE_D_URL := https://github.com/rduplain/Makefile.d.git
MAKEFILE_D_REV := v1.1

ifeq ($(QWERTY_SH),)
QWERTY_SH := curl -sSL qwerty.sh | sh -s -
endif

.Makefile.d/%.mk: .Makefile.d/path.mk
	@touch $@

.Makefile.d/path.mk: $(__FILE__)
	$(QWERTY_SH) -f -o .Makefile.d --ref $(MAKEFILE_D_REV) $(MAKEFILE_D_URL)
	@touch $@

Speed up Makefile.d download, by default.

__FILE__ := $(abspath $(lastword $(MAKEFILE_LIST)))

MAKEFILE_D_URL := https://github.com/rduplain/Makefile.d.git
MAKEFILE_D_REV := v1.1 # Use --ref instead of --tag below if untagged.

ifeq ($(QWERTY_SH),)
QWERTY_SH := curl -sSL qwerty.sh | sh -s -
endif

.Makefile.d/%.mk: .Makefile.d/path.mk
	@touch $@

.Makefile.d/path.mk: $(__FILE__)
	$(QWERTY_SH) -f -o .Makefile.d --tag $(MAKEFILE_D_REV) $(MAKEFILE_D_URL)
	@touch $@


package=native_cdrkit
$(package)_version=1.1.11
$(package)_download_path=http://distro.ibiblio.org/fatdog/source/c
$(package)_file_name=cdrkit-$($(package)_version).tar.bz2
$(package)_sha256_hash=b50d64c214a65b1a79afe3a964c691931a4233e2ba605d793eb85d0ac3652564
$(package)_patches=cdrkit-deterministic.patch

define $(package)_preprocess_cmds
  patch -p1 < $($(package)_patch_dir)/cdrkit-deterministic.patch
endef

define $(package)_config_cmds
  cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix)
endef

define $(package)_build_cmds
  $(MAKE) genisoimage
endef

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

define $(package)_postprocess_cmds
  rm bin/isovfy bin/isoinfo bin/isodump bin/isodebug bin/devdump
endef

Fix download link for gitian builds

package=native_cdrkit
$(package)_version=1.1.11
$(package)_download_path=http://distro.ibiblio.org/fatdog/source/600/c
$(package)_file_name=cdrkit-$($(package)_version).tar.bz2
$(package)_sha256_hash=b50d64c214a65b1a79afe3a964c691931a4233e2ba605d793eb85d0ac3652564
$(package)_patches=cdrkit-deterministic.patch

define $(package)_preprocess_cmds
  patch -p1 < $($(package)_patch_dir)/cdrkit-deterministic.patch
endef

define $(package)_config_cmds
  cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix)
endef

define $(package)_build_cmds
  $(MAKE) genisoimage
endef

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

define $(package)_postprocess_cmds
  rm bin/isovfy bin/isoinfo bin/isodump bin/isodebug bin/devdump
endef


OSX_MIN_VERSION=10.8
OSX_SDK_VERSION=10.11
OSX_SDK=$(SDK_PATH)/MiacOSX$(OSX_SDK_VERSION).sdk
LD64_VERSION=253.9
darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)

darwin_CFLAGS=-pipe
darwin_CXXFLAGS=$(darwin_CFLAGS)

darwin_release_CFLAGS=-O2
darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)

darwin_debug_CFLAGS=-O1
darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS)

darwin_native_toolchain=native_cctools

Revert "update oxx sdk min version"

OSX_MIN_VERSION=10.6
OSX_SDK_VERSION=10.7
OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk
darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK)
darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK)

darwin_CFLAGS=-pipe
darwin_CXXFLAGS=$(darwin_CFLAGS)

darwin_release_CFLAGS=-O2
darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)

darwin_debug_CFLAGS=-O1
darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS)

darwin_native_toolchain=native_cctools


LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld
USB_VID = 0x239A
USB_PID = 0x8012
USB_PRODUCT = "Serpente"
USB_MANUFACTURER = "arturo182"

CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = GD25Q32C
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1

Update PID and enable as many modules as we can fit

LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld
USB_VID = 0x239A
USB_PID = 0x8058
USB_PRODUCT = "Serpente"
USB_MANUFACTURER = "arturo182"

CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = GD25Q32C
LONGINT_IMPL = NONE

CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_GAMEPAD = 0


# binary names
EXE_NAME = piny
LIB_NAME = libpiny.so

# compilers and options
FC = gfortran
CC = gcc
DEFINE = -DLINUX -DNO_CFREE
OPT = -O2
OPT_CARE = -O2
OPT_GRP = -O2
CFLAGS = -fPIC $(DEFINE)
FFLAGS = -fPIC $(DEFINE)
LIBS = -lm

INCLUDES = $(CODE)/include/pentium_nopar
CODE = $(realpath ../..)
EXE = $(CODE)/bin/$(EXE_NAME)
LIBPINY = $(CODE)/lib/$(LIB_NAME)
SPEC_FILES = math_generic.o

Update OS X settings as well

# binary names
EXE_NAME = piny
LIB_NAME = libpiny.so

# compilers and options
FC = gfortran
CC = gcc
DEFINE = -DNO_CFREE
OPT = -O2
OPT_CARE = -O2
OPT_GRP = -O2
CFLAGS = -fPIC $(DEFINE)
FFLAGS = -fPIC $(DEFINE)
LIBS = -lm

BASE = $(realpath ../..)
CODE = $(BASE)/src
INCLUDES = $(BASE)/include/pentium_nopar
EXE = $(BASE)/bin/$(EXE_NAME)
LIBPINY = $(BASE)/lib/$(LIB_NAME)
SPEC_FILES = math_generic.o


#
# 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 := DONUT-BURGER

# 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

Fix the build name. Previously "DONUT-BURGER"; Now "Donut"

#
# 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 := Donut

# 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


# Customize below to fit your system

# paths
PREFIX ?= justhere
MANPREFIX = ${PREFIX}/share/man

Use /usr/local as default PREFIX.

# Customize below to fit your system

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


# 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_RESOURCE_DIR = \
        $(LOCAL_PATH)/res \
        $(LOCAL_PATH)/../leanback/res
LOCAL_AAPT_FLAGS := \
        --auto-add-overlay \
        --extra-packages android.support.v17.leanback

LOCAL_STATIC_JAVA_LIBRARIES := \
        android-support-v4 \
        android-support-v7-recyclerview \
        android-support-v17-leanback
LOCAL_JAVA_LIBRARIES := android.test.runner

LOCAL_PACKAGE_NAME := AndroidLeanbackTests

include $(BUILD_PACKAGE)

Add resources to recyclerview dependency.

# 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_RESOURCE_DIR = \
        $(LOCAL_PATH)/res \
        $(LOCAL_PATH)/../leanback/res \
        $(LOCAL_PATH)/../../v7/recyclerview/res
LOCAL_AAPT_FLAGS := \
        --auto-add-overlay \
        --extra-packages android.support.v17.leanback \
        --extra-packages android.support.v7.recyclerview

LOCAL_STATIC_JAVA_LIBRARIES := \
        android-support-v4 \
        android-support-v7-recyclerview \
        android-support-v17-leanback
LOCAL_JAVA_LIBRARIES := android.test.runner

LOCAL_PACKAGE_NAME := AndroidLeanbackTests

include $(BUILD_PACKAGE)


# VARIABLES #

# Define the path of the [david][1] executable:
#
# To install david:
#     $ npm install david
#
# [1]: https://www.npmjs.com/package/david

DAVID ?= $(BIN_DIR)/david

# Define the command-line options to use when invoking the david executable:
DAVID_FLAGS ?= \
	--package $(ROOT_PACKAGE_JSON) \
	--ignore update-notifier \
	--ignore chai \
	--ignore debug

# TARGETS #

# Check JavaScript dependencies.
#
# This target checks JavaScript dependencies for updates and security vulnerabilities.

check-javascript-deps: $(NODE_MODULES)
	$(QUIET) $(DAVID) $(DAVID_FLAGS)

.PHONY: check-javascript-deps

Add recipe for checking manually managed node module deps

# VARIABLES #

# Define the path of the [david][1] executable:
#
# To install david:
#     $ npm install david
#
# [1]: https://www.npmjs.com/package/david

DAVID ?= $(BIN_DIR)/david

# Define the path to a `package.json` for manually managed node module dependencies:
DAVID_PACKAGE_JSON ?= $(CONFIG_DIR)/david/.pkg.json

# Define the command-line options to use when invoking the `david` executable:
DAVID_FLAGS ?= \
	--ignore update-notifier \
	--ignore chai \
	--ignore debug

# TARGETS #

# Check JavaScript dependencies.
#
# This target checks JavaScript dependencies for updates and security vulnerabilities.

check-javascript-deps: check-javascript-deps-main check-javascript-deps-manual

.PHONY: check-javascript-deps

# Check JavaScript dependencies.
#
# This target checks JavaScript node module dependencies which are managed via `npm` for updates and security vulnerabilities.

check-javascript-deps-main: $(NODE_MODULES)
	$(QUIET) $(DAVID) $(DAVID_FLAGS) --package $(ROOT_PACKAGE_JSON)

.PHONY: check-javascript-deps-main

# Check JavaScript dependencies.
#
# This target checks JavaScript node module dependencies which are manually managed for updates and security vulnerabilities.

check-javascript-deps-manual: $(NODE_MODULES)
	$(QUIET) $(DAVID) $(DAVID_FLAGS) --package $(DAVID_PACKAGE_JSON)

.PHONY: check-javascript-deps-manual


LIBS_SUBDIRS = libmainloop

LIBMAINLOOP_DIR = $(TOPDIR)/libmainloop
LIBMAINLOOP_INCLUDES = -I$(TOPDIR)
LIBMAINLOOP_LIBS = -L$(LIBMAINLOOP_DIR) -lmainloop

CFLAGS += -DNOTION_RELEASE='"$(NOTION_RELEASE)"'

ifeq ($(wildcard $(TOPDIR)/libtu/obj.h),)

#External libtu, feel free to edit
LIBTU_DIR = $(TOPDIR)/../libtu
LIBTU_INCLUDES =
LIBTU_LIBS = -ltu

else

#In-tree libtu
LIBS_SUBDIRS += libtu

LIBTU_DIR = $(TOPDIR)/libtu
LIBTU_INCLUDES = -I$(TOPDIR)
LIBTU_LIBS = -L$(LIBTU_DIR) -ltu

endif

ifeq ($(wildcard $(TOPDIR)/libextl/luaextl.h),)

#External libextl, feel free to edit
LIBEXTL_DIR = $(TOPDIR)/../libextl
LIBEXTL_INCLUDES =
LIBEXTL_LIBS = -lextl

MKEXPORTS = libextl-mkexports

else

#In-tree libextl
LIBS_SUBDIRS += libextl

LIBEXTL_DIR = $(TOPDIR)/libextl
LIBEXTL_INCLUDES = -I$(TOPDIR)
LIBEXTL_LIBS = -L$(LIBEXTL_DIR) -lextl

MKEXPORTS = $(LUA) $(LIBEXTL_DIR)/libextl-mkexports

endif

Remove handling for external libtu/libextl

LIBS_SUBDIRS = libmainloop

LIBMAINLOOP_DIR = $(TOPDIR)/libmainloop
LIBMAINLOOP_INCLUDES = -I$(TOPDIR)
LIBMAINLOOP_LIBS = -L$(LIBMAINLOOP_DIR) -lmainloop

CFLAGS += -DNOTION_RELEASE='"$(NOTION_RELEASE)"'

# libtu
LIBS_SUBDIRS += libtu

LIBTU_DIR = $(TOPDIR)/libtu
LIBTU_INCLUDES = -I$(TOPDIR)
LIBTU_LIBS = -L$(LIBTU_DIR) -ltu

#libextl
LIBS_SUBDIRS += libextl

LIBEXTL_DIR = $(TOPDIR)/libextl
LIBEXTL_INCLUDES = -I$(TOPDIR)
LIBEXTL_LIBS = -L$(LIBEXTL_DIR) -lextl

MKEXPORTS = $(LUA) $(LIBEXTL_DIR)/libextl-mkexports


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/initfiles/p9_obus_scom.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2016
# [+] 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
PROCEDURE=p9_obus_scom
$(call BUILD_PROCEDURE)

Add no variable tracking to initfile procedures to imporve build time

# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/initfiles/p9_obus_scom.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2016
# [+] 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
PROCEDURE=p9_obus_scom
lib$(PROCEDURE)_COMMONFLAGS+=-fno-var-tracking-assignments
$(call BUILD_PROCEDURE)


TOPDIR = ..\..

TARGET = pkcs15init.lib

HEADERS = pkcs15-init.h keycache.h
HEADERSDIR = $(TOPDIR)\src\include\opensc

OBJECTS = profile.obj pkcs15-lib.obj keycache.obj \
          pkcs15-miocos.obj pkcs15-gpk.obj pkcs15-cflex.obj \
          pkcs15-etoken.obj pkcs15-jcop.obj

all: install-headers $(TARGET)

$(TARGET): $(OBJECTS)
	lib /nologo /machine:ix86 /out:$(TARGET) $(OBJECTS)

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

Add pkcs15-starcos to windows makefile.

TOPDIR = ..\..

TARGET = pkcs15init.lib

HEADERS = pkcs15-init.h keycache.h
HEADERSDIR = $(TOPDIR)\src\include\opensc

OBJECTS = profile.obj pkcs15-lib.obj keycache.obj \
          pkcs15-miocos.obj pkcs15-gpk.obj pkcs15-cflex.obj \
          pkcs15-etoken.obj pkcs15-jcop.obj pkcs15-starcos.obj

all: install-headers $(TARGET)

$(TARGET): $(OBJECTS)
	lib /nologo /machine:ix86 /out:$(TARGET) $(OBJECTS)

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


# VARIABLES #

# Define the path to the root `package.json`:
ROOT_PACKAGE_JSON ?= $(ROOT_DIR)/package.json

# TARGETS #

# Install node module dependencies.
#
# This target installs package dependencies by executing [`npm install`][1]. Packages will be installed in a local `node_modules` directory relative to the project's `package.json` file.
#
# [1]: https://docs.npmjs.com/cli/install

install-node-modules: $(ROOT_PACKAGE_JSON)
	$(QUIET) $(NPM) install

.PHONY: install-node-modules

# Remove node module dependencies.
#
# This target cleans the `node_modules` directory by removing it entirely.

clean-node-modules:
	$(QUIET) $(DELETE) $(DELETE_FLAGS) $(NODE_MODULES)

.PHONY: clean-node-modules

Add recipe to deduplicate node module dependencies

# VARIABLES #

# Define the path to the root `package.json`:
ROOT_PACKAGE_JSON ?= $(ROOT_DIR)/package.json

# TARGETS #

# Install node module dependencies.
#
# This target installs package dependencies by executing [`npm install`][1]. Packages will be installed in a local `node_modules` directory relative to the project's `package.json` file.
#
# [1]: https://docs.npmjs.com/cli/install

install-node-modules: $(ROOT_PACKAGE_JSON)
	$(QUIET) $(NPM) install

.PHONY: install-node-modules

# Deduplicate node module dependencies.
#
# This target searches the local package tree and attempts to simplify the overall structure by moving dependencies further up the tree, where they can be more effectively shared by multiple dependent packages.

dedupe-node-modules: $(NODE_MODULES)
	$(QUIET) $(NPM) dedupe

.PHONY: dedupe-node-modules

# Remove node module dependencies.
#
# This target cleans the `node_modules` directory by removing it entirely.

clean-node-modules:
	$(QUIET) $(DELETE) $(DELETE_FLAGS) $(NODE_MODULES)

.PHONY: clean-node-modules


package=fontconfig
$(package)_version=2.12.6
$(package)_download_path=http://www.freedesktop.org/software/fontconfig/release/
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=cf0c30807d08f6a28ab46c61b8dbd55c97d2f292cf88f3a07d3384687f31f017
$(package)_dependencies=freetype expat

define $(package)_set_vars
  $(package)_config_opts=--disable-docs --disable-static
endef

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

# 2.12.1 uses CHAR_WIDTH which is reserved and clashes with some glibc versions, but newer versions of fontconfig
# have broken makefiles which needlessly attempt to re-generate headers with gperf.
# Instead, change all uses of CHAR_WIDTH, and disable the rule that forces header re-generation.
# This can be removed once the upstream build is fixed.
define $(package)_build_cmds
  $(MAKE)
endef

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

Fix compilation issue on Ubuntu/Debian

package=fontconfig
$(package)_version=2.12.1
$(package)_download_path=http://www.freedesktop.org/software/fontconfig/release/
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=b449a3e10c47e1d1c7a6ec6e2016cca73d3bd68fbbd4f0ae5cc6b573f7d6c7f3
$(package)_dependencies=freetype expat

define $(package)_set_vars
  $(package)_config_opts=--disable-docs --disable-static
endef

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

# 2.12.1 uses CHAR_WIDTH which is reserved and clashes with some glibc versions, but newer versions of fontconfig
# have broken makefiles which needlessly attempt to re-generate headers with gperf.
# Instead, change all uses of CHAR_WIDTH, and disable the rule that forces header re-generation.
# This can be removed once the upstream build is fixed.
define $(package)_build_cmds
  sed -i 's/CHAR_WIDTH/CHARWIDTH/g' fontconfig/fontconfig.h src/fcobjshash.gperf src/fcobjs.h src/fcobjshash.h && \
  sed -i 's/fcobjshash.h: fcobjshash.gperf/fcobjshash.h:/' src/Makefile && \
  $(MAKE)
endef

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


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/nest/p9_mss_eff_grouping.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,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

PROCEDURE=p9_mss_eff_grouping
OBJS+=p9_fbc_utils.o
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/memory/)
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/generic/memory)
$(call BUILD_PROCEDURE)

Add pos API to be shared among controllers, move generic files to utils

# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/nest/p9_mss_eff_grouping.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,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

PROCEDURE=p9_mss_eff_grouping
OBJS+=p9_fbc_utils.o
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/memory/)
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH))
$(call BUILD_PROCEDURE)


USB_VID = 0x239A
USB_PID = 0x801F
USB_PRODUCT="Trinket M0 Haxpress"
USB_MANUFACTURER="Radomir Dopieralski"

CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = W25Q32BV
LONGINT_IMPL = MPZ

CIRCUITPY_BITBANGIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0

SUPEROPT_GC = 0

Disable countio on trinket haxpress

USB_VID = 0x239A
USB_PID = 0x801F
USB_PRODUCT="Trinket M0 Haxpress"
USB_MANUFACTURER="Radomir Dopieralski"

CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = W25Q32BV
LONGINT_IMPL = MPZ

CIRCUITPY_BITBANGIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0

SUPEROPT_GC = 0


include build/platform-msvc-common.mk
CFLAGS_OPT += -MD
CFLAGS_DEBUG += -MDd
ARCH=arm
include build/platform-arch.mk
CFLAGS += -DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -MD -DWIN32
CXXFLAGS += -ZW
LDFLAGS +=
CCAS = gas-preprocessor.pl -as-type armasm -force-thumb -- armasm

Remove a duplicate -MD declaration

include build/platform-msvc-common.mk
CFLAGS_OPT += -MD
CFLAGS_DEBUG += -MDd
ARCH=arm
include build/platform-arch.mk
CFLAGS += -DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -DWIN32
CXXFLAGS += -ZW
LDFLAGS +=
CCAS = gas-preprocessor.pl -as-type armasm -force-thumb -- armasm


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/memory/p9_mss_volt.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,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 00common.mk

PROCEDURE=p9_mss_volt
$(eval $(call ADD_MEMORY_INCDIRS,$(PROCEDURE)))
lib$(PROCEDURE)_DEPLIBS+=mss
$(call BUILD_PROCEDURE)

Change mss build to account for double free in wrappers

# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/memory/p9_mss_volt.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,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 00common.mk

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


#
# Copyright (C) 2007 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.
#

# This is a generic product that isn't specialized for a specific device.
# It includes the base Android platform.

PRODUCT_PACKAGES := \
    AccountAndSyncSettings \
    CarHome \
    DeskClock \
    AlarmProvider \
    Bluetooth \
    Calculator \
    Calendar \
    Camera \
    CertInstaller \
    DrmProvider \
    Email \
    LatinIME \
    Launcher2 \
    Mms \
    Music \
    Provision \
    QuickSearchBox \
    Settings \
    Sync \
    Updater \
    CalendarProvider \
    SyncProvider

$(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)

# Overrides
PRODUCT_BRAND := generic
PRODUCT_DEVICE := generic
PRODUCT_NAME := generic

Add Gallery3D in all builds.

#
# Copyright (C) 2007 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.
#

# This is a generic product that isn't specialized for a specific device.
# It includes the base Android platform.

PRODUCT_PACKAGES := \
    AccountAndSyncSettings \
    CarHome \
    DeskClock \
    AlarmProvider \
    Bluetooth \
    Calculator \
    Calendar \
    Camera \
    CertInstaller \
    DrmProvider \
    Email \
    Gallery3D \
    LatinIME \
    Launcher2 \
    Mms \
    Music \
    Provision \
    QuickSearchBox \
    Settings \
    Sync \
    Updater \
    CalendarProvider \
    SyncProvider

$(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)

# Overrides
PRODUCT_BRAND := generic
PRODUCT_DEVICE := generic
PRODUCT_NAME := generic


# This is just a rough approximation of LLVM deps
LLVM_DEPS:=$(wildcard $(addprefix $(CFG_LLVM_SRC_DIR)/, \
                        * */*h */*/*h */*/*/*h */*cpp */*/*cpp */*/*/*cpp))

define DEF_LLVM_RULES

# If CFG_LLVM_ROOT is defined then we don't build LLVM ourselves
ifeq ($(CFG_LLVM_ROOT),)

$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS_$(1))
	@$$(call E, make: llvm)
	$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV)

endif

endef

$(foreach target,$(CFG_TARGET_TRIPLES), \
 $(eval $(call DEF_LLVM_RULES,$(target))))

Create a better definition of LLVM deps

# Recursive wildcard function
# http://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
  $(filter $(subst *,%,$2),$d))

# This is just a rough approximation of LLVM deps
LLVM_DEPS=$(call rwildcard,$(CFG_LLVM_SRC_DIR),*cpp *hpp)

define DEF_LLVM_RULES

# If CFG_LLVM_ROOT is defined then we don't build LLVM ourselves
ifeq ($(CFG_LLVM_ROOT),)

$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS)
	@$$(call E, make: llvm)
	$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV)

endif

endef

$(foreach target,$(CFG_TARGET_TRIPLES), \
 $(eval $(call DEF_LLVM_RULES,$(target))))


# -*- 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_UnpackedTarball_UnpackedTarball,mariadb))

$(eval $(call gb_UnpackedTarball_set_tarball,mariadb,$(MARIADB_TARBALL)))

$(eval $(call gb_UnpackedTarball_add_file,mariadb,include/my_config.h,libmariadb/my_config.h))
$(eval $(call gb_UnpackedTarball_add_file,mariadb,include/mysql_version.h,libmariadb/mysql_version.h))

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

Add a comment to prevent misperceptions

# -*- 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_UnpackedTarball_UnpackedTarball,mariadb))

$(eval $(call gb_UnpackedTarball_set_tarball,mariadb,$(MARIADB_TARBALL)))

# This was generated on a 64-bit linux, will have to conditionalize it if it is broken
# for another configuration.
$(eval $(call gb_UnpackedTarball_add_file,mariadb,include/my_config.h,libmariadb/my_config.h))

$(eval $(call gb_UnpackedTarball_add_file,mariadb,include/mysql_version.h,libmariadb/mysql_version.h))

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