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

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

Change branch name to openmaster, to avoid confusion

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

# 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


network: network_global_admiral network_dev network_qa network_prod

plan_network: plan_network_global_admiral plan_network_dev plan_network_qa plan_network_prod

refresh_network: refresh_network_global_admiral refresh_network_dev refresh_network_qa refresh_network_prod

destroy_network: destroy_network_qa destroy_network_dev destroy_network_global_admiral
	@echo -e "\033[0;31m \n\nNOTE:\nnetwork_prod is not destroyed through this command for safety, please destroy it through 'destroy_network_prod' if required \033[0m"

.PHONY: network destroy_network refresh_network plan_network

Remove -e flag from echo

network: network_global_admiral network_dev network_qa network_prod

plan_network: plan_network_global_admiral plan_network_dev plan_network_qa plan_network_prod

refresh_network: refresh_network_global_admiral refresh_network_dev refresh_network_qa refresh_network_prod

destroy_network: destroy_network_qa destroy_network_dev destroy_network_global_admiral
	@echo "\033[0;31m \n\nNOTE:\nnetwork_prod is not destroyed through this command for safety, please destroy it through 'destroy_network_prod' if required \033[0m"

.PHONY: network destroy_network refresh_network plan_network


DEPS:=rabbitmq-server rabbitmq-erlang-client

C_SOURCE_DIR:=$(PACKAGE_DIR)/c_src
BINARY:=$(C_SOURCE_DIR)/kinit
C_SOURCE:=$(wildcard $(C_SOURCE_DIR)/*.c)

CC ?= gcc
CFLAGS ?=
CC_OPTS:=-g -Wall -pedantic -std=c99 -O2 -fpic $(CFLAGS)

CONSTRUCT_APP_PREREQS:=$(BINARY)
define construct_app_commands
	mkdir -p $(APP_DIR)/priv
	cp $(BINARY) $(APP_DIR)/priv
endef

define package_rules
$(BINARY): $(C_SOURCE)
	$(CC) $(CC_OPTS) -o $$@ $(C_SOURCE)

$(PACKAGE_DIR)+clean::
	rm -rf $(BINARY)

endef

Add LDFLAGS and link with krb5

DEPS:=rabbitmq-server rabbitmq-erlang-client

C_SOURCE_DIR:=$(PACKAGE_DIR)/c_src
BINARY:=$(C_SOURCE_DIR)/kinit
C_SOURCE:=$(wildcard $(C_SOURCE_DIR)/*.c)

CC ?= gcc
CFLAGS ?=
LDFLAGS ?=
CC_OPTS:=-g -Wall -pedantic -std=c99 -O2 -fpic -lkrb5 $(CFLAGS) $(LDFLAGS)

CONSTRUCT_APP_PREREQS:=$(BINARY)
define construct_app_commands
	mkdir -p $(APP_DIR)/priv
	cp $(BINARY) $(APP_DIR)/priv
endef

define package_rules
$(BINARY): $(C_SOURCE)
	$(CC) $(CC_OPTS) -o $$@ $(C_SOURCE)

$(PACKAGE_DIR)+clean::
	rm -rf $(BINARY)

endef


VERSION=0.1
BUILDDATE=2009XXXX

#MANCOUNTRIES=en_GB

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

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

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

CONFIG_PATH=/etc
#CONFIG_PATH=..

Fix build date for 0.1.

VERSION=0.1
BUILDDATE=20091203

#MANCOUNTRIES=en_GB

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

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

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

CONFIG_PATH=/etc
#CONFIG_PATH=..


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

ifeq ($(TARGET_BUILD_APPS),)
LOCAL_PATH := $(call my-dir)
include $(call first-makefiles-under,$(LOCAL_PATH))
endif

Use prebuilt for PDK builds.

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

ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)))
LOCAL_PATH := $(call my-dir)
include $(call first-makefiles-under,$(LOCAL_PATH))
endif


# -*- mode: makefile -*-

LIB_SRCS:= \
	state.c \
	sega3d.c \
	tlist.c \
	transform.c \
	sort.c \
	matrix_stack.c \
	fog.c \
	vertex_pool_transform.sx

INSTALL_HEADER_FILES:= \
	./:sega3d.h:./sega3d/ \
	./:sgl.h:./sega3d/

Remove vertex_pool_transform.sx from build list

# -*- mode: makefile -*-

LIB_SRCS:= \
	state.c \
	sega3d.c \
	tlist.c \
	transform.c \
	sort.c \
	matrix_stack.c \
	fog.c

INSTALL_HEADER_FILES:= \
	./:sega3d.h:./sega3d/ \
	./:sgl.h:./sega3d/


package=qrencode
$(package)_version=3.4.4
$(package)_download_path=https://fukuchi.org/works/qrencode/
$(package)_file_name=qrencode-$(qrencode_version).tar.bz2
$(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19cde1fa5

define $(package)_set_vars
$(package)_config_opts=--disable-shared -without-tools --disable-sdltest
$(package)_config_opts_linux=--with-pic
endef

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

define $(package)_build_cmds
  $(MAKE)
endef

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

Use package name variable inside $(package)_file_name variable

package=qrencode
$(package)_version=3.4.4
$(package)_download_path=https://fukuchi.org/works/qrencode/
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19cde1fa5

define $(package)_set_vars
$(package)_config_opts=--disable-shared -without-tools --disable-sdltest
$(package)_config_opts_linux=--with-pic
endef

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

define $(package)_build_cmds
  $(MAKE)
endef

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


TOPDIR = ..\..

TARGET = opensc-cardmod.lib
OBJECTS = cardmod.obj

all: $(TARGET)

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

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

Create cardmod DLL with nmake as well.

TOPDIR = ..\..

TARGET = opensc-cardmod.dll
OBJECTS = cardmod.obj

all: $(TARGET)

$(TARGET): $(OBJECTS)
	link /dll /nologo /machine:ix86 /out:$(TARGET) $(OBJECTS) ..\libopensc\opensc.lib gdi32.lib advapi32.lib winscard.lib Crypt32.lib User32.lib

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


.SUFFIXES: .m

.m.o:
	${CC} -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED ${OBJCFLAGS} ${CPPFLAGS} ${SHLIB_CFLAGS} $< -o $@

.c.o:
	${CC} -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED ${CFLAGS} ${CPPFLAGS} ${SHLIB_CFLAGS} $< -o $@

all:: ${SHLIB_NAME} pkgIndex.tcl

$(SHLIB_NAME): ${OBJS}
	${SHLIB_LD} ${OBJS} -o ${SHLIB_NAME} ${TCL_STUB_LIB_SPEC} ${SHLIB_LDFLAGS} ${LIBS}

pkgIndex.tcl: $(SHLIB_NAME)
	$(SILENT) ../pkg_mkindex.sh . || ( rm -rf $@ && exit 1 )

clean::
	rm -f ${OBJS} ${SHLIB_NAME} so_locations pkgIndex.tcl

distclean:: clean

install:: all
	$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 ${SHLIB_NAME} ${INSTALLDIR}
	$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 pkgIndex.tcl ${INSTALLDIR}

Add missing quotes around Makefile variables

.SUFFIXES: .m

.m.o:
	${CC} -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED ${OBJCFLAGS} ${CPPFLAGS} ${SHLIB_CFLAGS} $< -o $@

.c.o:
	${CC} -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED ${CFLAGS} ${CPPFLAGS} ${SHLIB_CFLAGS} $< -o $@

all:: ${SHLIB_NAME} pkgIndex.tcl

$(SHLIB_NAME): ${OBJS}
	${SHLIB_LD} ${OBJS} -o ${SHLIB_NAME} ${TCL_STUB_LIB_SPEC} ${SHLIB_LDFLAGS} ${LIBS}

pkgIndex.tcl: $(SHLIB_NAME)
	$(SILENT) ../pkg_mkindex.sh . || ( rm -rf $@ && exit 1 )

clean::
	rm -f ${OBJS} ${SHLIB_NAME} so_locations pkgIndex.tcl

distclean:: clean

install:: all
	$(INSTALL) -d -o "${DSTUSR}" -g "${DSTGRP}" -m "${DSTMODE}" "${INSTALLDIR}"
	$(INSTALL) -o "${DSTUSR}" -g "${DSTGRP}" -m 444 ${SHLIB_NAME} "${INSTALLDIR}"
	$(INSTALL) -o "${DSTUSR}" -g "${DSTGRP}" -m 444 pkgIndex.tcl "${INSTALLDIR}"


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.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_config_thermal
lib$(PROCEDURE)_DEPLIBS += p9_mss_bulk_pwr_throttles
$(call BUILD_PROCEDURE)

Add c_str generic API and update makefiles

# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.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_eff_config_thermal
lib$(PROCEDURE)_DEPLIBS += p9_mss_bulk_pwr_throttles
$(eval $(call ADD_MEMORY_INCDIRS,$(PROCEDURE)))
$(call BUILD_PROCEDURE)


ifeq ($(PRODUCT_PLATFORM_SOD),true)

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
    macaddrsetup.c

ifeq ($(WIFI_DRIVER_BUILT),qca_cld3)
LOCAL_CFLAGS += -DQCA_CLD3_WIFI
endif

ifeq ($(WIFI_DRIVER_BUILT),brcmfmac)
LOCAL_CFLAGS += -DBRCMFMAC
endif

ifeq ($(BOARD_HAS_MIRROR_MACADDRESS),true)
LOCAL_CFLAGS += -DMIRROR_MAC_ADDRESS
endif

LOCAL_SHARED_LIBRARIES := \
    liblog \
    libcutils

LOCAL_MODULE := macaddrsetup
ifneq ($(call math_gt_or_eq, $(PLATFORM_SDK_VERSION), 29),)
LOCAL_MODULE_OWNER := sony
LOCAL_INIT_RC_64   := vendor/etc/init/macaddrsetup.rc
LOCAL_PROPRIETARY_MODULE := true
else
ifneq ($(call math_gt_or_eq, $(PLATFORM_SDK_VERSION), 25),)
LOCAL_MODULE_OWNER := sony
LOCAL_INIT_RC_64   := vendor/etc/init/macaddrsetup_sdk25.rc
LOCAL_PROPRIETARY_MODULE := true
endif
endif

LOCAL_MODULE_TAGS := optional

include $(BUILD_EXECUTABLE)

endif

Build macaddrsetup.rc for all targets

ifeq ($(PRODUCT_PLATFORM_SOD),true)

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
    macaddrsetup.c

ifeq ($(WIFI_DRIVER_BUILT),qca_cld3)
LOCAL_CFLAGS += -DQCA_CLD3_WIFI
endif

ifeq ($(WIFI_DRIVER_BUILT),brcmfmac)
LOCAL_CFLAGS += -DBRCMFMAC
endif

ifeq ($(BOARD_HAS_MIRROR_MACADDRESS),true)
LOCAL_CFLAGS += -DMIRROR_MAC_ADDRESS
endif

LOCAL_SHARED_LIBRARIES := \
    liblog \
    libcutils

LOCAL_MODULE := macaddrsetup
ifneq ($(call math_gt_or_eq, $(PLATFORM_SDK_VERSION), 29),)
LOCAL_MODULE_OWNER := sony
LOCAL_INIT_RC      := vendor/etc/init/macaddrsetup.rc
LOCAL_PROPRIETARY_MODULE := true
else
ifneq ($(call math_gt_or_eq, $(PLATFORM_SDK_VERSION), 25),)
LOCAL_MODULE_OWNER := sony
LOCAL_INIT_RC      := vendor/etc/init/macaddrsetup_sdk25.rc
LOCAL_PROPRIETARY_MODULE := true
endif
endif

LOCAL_MODULE_TAGS := optional

include $(BUILD_EXECUTABLE)

endif


                    Name
                    Username

                                @{human_name}

                            @{username}

               Viewing @{first_visible_row}-@{last_visible_row} of @{total_rows} people

Swap the full name and username fields in the people grid

                    Username
                    Name

                            @{username}

                                @{human_name}

               Viewing @{first_visible_row}-@{last_visible_row} of @{total_rows} people


################
# Make - rules #
################
#
#  Copyright (C) 2017
#    Sandor Zsuga (Jubatian)
#
#  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/.
#
#
#
# This file holds rules to build XMBurner's objects. The xmb_defs.mk file has
# to be included before this.
#
#

# Support environment

$(XMB_OBJ):
	mkdir $(XMB_OBJ)

$(XMB_BIN):
	mkdir $(XMB_BIN)

# Components

$(XMB_OBJ)/%.o: xmburner/%.s xmburner/xmb_defs.h $(XMB_OBJ)
	$(XMB_CC) $(XMB_ASMFLAGS) -c $< -o $@

$(XMB_BIN)/$(XMB_CRCHEX): xmbtools/crchex.c $(XMB_BIN)
	$(XMB_NATCC) $(XMB_NATCFS) $< -o $@

Make now only builds what is necessary to be built.

################
# Make - rules #
################
#
#  Copyright (C) 2017
#    Sandor Zsuga (Jubatian)
#
#  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/.
#
#
#
# This file holds rules to build XMBurner's objects. The xmb_defs.mk file has
# to be included before this.
#
#

# Support environment

$(XMB_OBJ):
	mkdir $(XMB_OBJ)

$(XMB_BIN):
	mkdir $(XMB_BIN)

# Components

$(XMB_OBJ)/%.o: xmburner/%.s xmburner/xmb_defs.h | $(XMB_OBJ)
	$(XMB_CC) $(XMB_ASMFLAGS) -c $< -o $@

$(XMB_BIN)/$(XMB_CRCHEX): xmbtools/crchex.c | $(XMB_BIN)
	$(XMB_NATCC) $(XMB_NATCFS) $< -o $@


# -*- 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_Executable_Executable,cppumaker))

$(eval $(call gb_Executable_use_external,cppumaker,boost_headers))

$(eval $(call gb_Executable_use_libraries,cppumaker,\
    sal \
    salhelper \
    unoidl \
))

$(eval $(call gb_Executable_use_static_libraries,cppumaker,\
    codemaker_cpp \
    codemaker \
))

$(eval $(call gb_Executable_add_exception_objects,cppumaker,\
    codemaker/source/cppumaker/cppumaker \
    codemaker/source/cppumaker/cppuoptions \
    codemaker/source/cppumaker/cpputype \
    codemaker/source/cppumaker/dependencies \
    codemaker/source/cppumaker/dumputils \
    codemaker/source/cppumaker/includes \
))

ifeq ($(OS)$(COM),WNTMSC)
$(eval $(call gb_Executable_add_cxxflags,cppumaker,\
	-Ob0 \
))
endif

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

Add sal_textenc dependency to cppumaker

# -*- 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_Executable_Executable,cppumaker))

$(eval $(call gb_Executable_use_external,cppumaker,boost_headers))

$(eval $(call gb_Executable_use_libraries,cppumaker,\
    sal \
    sal_textenc \
    salhelper \
    unoidl \
))

$(eval $(call gb_Executable_use_static_libraries,cppumaker,\
    codemaker_cpp \
    codemaker \
))

$(eval $(call gb_Executable_add_exception_objects,cppumaker,\
    codemaker/source/cppumaker/cppumaker \
    codemaker/source/cppumaker/cppuoptions \
    codemaker/source/cppumaker/cpputype \
    codemaker/source/cppumaker/dependencies \
    codemaker/source/cppumaker/dumputils \
    codemaker/source/cppumaker/includes \
))

ifeq ($(OS)$(COM),WNTMSC)
$(eval $(call gb_Executable_add_cxxflags,cppumaker,\
	-Ob0 \
))
endif

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


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

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

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

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

ENABLE_BIN_FOLDER = 1

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

main_is      := MAIN

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

Update makefiles for nr-make changes

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

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

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

STATIC_LIBSTDCXX=

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

main_is      := MAIN

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


########################################################################
# conf/googlebenchmark.mk                                              #
# =========================                                            #
#                                                                      #
# Dependencies and compilation requirements for gbenchmark.            #
# -------------------------------------------------------------------- #
# MAINTEINER_NAME := Renato Cordeiro Ferreira                          #
# MAINTEINER_MAIL := renato.cferreira@hotmail.com                      #
# DESCRIPTION     := `gbenchmark` is a microbenchmark support library, #
#                    which support unit-tests alike benchmarking. To   #
#                    create the benchmark binary, just set `BENCHBIN`  #
#                    with the name of the file that contains the main  #
#                    function for the benchmarks.                      #
#                    For further info about the library, access:       #
#                    https://code.google.com/p/googletest/             #
########################################################################

ifndef GOOGLE_BENCHMARK_MK
override GOOGLE_BENCHMARK_MK := T

# Dependencies
# ==============
GIT_DEPENDENCY  += \
    gbenchmark => https://github.com/google/benchmark.git \
                  mkdir -p build && cd build \
                  && cmake -DCMAKE_BUILD_TYPE=Release \
                           -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON .. \
                  && make

# Paths
# =======
CXXLIBS         += -isystem external/gbenchmark/include/
LDLIBS          += -L external/gbenchmark/build/src/

# Flags
# =======
LDBENCH         += -lbenchmark -pthread

endif # ifndef GOOGLE_BENCHMARK_MK

Disable tests in Google Benchmark makeball

########################################################################
# conf/googlebenchmark.mk                                              #
# =========================                                            #
#                                                                      #
# Dependencies and compilation requirements for gbenchmark.            #
# -------------------------------------------------------------------- #
# MAINTEINER_NAME := Renato Cordeiro Ferreira                          #
# MAINTEINER_MAIL := renato.cferreira@hotmail.com                      #
# DESCRIPTION     := `gbenchmark` is a microbenchmark support library, #
#                    which support unit-tests alike benchmarking. To   #
#                    create the benchmark binary, just set `BENCHBIN`  #
#                    with the name of the file that contains the main  #
#                    function for the benchmarks.                      #
#                    For further info about the library, access:       #
#                    https://code.google.com/p/googletest/             #
########################################################################

ifndef GOOGLE_BENCHMARK_MK
override GOOGLE_BENCHMARK_MK := T

# Dependencies
# ==============
GIT_DEPENDENCY  += \
    gbenchmark => https://github.com/google/benchmark.git \
                  mkdir -p build && cd build \
                  && cmake -DCMAKE_BUILD_TYPE=Release \
													 -DBENCHMARK_ENABLE_TESTING=OFF .. \
                  && make

# Paths
# =======
CXXLIBS         += -isystem external/gbenchmark/include/
LDLIBS          += -L external/gbenchmark/build/src/

# Flags
# =======
LDBENCH         += -lbenchmark -pthread

endif # ifndef GOOGLE_BENCHMARK_MK


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


all:

install: all simpleinstall
uninstall: simpleuninstall

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

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

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

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

Fix installation broken 2 commits prior.

all:

install: all simpleinstall
uninstall: simpleuninstall

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

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

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

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


## Install openfisca-core for deployment and publishing.
build:
	@## This allows us to be sure tests are run against the packaged version
	@## of openfisca-core, the same we put in the hands of users and reusers.
	@$(call print_help,$@:)
	@python setup.py bdist_wheel
	@find dist -name "*.whl" -exec pip install --force-reinstall {}[dev] \;
	@$(call print_pass,$@:)

Add install wheel to build

.PHONY: build

## Install openfisca-core for deployment and publishing.
build:
	@## This allows us to be sure tests are run against the packaged version
	@## of openfisca-core, the same we put in the hands of users and reusers.
	@$(call print_help,$@:)
	@pip install --upgrade pip build twine
	@python -m build
	@pip uninstall --yes openfisca-core
	@find dist -name "*.whl" -exec pip install {}[dev] \;
	@$(call print_pass,$@:)


APP_ABI 				:= armeabi-v7a
APP_STL 				:= gnustl_static
APP_CPPFLAGS 			+= -std=c++11
NDK_TOOLCHAIN_VERSION 	:= clang

Use libc++ instead of libstdc++ on Android.

APP_ABI 				:= armeabi-v7a
APP_STL 				:= c++_static
APP_CPPFLAGS 			+= -std=c++11
NDK_TOOLCHAIN_VERSION 	:= clang


USE_MBOOT ?= 0

# MCU settings
MCU_SERIES = h7
CMSIS_MCU = STM32H743xx
MICROPY_FLOAT_IMPL = double
AF_FILE = boards/stm32h743_af.csv

ifeq ($(USE_MBOOT),1)
# When using Mboot everything goes after the bootloader
LD_FILES = boards/stm32h743.ld boards/common_bl.ld
TEXT0_ADDR = 0x08020000
else
# When not using Mboot everything goes at the start of flash
LD_FILES = boards/stm32h743.ld boards/common_basic.ld
TEXT0_ADDR = 0x08000000
endif

# MicroPython settings
MICROPY_PY_LWIP = 1
MICROPY_PY_USSL = 1
MICROPY_SSL_MBEDTLS = 1

Enable VfsLfs2 on NUCLEO_H743ZI(2) boards.

USE_MBOOT ?= 0

# MCU settings
MCU_SERIES = h7
CMSIS_MCU = STM32H743xx
MICROPY_FLOAT_IMPL = double
AF_FILE = boards/stm32h743_af.csv

ifeq ($(USE_MBOOT),1)
# When using Mboot everything goes after the bootloader
LD_FILES = boards/stm32h743.ld boards/common_bl.ld
TEXT0_ADDR = 0x08020000
else
# When not using Mboot everything goes at the start of flash
LD_FILES = boards/stm32h743.ld boards/common_basic.ld
TEXT0_ADDR = 0x08000000
endif

# MicroPython settings
MICROPY_PY_LWIP = 1
MICROPY_PY_USSL = 1
MICROPY_SSL_MBEDTLS = 1
MICROPY_VFS_LFS2 = 1


USB_VID = 0x239A
USB_PID = 0x8014
USB_PRODUCT = "Metro M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"

CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ

CIRCUITPY_BITBANGIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_GAMEPAD = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_VECTORIO = 0

CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0

CFLAGS_BOARD = --param max-inline-insns-auto=15
ifeq ($(TRANSLATION), ja)
RELEASE_NEEDS_CLEAN_BUILD = 1
CFLAGS_INLINE_LIMIT = 35
endif
ifeq ($(TRANSLATION), zh_Latn_pinyin)
RELEASE_NEEDS_CLEAN_BUILD = 1
CFLAGS_INLINE_LIMIT = 35
endif
ifeq ($(TRANSLATION), de_DE)
RELEASE_NEEDS_CLEAN_BUILD = 1
CFLAGS_INLINE_LIMIT = 35
SUPEROPT_VM = 0
endif

Put back GAMEPAD, take away AUDIOBUSIO

USB_VID = 0x239A
USB_PID = 0x8014
USB_PRODUCT = "Metro M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"

CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ

CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_BITBANGIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_VECTORIO = 0

CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0

CFLAGS_BOARD = --param max-inline-insns-auto=15
ifeq ($(TRANSLATION), ja)
RELEASE_NEEDS_CLEAN_BUILD = 1
CFLAGS_INLINE_LIMIT = 35
endif
ifeq ($(TRANSLATION), zh_Latn_pinyin)
RELEASE_NEEDS_CLEAN_BUILD = 1
CFLAGS_INLINE_LIMIT = 35
endif
ifeq ($(TRANSLATION), de_DE)
RELEASE_NEEDS_CLEAN_BUILD = 1
CFLAGS_INLINE_LIMIT = 35
SUPEROPT_VM = 0
endif


# csrc/generic.mk
#
# Part of the CCNx distribution.
#
# Copyright (C) 2009 Palo Alto Research Center, Inc.
#
# This work is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by the
# Free Software Foundation.
# This work is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.
#
# This is a generic Makefile that is put into each subdirectory
# so that the developer make easily build just that subdirectory,
# possibly with different CFLAGS, etc.
# This is not used at all for a make from the top level.

default all clean depend test check shared install uninstall: _always
	SELF=`basename \`pwd\``; (cd .. && $(MAKE) SUBDIRS=$$SELF $@)

_always:

.PHONY: _always

Fix missing newline at eof


# this file is included by the main Makefile automatically
# TODO make this makefile work on win32
DYLIB_SUFFIX = .dll
PATH_COMPONENT_SEP=\\\\
PATH_SEP_CHAR = ';'
EXE_SUFFIX = .exe
CFLAGS_PIC =
CC := gcc
ifeq ($(BITS),32)
 CROSS_COMPILE ?= i686-w64-mingw32-
else
 # lfind() complains about size_t* vs. unsigned int* ; ignore for now
 PEDANTIC =
 CROSS_COMPILE ?= x86_64-w64-mingw32-
endif
LDFLAGS += -Wl,--kill-at -static-libgcc -static-libstdc++
# haven't tried SDL Windows build yet
SDL = 0

runwrap := $(TOP)/scripts/winewrap $(runwrap)

Disable JIT build on Windows

# this file is included by the main Makefile automatically
# TODO make this makefile work on win32
DYLIB_SUFFIX = .dll
PATH_COMPONENT_SEP=\\\\
PATH_SEP_CHAR = ';'
EXE_SUFFIX = .exe
CFLAGS_PIC =
CC := gcc
ifeq ($(BITS),32)
 CROSS_COMPILE ?= i686-w64-mingw32-
else
 # lfind() complains about size_t* vs. unsigned int* ; ignore for now
 PEDANTIC =
 CROSS_COMPILE ?= x86_64-w64-mingw32-
endif
LDFLAGS += -Wl,--kill-at -static-libgcc -static-libstdc++
# haven't tried SDL Windows build yet
SDL = 0
# JIT on Windows doesn't work yet
JIT = 0

runwrap := $(TOP)/scripts/winewrap $(runwrap)


# This file is included after setting the local build variables like
# $(INC) and $(LIB)

# directories
LIBS=-lc $(LIB)

# compiler and linker options
CDBG=-g -O0 -pg
CPPFLAGS=-D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L
CFLAGS=-Wall -Wextra -Werror -std=c99 -pedantic $(CDBG) $(INC) $(CPPFLAGS) -fstrict-aliasing

LDBG=-g -pg
LDFLAGS=$(LIBS) $(LDBG)

# compiler and linker
CC=gcc
LD=gcc

Remove profiling flags for compilation

# This file is included after setting the local build variables like
# $(INC) and $(LIB)

# directories
LIBS=-lc $(LIB)

# compiler and linker options
CDBG=-g -O0
CPPFLAGS=-D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L
CFLAGS=-Wall -Wextra -Werror -std=c99 -pedantic $(CDBG) $(INC) $(CPPFLAGS) -fstrict-aliasing

LDBG=-g
LDFLAGS=$(LIBS) $(LDBG)

# compiler and linker
CC=gcc
LD=gcc


# basys3 targets

ifneq ($(PLATFORM),basys3)
	$(error "Platform should be arty when using this file!?")
endif

# Settings
DEFAULT_TARGET = net
TARGET ?= $(DEFAULT_TARGET)

PROG_PORT ?= /dev/ttyUSB0
COMM_PORT ?= /dev/ttyUSB1
BAUD ?= 115200

# Image
image-flash-$(PLATFORM): image-flash-py
	@true

# Gateware
gateware-load-$(PLATFORM):
	openocd -f board/digilent_$(PLATFORM).cfg -c "init; pld load 0 $(TARGET_BUILD_DIR)/gateware/top.bit; exit"

gateware-flash-$(PLATFORM): gateware-flash-py
	@true

# Firmware
firmware-load-$(PLATFORM):
	flterm --port=$(COMM_PORT) --kernel=$(FIRMWARE_FILEBASE).bin --speed=$(BAUD)

firmware-flash-$(PLATFORM): firmwage-flash-py
	@true

firmware-connect-$(PLATFORM):
	flterm --port=$(COMM_PORT) --speed=$(BAUD)

# Bios
bios-flash-$(PLATFORM):
	@echo "Unsupported."
	@false

# Extra commands
help-$(PLATFORM):
	@true

reset-$(PLATFORM):
	@echo "Unsupported."
	@false

Change arty to basys3 in makefile's error string

# basys3 targets

ifneq ($(PLATFORM),basys3)
	$(error "Platform should be basys3 when using this file!?")
endif

# Settings
DEFAULT_TARGET = net
TARGET ?= $(DEFAULT_TARGET)

PROG_PORT ?= /dev/ttyUSB0
COMM_PORT ?= /dev/ttyUSB1
BAUD ?= 115200

# Image
image-flash-$(PLATFORM): image-flash-py
	@true

# Gateware
gateware-load-$(PLATFORM):
	openocd -f board/digilent_$(PLATFORM).cfg -c "init; pld load 0 $(TARGET_BUILD_DIR)/gateware/top.bit; exit"

gateware-flash-$(PLATFORM): gateware-flash-py
	@true

# Firmware
firmware-load-$(PLATFORM):
	flterm --port=$(COMM_PORT) --kernel=$(FIRMWARE_FILEBASE).bin --speed=$(BAUD)

firmware-flash-$(PLATFORM): firmwage-flash-py
	@true

firmware-connect-$(PLATFORM):
	flterm --port=$(COMM_PORT) --speed=$(BAUD)

# Bios
bios-flash-$(PLATFORM):
	@echo "Unsupported."
	@false

# Extra commands
help-$(PLATFORM):
	@true

reset-$(PLATFORM):
	@echo "Unsupported."
	@false


CC=cl
CXX=cl
AR=lib
CXX_O=-Fo$@
CFLAGS += -nologo -W3 -EHsc -fp:precise -Zc:wchar_t -Zc:forScope
CXX_LINK_O=-nologo -Fe$@
AR_OPTS=-nologo -out:$@
CFLAGS_OPT=-O2 -Ob1 -Oy- -Zi -GF -Gm- -GS -Gy -MD -DNDEBUG
CFLAGS_DEBUG=-Od -Oy- -ZI -Gm -MDd -RTC1 -D_DEBUG
CFLAGS_M32=
CFLAGS_M64=
LINK_LIB=$(1).lib
LIBSUFFIX=lib
LIBPREFIX=
EXEEXT=.exe
SHAREDLIBSUFFIX=dll
SHARED=-LD
SHLDFLAGS=-link -def:wels.def -implib:wels_dll.lib
EXTRA_LIBRARY=wels_dll.lib

Set GTEST_HAS_TR1_TUPLE to 0 on msvc

CC=cl
CXX=cl
AR=lib
CXX_O=-Fo$@
CFLAGS += -nologo -W3 -EHsc -fp:precise -Zc:wchar_t -Zc:forScope -DGTEST_HAS_TR1_TUPLE=0
CXX_LINK_O=-nologo -Fe$@
AR_OPTS=-nologo -out:$@
CFLAGS_OPT=-O2 -Ob1 -Oy- -Zi -GF -Gm- -GS -Gy -MD -DNDEBUG
CFLAGS_DEBUG=-Od -Oy- -ZI -Gm -MDd -RTC1 -D_DEBUG
CFLAGS_M32=
CFLAGS_M64=
LINK_LIB=$(1).lib
LIBSUFFIX=lib
LIBPREFIX=
EXEEXT=.exe
SHAREDLIBSUFFIX=dll
SHARED=-LD
SHLDFLAGS=-link -def:wels.def -implib:wels_dll.lib
EXTRA_LIBRARY=wels_dll.lib


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

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

# Only compile source java files in this lib.
LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_MODULE := CtsDeqpRunnerTests
LOCAL_MODULE_TAGS := optional
LOCAL_JAVA_LIBRARIES := cts-tradefed_v2 compatibility-host-util tradefed-prebuilt CtsDeqp
LOCAL_STATIC_JAVA_LIBRARIES := easymock

include $(BUILD_HOST_JAVA_LIBRARY)

Fix dependency in runner tests.

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

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

# Only compile source java files in this lib.
LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_MODULE := CtsDeqpRunnerTests
LOCAL_MODULE_TAGS := optional
LOCAL_JAVA_LIBRARIES := cts-tradefed_v2 compatibility-host-util tradefed-prebuilt CtsDeqpTestCases
LOCAL_STATIC_JAVA_LIBRARIES := easymock

include $(BUILD_HOST_JAVA_LIBRARY)


# Provide a relative installation path for Ruby gems.

DIR := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))

include $(DIR)/command.mk
include $(DIR)/path.mk

RUBY := ruby
GEM_HOME := $(PROJECT_ROOT)/.reqd/opt/ruby
GEM_PATH := $(GEM_HOME)
BUNDLE := $(GEM_HOME)/bin/bundle

ifeq ($(RUBY_BUNDLER_VERSION),)
RUBY_BUNDLER_VERSION := 2.0.2
endif

export PATH := $(GEM_HOME)/bin:$(PATH)
export GEM_HOME

bundle-command: $(BUNDLE)

bundle-%: bundle-command
	@$(BUNDLE) $*

$(BUNDLE): | gem-command
	@gem install \
		--install-dir $(GEM_HOME) \
		--no-document \
		-v $(RUBY_BUNDLER_VERSION) bundler

export GEM_HOME
export GEM_PATH

Use Make default variable syntax.

# Provide a relative installation path for Ruby gems.

DIR := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))

include $(DIR)/command.mk
include $(DIR)/path.mk

RUBY := ruby
GEM_HOME := $(PROJECT_ROOT)/.reqd/opt/ruby
GEM_PATH := $(GEM_HOME)
BUNDLE := $(GEM_HOME)/bin/bundle

RUBY_BUNDLER_VERSION ?= 2.0.2

export PATH := $(GEM_HOME)/bin:$(PATH)
export GEM_HOME

bundle-command: $(BUNDLE)

bundle-%: bundle-command
	@$(BUNDLE) $*

$(BUNDLE): | gem-command
	@gem install \
		--install-dir $(GEM_HOME) \
		--no-document \
		-v $(RUBY_BUNDLER_VERSION) bundler

export GEM_HOME
export GEM_PATH


OS ?= $(shell uname)

LUA_SHLIBS ?= $(shell pkg-config --silence-errors --libs lua5.1)
LUA_LIBS ?= $(if $(LUA_SHLIBS),$(LUA_SHLIBS),$(firstword $(wildcard /usr/lib/liblua.a /usr/local/lib/liblua.a /opt/local/lib/liblua.a)))
LUA_CFLAGS ?= $(shell pkg-config --silence-errors --cflags lua5.1)

CC ?= gcc
AR ?= ar
RANLIB ?= ranlib
CFLAGS ?= -O2
FPIC ?= -fPIC
EXTRA_CFLAGS ?= --std=gnu99
WFLAGS ?= -Wall -Werror -pedantic
CPPFLAGS ?=
COMPILE ?= $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) $(WFLAGS)
ifeq ($(OS),Darwin)
  SHLIB_FLAGS ?= -bundle -undefined dynamic_lookup
else
  SHLIB_FLAGS ?= -shared
endif
LINK ?= $(CC)

Revert "* Don't override environment variables in Makefile"

OS ?= $(shell uname)

LUA_SHLIBS = $(shell pkg-config --silence-errors --libs lua5.1)
LUA_LIBS = $(if $(LUA_SHLIBS),$(LUA_SHLIBS),$(firstword $(wildcard /usr/lib/liblua.a /usr/local/lib/liblua.a /opt/local/lib/liblua.a)))
LUA_CFLAGS = $(shell pkg-config --silence-errors --cflags lua5.1)

CC = gcc
AR = ar
RANLIB = ranlib
CFLAGS = -O2
FPIC = -fPIC
EXTRA_CFLAGS = --std=gnu99
WFLAGS = -Wall -Werror -pedantic
CPPFLAGS =
COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) $(WFLAGS)
ifeq ($(OS),Darwin)
  SHLIB_FLAGS = -bundle -undefined dynamic_lookup
else
  SHLIB_FLAGS = -shared
endif
LINK = $(CC)


PLATCFLAGS = -mt -Kpic
MORE_LDLIBS = -lmtmalloc -lnsl -lsocket -L/usr/sfw/lib -R/usr/sfw/lib
CPREFLAGS = -I../include -I/usr/sfw/include
SHEXT = so
SHLIBNAME=libccn.$(SHEXT).1
SHLIBDEPS=
SHARED_LD_FLAGS = -G -z allextract

Choose ginstall over install for Solaris builds

PLATCFLAGS = -mt -Kpic
MORE_LDLIBS = -lmtmalloc -lnsl -lsocket -L/usr/sfw/lib -R/usr/sfw/lib
CPREFLAGS = -I../include -I/usr/sfw/include
SHEXT = so
SHLIBNAME=libccn.$(SHEXT).1
SHLIBDEPS=
SHARED_LD_FLAGS = -G -z allextract
INSTALL = ginstall


#
# Common command rules.
#
include $(BASE_PATH)/build/common.mk

#
# all rule.
#
.PHONY: all

all: $(TARGET_BIN)

#
# For our test programs we don't want to use dynamic libraries because static
# linking makes things a little more predictable.
#
# A counterpoint to this, however, is that using static linking causes valgrind
# to get very upset.
#
LDFLAGS_EXTRA := -static

LIB_DEPS1 := $(patsubst -l%,lib%.a,$(LIBS))
LIB_DEPS := $(patsubst %,$(LIB_PATH)/%,$(LIB_DEPS1))

$(TARGET_BIN): $(OBJS) $(LIB_DEPS)
	$(LD) $(LDFLAGS) -o $@ $(OBJS) -L$(LIB_PATH) -L/usr/local/lib $(LIBS) $(LIBS_EXTRA)

-include $(OBJS:.o=.d)

%.o : %.cpp
	$(CCPP) $(CPPFLAGS) -MD -c $< -o $@

#
# clean rule.
#
.PHONY: clean

clean:
	$(RM) -f $(TARGET_BIN)
	$(RM) -f *.ii *.s *.o *.d *.bc

#
# realclean rule.
#
.PHONY: realclean

realclean: clean
	$(RM) -f *~

Enable builds on Mac OS/X

#
# Common command rules.
#
include $(BASE_PATH)/build/common.mk

#
# all rule.
#
.PHONY: all

all: $(TARGET_BIN)

#
# For our test programs we don't want to use dynamic libraries because static
# linking makes things a little more predictable.
#
# A counterpoint to this, however, is that using static linking causes valgrind
# to get very upset.
#
ifneq ($(UNAME),Darwin)
LDFLAGS_EXTRA := -static
endif

LIB_DEPS1 := $(patsubst -l%,lib%.a,$(LIBS))
LIB_DEPS := $(patsubst %,$(LIB_PATH)/%,$(LIB_DEPS1))

$(TARGET_BIN): $(OBJS) $(LIB_DEPS)
	$(LD) $(LDFLAGS) -o $@ $(OBJS) -L$(LIB_PATH) -L/usr/local/lib $(LIBS) $(LIBS_EXTRA)

-include $(OBJS:.o=.d)

%.o : %.cpp
	$(CCPP) $(CPPFLAGS) -MD -c $< -o $@

#
# clean rule.
#
.PHONY: clean

clean:
	$(RM) -f $(TARGET_BIN)
	$(RM) -f *.ii *.s *.o *.d *.bc

#
# realclean rule.
#
.PHONY: realclean

realclean: clean
	$(RM) -f *~


EXTERNAL_WARNINGS_NOT_ERRORS := TRUE

PRJ=..$/..$/..$/..$/..$/..

PRJNAME=libwps
TARGET=wpslib
ENABLE_EXCEPTIONS=TRUE
LIBTARGET=NO

.INCLUDE :  settings.mk

.IF "$(GUI)"=="WNT"
CFLAGS+=-GR
.ENDIF
.IF "$(COM)"=="GCC"
CFLAGSCXX+=-frtti
.ENDIF

.IF "$(SYSTEM_LIBWPD)" == "YES"
INCPRE+=$(LIBWPD_CFLAGS) -I..
.ELSE
INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwpd
.ENDIF

SLOFILES= \
	$(SLO)$/libwps_internal.obj \
	$(SLO)$/WPS4.obj \
	$(SLO)$/WPS8.obj \
	$(SLO)$/WPSContentListener.obj \
	$(SLO)$/WPSDocument.obj \
	$(SLO)$/WPSHeader.obj \
	$(SLO)$/WPSPageSpan.obj \
	$(SLO)$/WPSParser.obj

LIB1ARCHIV=$(LB)$/libwpslib.a
LIB1TARGET=$(SLB)$/$(TARGET).lib
LIB1OBJFILES= $(SLOFILES)

.INCLUDE :  target.mk

Fix windows gcc build of libwps inside LibreOffice tree (patch Jan Holesovsky <kendy@suse.cz>)

EXTERNAL_WARNINGS_NOT_ERRORS := TRUE

PRJ=..$/..$/..$/..$/..$/..

PRJNAME=libwps
TARGET=wpslib
ENABLE_EXCEPTIONS=TRUE
LIBTARGET=NO

.INCLUDE :  settings.mk

.IF "$(GUI)$(COM)"=="WNTMSC"
CFLAGS+=-GR
.ENDIF
.IF "$(COM)"=="GCC"
CFLAGSCXX+=-frtti
.ENDIF

.IF "$(SYSTEM_LIBWPD)" == "YES"
INCPRE+=$(LIBWPD_CFLAGS) -I..
.ELSE
INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwpd
.ENDIF

SLOFILES= \
	$(SLO)$/libwps_internal.obj \
	$(SLO)$/WPS4.obj \
	$(SLO)$/WPS8.obj \
	$(SLO)$/WPSContentListener.obj \
	$(SLO)$/WPSDocument.obj \
	$(SLO)$/WPSHeader.obj \
	$(SLO)$/WPSPageSpan.obj \
	$(SLO)$/WPSParser.obj

LIB1ARCHIV=$(LB)$/libwpslib.a
LIB1TARGET=$(SLB)$/$(TARGET).lib
LIB1OBJFILES= $(SLOFILES)

.INCLUDE :  target.mk


# VARIABLES #

# Define the citation:
CITATION ?=

# Define the command for returning a citation reference:
CITATION_REFERENCE ?= $(NODE) $(TOOLS_PKGS_DIR)/bib/citation-reference/bin/cli

# Define the path to a citation reference database:
CITATION_REFERENCE_DATABASE ?= $(ROOT_DIR)/docs/references/bib.bib

# Define the path to a Citation Style Language (CSL) file:
CITATION_REFERENCE_CSL ?= $(ROOT_DIR)/docs/references/csl/chicago-author-date.csl

# Define the command-line options to be used when executing the command:
CITATION_REFERENCE_FLAGS ?= \
	--database $(CITATION_REFERENCE_DATABASE) \
	--csl $(CITATION_REFERENCE_CSL)

# TARGETS #

# Return a reference.
#
# This target returns a reference corresponding to a citation identifier.

citation-reference: $(NODE_MODULES)
	$(QUIET) $(CITATION_REFERENCE) $(CITATION_REFERENCE_FLAGS) $(CITATION)

.PHONY: citation-reference

Reformat comment based on JSDoc

# VARIABLES #

# Define the citation:
CITATION ?=

# Define the command for returning a citation reference:
CITATION_REFERENCE ?= $(NODE) $(TOOLS_PKGS_DIR)/bib/citation-reference/bin/cli

# Define the path to a citation reference database:
CITATION_REFERENCE_DATABASE ?= $(ROOT_DIR)/docs/references/bib.bib

# Define the path to a Citation Style Language (CSL) file:
CITATION_REFERENCE_CSL ?= $(ROOT_DIR)/docs/references/csl/chicago-author-date.csl

# Define the command-line options to be used when executing the command:
CITATION_REFERENCE_FLAGS ?= \
	--database $(CITATION_REFERENCE_DATABASE) \
	--csl $(CITATION_REFERENCE_CSL)

# TARGETS #

#/
# Prints a Markdown formatted reference corresponding to a provided citation identifier.
#
# @param {string} CITATION - citation identifier prefixed with an `@` symbol (e.g., `@marsaglia:2000a`)
# @param {string} [CITATION_REFERENCE_DATABASE] - path to a citation reference database (e.g., `/foo/bar/baz/bib.bib`)
# @param {string} [CITATION_REFERENCE_CSL] - path to a Citation Style Language (CSL) file (e.g., `/foo/bar/baz/style.csl`)
#
# @example
# make make citation-reference CITATION=@marsaglia:2000a
#/
citation-reference: $(NODE_MODULES)
	$(QUIET) $(CITATION_REFERENCE) $(CITATION_REFERENCE_FLAGS) $(CITATION)

.PHONY: citation-reference


CFLAGS += -MD
CXXFLAGS += -MD

# Use gmake -n to see the command-lines gmake would run.

%.o : %.c
	@echo Compiling $<
	@$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<

%.o : %.cc
	@echo Compiling $<
	@$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<

Use -MMD instead of -MD. It keeps the dependency files smaller.

CFLAGS += -MMD
CXXFLAGS += -MMD

# Use gmake -n to see the command-lines gmake would run.

%.o : %.c
	@echo Compiling $<
	@$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<

%.o : %.cc
	@echo Compiling $<
	@$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<


# -*- 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_Package_Package,odk_cli,$(OUTDIR)/bin))

$(eval $(call gb_Package_set_outdir,odk_cli,$(INSTDIR)))

$(eval $(call gb_Package_add_files,odk_cli,$(SDKDIRNAME)/cli,\
	cli_basetypes.dll \
	cli_oootypes.dll \
	cli_ure.dll \
	cli_uretypes.dll \
))

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

Install SDK cli/cli_cppuhelper.dll after all

# -*- 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_Package_Package,odk_cli,$(OUTDIR)/bin))

$(eval $(call gb_Package_set_outdir,odk_cli,$(INSTDIR)))

$(eval $(call gb_Package_add_files,odk_cli,$(SDKDIRNAME)/cli,\
	assembly/cli_cppuhelper.dll \
	cli_basetypes.dll \
	cli_oootypes.dll \
	cli_ure.dll \
	cli_uretypes.dll \
))

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


# 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

Remove LINUX flag from OSX build

# 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

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


# see http://mobile.tutsplus.com/tutorials/android/ndk-tutorial/

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE    := sqlite-native-driver
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../sqlite-amalgamation
LOCAL_CFLAGS += -DSQLITE_TEMP_STORE=2 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE
LOCAL_SRC_FILES := ../native/sqlc_all.c
include $(BUILD_SHARED_LIBRARY)

Rename native module to sqlc-native-driver, will apply for both sqlite & sqlcipher

# see http://mobile.tutsplus.com/tutorials/android/ndk-tutorial/

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE    := sqlc-native-driver
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../sqlite-amalgamation
LOCAL_CFLAGS += -DSQLITE_TEMP_STORE=2 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE
LOCAL_SRC_FILES := ../native/sqlc_all.c
include $(BUILD_SHARED_LIBRARY)


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

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

QWERTY_SH_URL ?= https://qwerty.sh
QWERTY_SH ?= curl --proto '=https' --tlsv1.2 -sSf $(QWERTY_SH_URL) | sh -s -

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

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

Use latest tagged version in init.mk file.

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

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

QWERTY_SH_URL ?= https://qwerty.sh
QWERTY_SH ?= curl --proto '=https' --tlsv1.2 -sSf $(QWERTY_SH_URL) | sh -s -

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

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


# Copyright (C) 2015 The Android Open Source Project

LOCAL_PATH:= $(call my-dir)

liblz4_src_files := lz4.c lz4hc.c lz4frame.c xxhash.c

include $(CLEAR_VARS)
LOCAL_MODULE := liblz4
LOCAL_SRC_FILES := $(liblz4_src_files)
include $(BUILD_HOST_STATIC_LIBRARY)

Add LZ4 makefile targets for device, shared library

# Copyright (C) 2015 The Android Open Source Project

LOCAL_PATH:= $(call my-dir)

liblz4_src_files := lz4.c lz4hc.c lz4frame.c xxhash.c

include $(CLEAR_VARS)
LOCAL_MODULE := liblz4
LOCAL_MULTILIB := both
LOCAL_SRC_FILES := $(liblz4_src_files)
include $(BUILD_HOST_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := liblz4
LOCAL_MULTILIB := both
LOCAL_WHOLE_STATIC_LIBRARIES := liblz4
include $(BUILD_HOST_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := liblz4
LOCAL_SRC_FILES := $(liblz4_src_files)
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := liblz4
LOCAL_WHOLE_STATIC_LIBRARIES := liblz4
include $(BUILD_SHARED_LIBRARY)


# this file is included by the main Makefile automatically
tsim$(EXE_SUFFIX): LDLIBS += -ldl

Put -rdynamic in its place

# this file is included by the main Makefile automatically
tsim$(EXE_SUFFIX): LDLIBS += -ldl
tsim$(EXE_SUFFIX): LDFLAGS += -rdynamic


LOCAL_PATH := $(call my-dir)

libefivar_src_files := \
	efivar.c \
	efivarfs.c \
	guid.c \
	lib.c \
	vars.c

include $(CLEAR_VARS)

ifeq ($(TARGET_KERNEL_ARCH),x86_64)
LOCAL_CFLAGS += -DFORCE_32BIT_EBM_RUN_ON_64BIT_OS
endif

LOCAL_SRC_FILES := $(libefivar_src_files)
LOCAL_C_INCLUDES := $(ANDROID_BUILD_TOP)/external/oprofile/libpopt
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE := libefivar
LOCAL_MODULE_TAGS := eng
LOCAL_STATIC_LIBRARIES := liboprofile_popt
include $(BUILD_STATIC_LIBRARY)

Create entry for efivar application

LOCAL_PATH := $(call my-dir)

libefivar_src_files := \
	efivarfs.c \
	guid.c \
	lib.c \
	vars.c

include $(CLEAR_VARS)

ifeq ($(TARGET_KERNEL_ARCH),x86_64)
LOCAL_CFLAGS += -DFORCE_32BIT_EBM_RUN_ON_64BIT_OS
endif

LOCAL_SRC_FILES := $(libefivar_src_files)
LOCAL_C_INCLUDES := $(ANDROID_BUILD_TOP)/external/oprofile/libpopt
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE := libefivar
LOCAL_MODULE_TAGS := eng
LOCAL_STATIC_LIBRARIES := liboprofile_popt
include $(BUILD_STATIC_LIBRARY)

# efivar Application
include $(CLEAR_VARS)
ifeq ($(TARGET_KERNEL_ARCH),x86_64)
LOCAL_CFLAGS += -DFORCE_32BIT_EBM_RUN_ON_64BIT_OS
endif

LOCAL_SRC_FILES :=	efivar.c
LOCAL_C_INCLUDES := $(ANDROID_BUILD_TOP)/external/oprofile/libpopt
LOCAL_MODULE := efivar
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_LIBRARIES := libefivar liboprofile_popt
include $(BUILD_EXECUTABLE)


#HC=/tmp/ghc/bin/ghc
HC=ghc
setup: Setup.lhs
	$(HC) -cpp --make -i../.. Setup.lhs -o setup 2>out.build
clean:
	rm -f setup a.out .setup-config register.sh unregister.sh out.build
	rm -rf ,tmp* dist
	find . -name "*.o" |xargs rm -f
	find . -name "*.hi" |xargs rm -f
	find . -name "*~" | xargs rm -f
check: setup
	./setup configure --user --prefix=/tmp/foo
	./setup build
	./setup install --install-prefix=/tmp/bar
	ls /tmp/bar*
	# install w/ register!
	./setup install
#	ls /tmp/foo*
	./setup sdist
	ls dist

Make system tweaks to avoid cabal thinking it isn't bootstrapped when running the testsuite

# Some hacks
HC = $(shell grep "^HC=" ../../Makefile | sed "s/HC=//")
comma = ,
CABALVERSION = $(shell grep "^CABALVERSION=" ../../Makefile | sed "s/CABALVERSION=//")

setup: Setup.lhs
	$(HC) -cpp -DCABAL_VERSION=$(subst .,$(comma),$(CABALVERSION)) --make -i../.. Setup.lhs -o setup 2>out.build
clean:
	rm -f setup a.out .setup-config register.sh unregister.sh out.build
	rm -rf ,tmp* dist
	find . -name "*.o" |xargs rm -f
	find . -name "*.hi" |xargs rm -f
	find . -name "*~" | xargs rm -f
check: setup
	./setup configure --user --prefix=/tmp/foo
	./setup build
	./setup install --install-prefix=/tmp/bar
	ls /tmp/bar*
	# install w/ register!
	./setup install
#	ls /tmp/foo*
	./setup sdist
	ls dist


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

LOCAL_MODULE_TAGS := samples tests

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

LOCAL_PACKAGE_NAME := SupportAppNavigation

LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4

LOCAL_SDK_VERSION := current

include $(BUILD_PACKAGE)

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

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

Add missing LOCAL_MIN_SDK_VERSION for Support Library demos

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

LOCAL_MODULE_TAGS := samples tests

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

LOCAL_PACKAGE_NAME := SupportAppNavigation

LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4

LOCAL_SDK_VERSION := current

LOCAL_MIN_SDK_VERSION := 8

include $(BUILD_PACKAGE)

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

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


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

LOCAL_PATH:= $(call my-dir)

# Build the samples.
# We need to add some special AAPT flags to generate R classes
# for resources that are included from the libraries.
include $(CLEAR_VARS)
LOCAL_PACKAGE_NAME := SupportLeanbackDemos
LOCAL_MODULE_TAGS := samples tests
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := \
        android-support-v4 \
        android-support-v7-recyclerview \
        android-support-v17-leanback
LOCAL_RESOURCE_DIR = \
        $(LOCAL_PATH)/res \
        frameworks/support/v17/leanback/res
LOCAL_AAPT_FLAGS := \
        --auto-add-overlay \
        --extra-packages android.support.v17.leanback
include $(BUILD_PACKAGE)

Add resources to recyclerview dependency.

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

LOCAL_PATH:= $(call my-dir)

# Build the samples.
# We need to add some special AAPT flags to generate R classes
# for resources that are included from the libraries.
include $(CLEAR_VARS)
LOCAL_PACKAGE_NAME := SupportLeanbackDemos
LOCAL_MODULE_TAGS := samples tests
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := \
        android-support-v4 \
        android-support-v7-recyclerview \
        android-support-v17-leanback
LOCAL_RESOURCE_DIR = \
        $(LOCAL_PATH)/res \
        frameworks/support/v17/leanback/res \
        frameworks/support/v7/recyclerview/res
LOCAL_AAPT_FLAGS := \
        --auto-add-overlay \
        --extra-packages android.support.v17.leanback \
        --extra-packages android.support.v7.recyclerview
include $(BUILD_PACKAGE)


include $(OPENMRNPATH)/etc/path.mk

SYSLIB_SUBDIRS += freertos freertos_drivers
SYSLIBRARIES += -lfreertos -lfreertos_drivers
DEPS += FREERTOSPATH

Add in event flag support

include $(OPENMRNPATH)/etc/path.mk

SYSLIB_SUBDIRS += freertos freertos_drivers
SYSLIBRARIES += -lfreertos -lfreertos_drivers $(OPENMRNPATH)/targets/$(TARGET)/freertos/event_groups.o
DEPS += FREERTOSPATH


EXTRA_DIST += src/modules/xwayland/module.desktop.in \
src/modules/xwayland/e-module-xwayland.edj \
src/modules/xwayland/module.desktop.in
if USE_MODULE_XWAYLAND
xwaylanddir = $(MDIR)/xwayland
xwayland_DATA = src/modules/xwayland/e-module-xwayland.edj \
	       src/modules/xwayland/module.desktop

xwaylandpkgdir = $(MDIR)/xwayland/$(MODULE_ARCH)
xwaylandpkg_LTLIBRARIES = src/modules/xwayland/module.la

src_modules_xwayland_module_la_DEPENDENCIES = $(MDEPENDENCIES)
src_modules_xwayland_module_la_CPPFLAGS  = $(MOD_CPPFLAGS) @XWAYLAND_CFLAGS@ @WAYLAND_CFLAGS@
src_modules_xwayland_module_la_LIBADD   = $(LIBS) @XWAYLAND_LIBS@ @WAYLAND_LIBS@
src_modules_xwayland_module_la_LDFLAGS = $(MOD_LDFLAGS)

src_modules_xwayland_module_la_SOURCES = \
  src/modules/xwayland/e_mod_main.c

PHONIES += xwayland install-xwayland
xwayland: $(xwaylandpkg_LTLIBRARIES) $(xwayland_DATA)
install-xwayland: install-xwaylandDATA install-xwaylandpkgLTLIBRARIES
endif

Fix makefile to use xwayland binary path

EXTRA_DIST += src/modules/xwayland/module.desktop.in \
src/modules/xwayland/e-module-xwayland.edj \
src/modules/xwayland/module.desktop.in
if USE_MODULE_XWAYLAND
xwaylanddir = $(MDIR)/xwayland
xwayland_DATA = src/modules/xwayland/e-module-xwayland.edj \
	       src/modules/xwayland/module.desktop

xwaylandpkgdir = $(MDIR)/xwayland/$(MODULE_ARCH)
xwaylandpkg_LTLIBRARIES = src/modules/xwayland/module.la

src_modules_xwayland_module_la_DEPENDENCIES = $(MDEPENDENCIES)
src_modules_xwayland_module_la_CPPFLAGS  = \
  $(MOD_CPPFLAGS) @XWAYLAND_CFLAGS@ @WAYLAND_CFLAGS@ \
  -DXWAYLAND_BIN=\"@XWAYLAND_BIN@\"

src_modules_xwayland_module_la_LIBADD   = $(LIBS) @XWAYLAND_LIBS@ @WAYLAND_LIBS@
src_modules_xwayland_module_la_LDFLAGS = $(MOD_LDFLAGS)

src_modules_xwayland_module_la_SOURCES = \
  src/modules/xwayland/e_mod_main.c

PHONIES += xwayland install-xwayland
xwayland: $(xwaylandpkg_LTLIBRARIES) $(xwayland_DATA)
install-xwayland: install-xwaylandDATA install-xwaylandpkgLTLIBRARIES
endif


#########################################################################
# COMMON COMPILATION FLAGS                                              #
#########################################################################

CROSS_COMPILE   ?= arm-linux-gnueabihf-
CC              := $(CROSS_COMPILE)gcc

CFLAGS          := -Wall -Wbad-function-cast -Wcast-align \
		   -Werror-implicit-function-declaration -Wextra \
		   -Wfloat-equal -Wformat-nonliteral -Wformat-security \
		   -Wformat=2 -Winit-self -Wmissing-declarations \
		   -Wmissing-format-attribute -Wmissing-include-dirs \
		   -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs \
		   -Wpointer-arith -Wshadow -Wstrict-prototypes \
		   -Wswitch-default -Wunsafe-loop-optimizations \
		   -Wwrite-strings -Werror
CFLAGS          += -c -fPIC

DEBUG       ?= 0
ifeq ($(DEBUG), 1)
CFLAGS          += -DDEBUG -O0 -g
endif

RM              := rm -rf

Make CC configurable via the environment.

#########################################################################
# COMMON COMPILATION FLAGS                                              #
#########################################################################

CROSS_COMPILE   ?= arm-linux-gnueabihf-
CC              ?= $(CROSS_COMPILE)gcc

CFLAGS          := -Wall -Wbad-function-cast -Wcast-align \
		   -Werror-implicit-function-declaration -Wextra \
		   -Wfloat-equal -Wformat-nonliteral -Wformat-security \
		   -Wformat=2 -Winit-self -Wmissing-declarations \
		   -Wmissing-format-attribute -Wmissing-include-dirs \
		   -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs \
		   -Wpointer-arith -Wshadow -Wstrict-prototypes \
		   -Wswitch-default -Wunsafe-loop-optimizations \
		   -Wwrite-strings -Werror
CFLAGS          += -c -fPIC

DEBUG       ?= 0
ifeq ($(DEBUG), 1)
CFLAGS          += -DDEBUG -O0 -g
endif

RM              := rm -rf


# Boot animation
TARGET_SCREEN_HEIGHT := 1920
TARGET_SCREEN_WIDTH := 1080
TARGET_BOOTANIMATION_HALF_RES := true

# Inherit some common LineageOS stuff.
$(call inherit-product, vendor/lineage/config/common_full_phone.mk)

# Inherit device configuration
$(call inherit-product, device/lge/hammerhead/full_hammerhead.mk)

## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := hammerhead
PRODUCT_NAME := lineage_hammerhead
PRODUCT_BRAND := google
PRODUCT_MODEL := Nexus 5
PRODUCT_MANUFACTURER := LGE

PRODUCT_BUILD_PROP_OVERRIDES += \
    PRODUCT_NAME=hammerhead \
    BUILD_FINGERPRINT=google/hammerhead/hammerhead:6.0.1/M4B30Z/3437181:user/release-keys \
    PRIVATE_BUILD_DESC="hammerhead-user 6.0.1 M4B30Z 3437181 release-keys"

Set matching build fingerprint for system, vendor and boot images

# Boot animation
TARGET_SCREEN_HEIGHT := 1920
TARGET_SCREEN_WIDTH := 1080
TARGET_BOOTANIMATION_HALF_RES := true

# Inherit some common LineageOS stuff.
$(call inherit-product, vendor/lineage/config/common_full_phone.mk)

# Inherit device configuration
$(call inherit-product, device/lge/hammerhead/full_hammerhead.mk)

## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := hammerhead
PRODUCT_NAME := lineage_hammerhead
PRODUCT_BRAND := google
PRODUCT_MODEL := Nexus 5
PRODUCT_MANUFACTURER := LGE

PRODUCT_BUILD_PROP_OVERRIDES += \
    PRODUCT_NAME=hammerhead \
    PRIVATE_BUILD_DESC="hammerhead-user 6.0.1 M4B30Z 3437181 release-keys"

BUILD_FINGERPRINT := google/hammerhead/hammerhead:6.0.1/M4B30Z/3437181:user/release-keys


# 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

Fix rpathness on NetBSD again.

# 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=/${LIBNAME}"; \
			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


LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := methcla
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libmethcla.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include $(LOCAL_PATH)/../../plugins
include $(PREBUILT_STATIC_LIBRARY)

Remove unneeded directory from include path

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := methcla
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libmethcla.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include
include $(PREBUILT_STATIC_LIBRARY)


USB_VID = 0x239A
USB_PID = 0x80CE
USB_PRODUCT = "Feather M4 CAN"
USB_MANUFACTURER = "Adafruit Industries LLC"

CHIP_VARIANT = SAME51J19A
CHIP_FAMILY = same51

QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = GD25Q16C
LONGINT_IMPL = MPZ

CIRCUITPY_CANIO = 1

Add EVE support to Feather M4 CAN

USB_VID = 0x239A
USB_PID = 0x80CE
USB_PRODUCT = "Feather M4 CAN"
USB_MANUFACTURER = "Adafruit Industries LLC"

CHIP_VARIANT = SAME51J19A
CHIP_FAMILY = same51

QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = GD25Q16C
LONGINT_IMPL = MPZ

CIRCUITPY__EVE = 1
CIRCUITPY_CANIO = 1


#
# Common command rules.
#
include $(BASE_PATH)/build/common.mk

#
# Define the "installed" targets that we want to make.
#
INSTALL_TARGET_LIB := $(LIB_PATH)/$(TARGET_LIB)

#
# all rule.
#
.PHONY: all

all: $(INSTALL_TARGET_LIB)

$(INSTALL_TARGET_LIB): $(TARGET_LIB)
	$(INSTALL) $(INSTALLFLAGS) $(patsubst $(LIB_PATH)/%,%,$@) $(LIB_PATH)

$(TARGET_LIB): $(OBJS)
	$(AR) $(ARFLAGS) $@ $^

-include $(OBJS:.o=.d)

%.o : %.cpp
	$(CCPP) $(CPPFLAGS) -MD -c $< -o $@

#
# clean rule.
#
.PHONY: clean

clean:
	$(RM) -f $(TARGET_LIB)
	$(RM) -f $(INSTALL_TARGET_LIB)
	$(RM) -f */*.ii */*.s */*.o */*.d

#
# realclean rule.
#
.PHONY: realclean

realclean: clean
	$(RM) -f *~ */*~

Fix up build after source layout changes

#
# Common command rules.
#
include $(BASE_PATH)/build/common.mk

#
# Define the "installed" targets that we want to make.
#
INSTALL_TARGET_LIB := $(LIB_PATH)/$(TARGET_LIB)

#
# all rule.
#
.PHONY: all

all: $(INSTALL_TARGET_LIB)

$(INSTALL_TARGET_LIB): $(TARGET_LIB)
	$(INSTALL) $(INSTALLFLAGS) $(patsubst $(LIB_PATH)/%,%,$@) $(LIB_PATH)

$(TARGET_LIB): $(OBJS)
	$(AR) $(ARFLAGS) $@ $^

-include $(OBJS:.o=.d)

%.o : %.cpp
	$(CCPP) $(CPPFLAGS) -MD -c $< -o $@

#
# clean rule.
#
.PHONY: clean

clean:
	$(RM) -f $(TARGET_LIB)
	$(RM) -f $(INSTALL_TARGET_LIB)
	$(RM) -f *.ii *.s *.o *.d

#
# realclean rule.
#
.PHONY: realclean

realclean: clean
	$(RM) -f *~


# Boot animation
TARGET_SCREEN_HEIGHT := 1920
TARGET_SCREEN_WIDTH := 1080
TARGET_BOOTANIMATION_HALF_RES := true

# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)

# Enhanced NFC
$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)

# Inherit device configuration
$(call inherit-product, device/lge/hammerhead/full_hammerhead.mk)

## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := hammerhead
PRODUCT_NAME := cm_hammerhead
PRODUCT_BRAND := google
PRODUCT_MODEL := Nexus 5
PRODUCT_MANUFACTURER := LGE

PRODUCT_BUILD_PROP_OVERRIDES += \
    PRODUCT_NAME=hammerhead \
    BUILD_FINGERPRINT=google/hammerhead/hammerhead:6.0.1/MOB30D/2704746:user/release-keys \
    PRIVATE_BUILD_DESC="hammerhead-user 6.0.1 MOB30D 2704746 release-keys"

Update fingerprints and build desc.

# Boot animation
TARGET_SCREEN_HEIGHT := 1920
TARGET_SCREEN_WIDTH := 1080
TARGET_BOOTANIMATION_HALF_RES := true

# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)

# Enhanced NFC
$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)

# Inherit device configuration
$(call inherit-product, device/lge/hammerhead/full_hammerhead.mk)

## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := hammerhead
PRODUCT_NAME := cm_hammerhead
PRODUCT_BRAND := google
PRODUCT_MODEL := Nexus 5
PRODUCT_MANUFACTURER := LGE

PRODUCT_BUILD_PROP_OVERRIDES += \
    PRODUCT_NAME=hammerhead \
    BUILD_FINGERPRINT=google/hammerhead/hammerhead:6.0.1/MOB30M/2862625:user/release-keys \
    PRIVATE_BUILD_DESC="hammerhead-user 6.0.1 MOB30M 2862625 release-keys"


# $FreeBSD$

.if ${MACHINE_ARCH} == "amd64" || \
    ${MACHINE_ARCH} == "i386" || \
    ${MACHINE_ARCH} == "ia64" || \
    (${MACHINE_ARCH} == "arm" && !defined(ARM_BIG_ENDIAN))
TARGET_ENDIANNESS= 1234
.elif ${MACHINE_ARCH} == "powerpc" || \
    ${MACHINE_ARCH} == "sparc64" || \
    ${MACHINE_ARCH} == "arm"
TARGET_ENDIANNESS= 4321
.endif

Change one more ARM_BIG_ENDIAN to TARGET_BIG_ENDIAN.

# $FreeBSD$

.if ${MACHINE_ARCH} == "amd64" || \
    ${MACHINE_ARCH} == "i386" || \
    ${MACHINE_ARCH} == "ia64" || \
    (${MACHINE_ARCH} == "arm" && !defined(TARGET_BIG_ENDIAN))
TARGET_ENDIANNESS= 1234
.elif ${MACHINE_ARCH} == "powerpc" || \
    ${MACHINE_ARCH} == "sparc64" || \
    ${MACHINE_ARCH} == "arm"
TARGET_ENDIANNESS= 4321
.endif


$(shell echo "INCLUDED2 = yes" >local-include.inc)

include $(TESTPATH)/include-file.inc local-include.inc

all:
	test "$(INCLUDED)" = "yes"
	@echo TEST-PASS

Test that we included both files.

$(shell echo "INCLUDED2 = yes" >local-include.inc)

include $(TESTPATH)/include-file.inc local-include.inc

all:
	test "$(INCLUDED)" = "yes"
	test "$(INCLUDED2)" = "yes"
	@echo TEST-PASS


# The locales from the ICU "-large.dat" data set.
# See external/icu4c/stubdata.
# This is distinct from "languages_full.mk", which contains those locales for
# which we have translations. If you like, this file is i18n rather than l18n.
PRODUCT_LOCALES := cs_CZ da_DA de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_NZ en_SG en_US es_ES fr_CA fr_CH fr_BE fr_FR it_CH it_IT ja_JP ko_KR nb_NO nl_BE nl_NL pl_PL pt_PT ru_RU sv_SV tr_TR zh_CN zh_HK zh_TW

Fix list of locales (bad country codes).

# The locales from the ICU "-large.dat" data set.
# See external/icu4c/stubdata.
# This is distinct from "languages_full.mk", which contains those locales for
# which we have translations. If you like, this file is i18n rather than l18n.
PRODUCT_LOCALES := cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_NZ en_SG en_US es_ES fr_CA fr_CH fr_BE fr_FR it_CH it_IT ja_JP ko_KR nb_NO nl_BE nl_NL pl_PL pt_PT ru_RU sv_SE tr_TR zh_CN zh_HK zh_TW


PKG_CONFIG_LIBDIR = $(INSTALL_DIR)/$(INSTALL_PREFIX)/lib/pkgconfig

INSTALL_DIR = $(WORK_DIR)/install
INSTALL_PREFIX = /usr/local

ENV += LD= CPP= NM= CC= RANLIB= CXX= AR= STRIP= OBJDUM= CFLAGS= CPPFLAGS= LDFLAGS=
ENV += INSTALL_PREFIX=$(INSTALL_PREFIX)

Fix native env so native python/glibc can be compiled from within spk

PKG_CONFIG_LIBDIR = $(INSTALL_DIR)/$(INSTALL_PREFIX)/lib/pkgconfig

INSTALL_DIR = $(WORK_DIR)/install
INSTALL_PREFIX = /usr/local

ENV += -u PKG_CONFIG -u PKG_CONFIG_LIBDIR -u PKG_CONFIG_PATH
ENV += LD= CPP= NM= CC= RANLIB= CXX= AR= STRIP= OBJDUM= CFLAGS= CPPFLAGS= LDFLAGS= CXXFLAGS= LDSHARED= READELF= AS= OBJDUMP=
ENV += INSTALL_PREFIX=$(INSTALL_PREFIX)


include unittest.mk
include assert.mk
include artifact.mk

define test_rule
$($1.name):
	@echo "$($1.name)!"
endef

define test_artifact
$1.name = bob
$1.rules = test_rule
endef

.PHONY: target
target: $(call artifact, test_artifact)

ifdef $(call unittest,with_one_artifact)
$(call assert_equal,$(test_artifact.name),bob)
endif

ifdef $(call unittest,with_one_rule)
$(call assert_equal,$(shell make -f $(firstword $(MAKEFILE_LIST)) bob),bob!)
endif

ifdef $(call unittest,with_one_target)
$(call assert_equal,$(shell make -f $(firstword $(MAKEFILE_LIST)) target),bob!)
endif

Add artifact test with two rules

include unittest.mk
include assert.mk
include artifact.mk

define single_rule
.PHONY: $($1.name)
$($1.name):
	@echo "$($1.name)!"
endef

define chained_rule_1
.PHONY: $($1.name)
$($1.name): $($1.name).dep
endef

define chained_rule_2
.PHONY: $($1.name)
$($1.name).dep:
	@echo "$($1.name)!"
endef

define simple_artifact
$1.name = bob
$1.rules = single_rule
endef

define chained_artifact
$1.name = larry
$1.rules = chained_rule_1 chained_rule_2
endef

.PHONY: target
target: $(call artifact, simple_artifact)
$(call artifact, chained_artifact):

ifdef $(call unittest,with_one_artifact)
$(call assert_equal,$(simple_artifact.name),bob)
endif

ifdef $(call unittest,with_one_rule)
$(call assert_equal,$(shell make -f $(firstword $(MAKEFILE_LIST)) bob),bob!)
endif

ifdef $(call unittest,with_one_target)
$(call assert_equal,$(shell make -f $(firstword $(MAKEFILE_LIST)) target),bob!)
endif

ifdef $(call unittest,with_two_rules)
$(call assert_equal,$(shell make -f $(firstword $(MAKEFILE_LIST)) larry),larry!)
endif


#########################################################################
# COMMON COMPILATION FLAGS                                              #
#########################################################################

CROSS_COMPILE   ?= arm-linux-gnueabihf-
CC              ?= $(CROSS_COMPILE)gcc

CFLAGS          := -Wall -Wbad-function-cast -Wcast-align \
		   -Werror-implicit-function-declaration -Wextra \
		   -Wfloat-equal -Wformat-nonliteral -Wformat-security \
		   -Wformat=2 -Winit-self -Wmissing-declarations \
		   -Wmissing-format-attribute -Wmissing-include-dirs \
		   -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs \
		   -Wpointer-arith -Wshadow -Wstrict-prototypes \
		   -Wswitch-default -Wunsafe-loop-optimizations \
		   -Wwrite-strings -Werror
CFLAGS          += -c -fPIC

DEBUG       ?= 0
ifeq ($(DEBUG), 1)
CFLAGS          += -DDEBUG -O0 -g
endif

RM              := rm -rf

Revert "changed the CC line to accept a compiler that was already set from an exterior environment If not set the default defined behavior will still be accepted."

#########################################################################
# COMMON COMPILATION FLAGS                                              #
#########################################################################

CROSS_COMPILE   ?= arm-linux-gnueabihf-
CC              := $(CROSS_COMPILE)gcc

CFLAGS          := -Wall -Wbad-function-cast -Wcast-align \
		   -Werror-implicit-function-declaration -Wextra \
		   -Wfloat-equal -Wformat-nonliteral -Wformat-security \
		   -Wformat=2 -Winit-self -Wmissing-declarations \
		   -Wmissing-format-attribute -Wmissing-include-dirs \
		   -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs \
		   -Wpointer-arith -Wshadow -Wstrict-prototypes \
		   -Wswitch-default -Wunsafe-loop-optimizations \
		   -Wwrite-strings -Werror
CFLAGS          += -c -fPIC

DEBUG       ?= 0
ifeq ($(DEBUG), 1)
CFLAGS          += -DDEBUG -O0 -g
endif

RM              := rm -rf


PP_INPUTS := $(wildcard $(addprefix $(S)src/lib/,*.rs */*.rs)) \
             $(wildcard $(addprefix $(S)src/comp/,*.rs */*.rs */*/*.rs))

reformat: $(SREQ1)
	@$(call E, reformat [stage1]: $@)
	for i in $(PP_INPUTS);  \
    do $(call CFG_RUN_TARG,stage1, stage1/rustc$(X)) \
       --pretty normal $$i >$$i.tmp && mv $$i.tmp $$i; \
    done

Add tests to 'make reformat' target.

PP_INPUTS := $(wildcard $(addprefix $(S)src/lib/,*.rs */*.rs)) \
             $(wildcard $(addprefix $(S)src/comp/,*.rs */*.rs */*/*.rs)) \
             $(wildcard $(S)src/test/*/*.rs   \
                        $(S)src/test/*/*/*.rs)

reformat: $(SREQ1)
	@$(call E, reformat [stage1]: $@)
	for i in $(PP_INPUTS);  \
    do $(call CFG_RUN_TARG,stage1, stage1/rustc$(X)) \
       --pretty normal $$i >$$i.tmp && mv $$i.tmp $$i; \
    done


build:
	mkdir build; cd build; \
		cmake .. -DWITH_TESTS=ON -DWITH_OPENMP=$(FGT_WITH_OPENMP) -DCMAKE_BUILD_TYPE=Release; \
		make

test:
	build/bin/fgt-test
	build/bin/fgt-trial

install:
	cd build; sudo make install

.PHONY: build test install

Create a verbose makefile on Travis

build:
	mkdir build; cd build; \
		cmake .. -DWITH_TESTS=ON -DWITH_OPENMP=$(FGT_WITH_OPENMP) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON; \
		make

test:
	build/bin/fgt-test
	build/bin/fgt-trial

install:
	cd build; sudo make install

.PHONY: build test install


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

# tag this module as a cts test artifact
LOCAL_COMPATIBILITY_SUITE := cts vts general-tests

# Don't include this package in any target
LOCAL_MODULE_TAGS := tests

LOCAL_MULTILIB := both

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

LOCAL_PACKAGE_NAME := CtsPerfettoProducerApp

LOCAL_JNI_SHARED_LIBRARIES := \
    libperfettocts_jni \
    libnativehelper_compat_libc++

include $(BUILD_PACKAGE)

Build CtsPerfettoProducerApp against the SDK.

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

# tag this module as a cts test artifact
LOCAL_COMPATIBILITY_SUITE := cts vts general-tests

# Don't include this package in any target
LOCAL_MODULE_TAGS := tests

LOCAL_MULTILIB := both

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

LOCAL_PACKAGE_NAME := CtsPerfettoProducerApp

LOCAL_SDK_VERSION := current

LOCAL_JNI_SHARED_LIBRARIES := \
    libperfettocts_jni \
    libnativehelper_compat_libc++

include $(BUILD_PACKAGE)


# Copyright 2019 Google LLC
#
# 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
#
#     https://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.

.PHONY: runner/build
runner/build: build/cargo-host/release/runner

.PHONY: runner/check
runner/check:
	cd runner && \
		CARGO_BUILD_TARGET_DIR="../build/cargo-host" cargo check

.PHONY: runner/devicetests
runner/devicetests:

.PHONY: runner/doc
runner/doc:
	cd runner && \
		CARGO_BUILD_TARGET_DIR="../build/cargo-host" cargo doc

.PHONY: runner/localtests
runner/localtests:
	cd runner && \
		CARGO_BUILD_TARGET_DIR="../build/cargo-host" cargo test

.PHONY: build/cargo-host/release/runner
build/cargo-host/release/runner:
	cd runner && \
		CARGO_BUILD_TARGET_DIR="../build/cargo-host" \
		cargo build --release

Replace CARGO_BUILD_TARGET_DIR with CARGO_TARGET_DIR to fix the runner's build.

# Copyright 2019 Google LLC
#
# 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
#
#     https://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.

.PHONY: runner/build
runner/build: build/cargo-host/release/runner

.PHONY: runner/check
runner/check:
	cd runner && \
		CARGO_TARGET_DIR="../build/cargo-host" cargo check

.PHONY: runner/devicetests
runner/devicetests:

.PHONY: runner/doc
runner/doc:
	cd runner && \
		CARGO_TARGET_DIR="../build/cargo-host" cargo doc

.PHONY: runner/localtests
runner/localtests:
	cd runner && \
		CARGO_TARGET_DIR="../build/cargo-host" cargo test

.PHONY: build/cargo-host/release/runner
build/cargo-host/release/runner:
	cd runner && \
		CARGO_TARGET_DIR="../build/cargo-host" \
		cargo build --release


check-local::
	if test -n "$(check_misc_sources)"; then \
		top_srcdir=$(top_srcdir) sh $(top_srcdir)/check-whitespace.sh \
			$(check_misc_sources); \
	fi
	if test -n "$(check_c_sources)"; then \
		top_srcdir=$(top_srcdir) sh $(top_srcdir)/check-c-style.sh \
			$(check_c_sources); \
	fi

Make coding style violations not fail "make check" unless CHECK_CODING_STYLE is non-empty (changing everything to correct coding style is likely to cause hideous conflicts right now)

check-local::
	@fail=0; \
	if test -n "$(check_misc_sources)"; then \
		top_srcdir=$(top_srcdir) sh $(top_srcdir)/check-whitespace.sh \
			$(check_misc_sources) || fail=1; \
	fi; \
	if test -n "$(check_c_sources)"; then \
		top_srcdir=$(top_srcdir) sh $(top_srcdir)/check-c-style.sh \
			$(check_c_sources) || fail=1; \
	fi;\
	if test -n "$(CHECK_CODING_STYLE)"; then \
		exit "$$fail";\
	else \
		exit 0;\
	fi


# Copyright (c) 2008-2015 The OpenRC Authors.
# See the Authors file at the top-level directory of this distribution and
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
#
# This file is part of OpenRC. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.

SFX=		.Linux.in
PKG_PREFIX?=	/usr

CPPFLAGS+=	-D_DEFAULT_SOURCE
LIBDL=		-Wl,-Bdynamic -ldl

ifeq (${MKSELINUX},yes)
CPPFLAGS+= -DHAVE_SELINUX
LIBSELINUX?= -lselinux
LDADD += $(LIBSELINUX)

ifneq (${MKPAM},pam)
# if using selinux but not pam then we need crypt
LIBCRYPT?= -lcrypt
LDADD += $(LIBCRYPT)
endif

endif

ifeq (${MKAUDIT},yes)
LIBAUDIT?=	-laudit
CPPFLAGS+=	-DHAVE_AUDIT
LDADD+=		${LIBAUDIT}
endif

Add _POSIX_C_SOURCE definition to Linux build

# Copyright (c) 2008-2015 The OpenRC Authors.
# See the Authors file at the top-level directory of this distribution and
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
#
# This file is part of OpenRC. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.

SFX=		.Linux.in
PKG_PREFIX?=	/usr

CPPFLAGS+=	-D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L
LIBDL=		-Wl,-Bdynamic -ldl

ifeq (${MKSELINUX},yes)
CPPFLAGS+= -DHAVE_SELINUX
LIBSELINUX?= -lselinux
LDADD += $(LIBSELINUX)

ifneq (${MKPAM},pam)
# if using selinux but not pam then we need crypt
LIBCRYPT?= -lcrypt
LDADD += $(LIBCRYPT)
endif

endif

ifeq (${MKAUDIT},yes)
LIBAUDIT?=	-laudit
CPPFLAGS+=	-DHAVE_AUDIT
LDADD+=		${LIBAUDIT}
endif


# Build a mostly static binary.

CC					= gcc-6
CXX					= g++-6
MKDIR				= mkdir
GENGETOPT			= gengetopt
RAGEL				= ragel
DOT					= dot

BOOST_INCLUDE		= -I/home/tnorri/local/boost-1-63-0/include
BOOST_LIBS			= -L/home/tnorri/local/boost-1-63-0/lib -lboost_iostreams
LIBDISPATCH_LIBS	= ../lib/libdispatch/libdispatch-build/src/libdispatch.a ../lib/libpwq/libpwq-build/libpthread_workqueue.a /usr/lib/libkqueue.a -lpthread -static-libstdc++ -static-libgcc

Add a variable for Boost installation root

# Build a mostly static binary.

CC					= gcc-6
CXX					= g++-6
MKDIR				= mkdir
GENGETOPT			= gengetopt
RAGEL				= ragel
DOT					= dot

BOOST_ROOT			= /home/tnorri/local/boost-1-64-0-g++-7.1
BOOST_INCLUDE		= -I$(BOOST_ROOT)/include
BOOST_LIBS			= -L$(BOOST_ROOT)/lib -lboost_iostreams
LIBDISPATCH_LIBS	= ../lib/libdispatch/libdispatch-build/src/libdispatch.a ../lib/libpwq/libpwq-build/libpthread_workqueue.a /usr/lib/libkqueue.a -lpthread -static-libstdc++ -static-libgcc


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

PRODUCT_BRAND := generic
PRODUCT_DEVICE := generic
PRODUCT_NAME := core

PRODUCT_PROPERTY_OVERRIDES := \
    ro.config.notification_sound=OnTheHunt.ogg \
    ro.config.alarm_alert=Alarm_Classic.ogg

PRODUCT_PACKAGES := \
    framework-res \
    Browser \
    CarHomeLauncher \
    Contacts \
    Home \
    HTMLViewer \
    Phone \
    ApplicationsProvider \
    ContactsProvider \
    DownloadProvider \
    MediaProvider \
    PicoTts \
    SettingsProvider \
    TelephonyProvider \
    TtsService \
    VpnServices \
    UserDictionaryProvider \
    PackageInstaller \
    DefaultContainerService \
    Bugreport

PRODUCT_PROPERTY_OVERRIDES += \
    media.stagefright.enable-player=true \
    media.stagefright.enable-meta=true   \
    media.stagefright.enable-scan=true   \
    media.stagefright.enable-http=true

Make Vorbis decoding through stagefright the default.

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

PRODUCT_BRAND := generic
PRODUCT_DEVICE := generic
PRODUCT_NAME := core

PRODUCT_PROPERTY_OVERRIDES := \
    ro.config.notification_sound=OnTheHunt.ogg \
    ro.config.alarm_alert=Alarm_Classic.ogg

PRODUCT_PACKAGES := \
    framework-res \
    Browser \
    CarHomeLauncher \
    Contacts \
    Home \
    HTMLViewer \
    Phone \
    ApplicationsProvider \
    ContactsProvider \
    DownloadProvider \
    MediaProvider \
    PicoTts \
    SettingsProvider \
    TelephonyProvider \
    TtsService \
    VpnServices \
    UserDictionaryProvider \
    PackageInstaller \
    DefaultContainerService \
    Bugreport

PRODUCT_PROPERTY_OVERRIDES += \
    media.stagefright.enable-player=true \
    media.stagefright.enable-meta=true   \
    media.stagefright.enable-scan=true   \
    media.stagefright.enable-http=true   \
    media.stagefright.enable-vorbis=true


# makefile for csrc/util directory

SCRIPTSRC = ccndstart.sh shebang
PROGRAMS = $(INSTALLED_PROGRAMS)
INSTALLED_PROGRAMS = ccndstart

default all: $(SCRIPTSRC) $(PROGRAMS)

ccndstart: ccndstart.sh
	./shebang $(SH) ccndstart.sh > ccndstart
	chmod +x ccndstart

clean:
	rm -f $(PROGRAMS)

Add a test target to stop make test from failing

# makefile for csrc/util directory

SCRIPTSRC = ccndstart.sh shebang
PROGRAMS = $(INSTALLED_PROGRAMS)
INSTALLED_PROGRAMS = ccndstart

default all: $(SCRIPTSRC) $(PROGRAMS)

ccndstart: ccndstart.sh
	./shebang $(SH) ccndstart.sh > ccndstart
	chmod +x ccndstart

clean:
	rm -f $(PROGRAMS)

test:
	@echo "Sorry, no libexec unit tests at this time"


# sinit version
VERSION = 0.9.2

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

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

Put sinit out of its misery and bump it up to 1.0

# sinit version
VERSION = 1.0

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

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


#
# 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.
#
ifneq ($(TARGET_SIMULATOR),true)
ifeq ($(BOARD_HAVE_BLUETOOTH),true)
  include $(all-subdir-makefiles)
endif
endif

Remove the simulator target from all makefiles. Bug: 5010576

#
# 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.
#
ifeq ($(BOARD_HAVE_BLUETOOTH),true)
  include $(all-subdir-makefiles)
endif


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

Move SDK version to 17

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 := 17

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


compilers/nqp/nqp.pbc : $(PARROT) $(NQP_SOURCES) \
    $(LIBRARY_DIR)/PCT.pbc \
    $(LIBRARY_DIR)/PGE.pbc

compilers/nqp/src/Grammar_gen.pir : $(PARROT) $(LIBRARY_DIR)/PGE/Perl6Grammar.pir compilers/nqp/src/Grammar.pg $(LIBRARY_DIR)/PCT/HLLCompiler.pbc
	$(PARROT) $(LIBRARY_DIR)/PGE/Perl6Grammar.pir --output=$@ compilers/nqp/src/Grammar.pg

# Developer target to regnerate bootstrap. Unused?
nqp-boot: \
    compilers/nqp/bootstrap/nqp.pir \
    compilers/nqp/bootstrap/gen_actions.pir

compilers/nqp/bootstrap/gen_actions.pir : $(PARROT) \
    compilers/nqp/nqp.pbc \
    compilers/nqp/bootstrap/actions.pm
	$(PARROT) compilers/nqp/nqp.pbc --output=$@ --target=pir \
	    compilers/nqp/bootstrap/actions.pm

compilers/nqp/bootstrap/nqp.pbc : $(LIBRARY)/PCT.pbc

Add a missing dep, note that checkdepend.pl doesn't correctly detect this case yet.

compilers/nqp/nqp.pbc : $(PARROT) $(NQP_SOURCES) \
    $(LIBRARY_DIR)/PCT.pbc \
    $(LIBRARY_DIR)/PGE.pbc

compilers/nqp/src/Grammar_gen.pir : $(PARROT) $(LIBRARY_DIR)/PGE/Perl6Grammar.pir compilers/nqp/src/Grammar.pg $(LIBRARY_DIR)/PCT/HLLCompiler.pbc $(LIBRARY_DIR)/PGE.pbc
	$(PARROT) $(LIBRARY_DIR)/PGE/Perl6Grammar.pir --output=$@ compilers/nqp/src/Grammar.pg

# Developer target to regnerate bootstrap. Unused?
nqp-boot: \
    compilers/nqp/bootstrap/nqp.pir \
    compilers/nqp/bootstrap/gen_actions.pir

compilers/nqp/bootstrap/gen_actions.pir : $(PARROT) \
    compilers/nqp/nqp.pbc \
    compilers/nqp/bootstrap/actions.pm
	$(PARROT) compilers/nqp/nqp.pbc --output=$@ --target=pir \
	    compilers/nqp/bootstrap/actions.pm

compilers/nqp/bootstrap/nqp.pbc : $(LIBRARY)/PCT.pbc


TARGET_ARCH=x86
DISABLE_DEXPREOPT := true
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 androidboot.console=tty0 verbose
BOARD_KERNEL_CMDLINE := init=/init console=tty0 console=ttyS0 androidboot.hardware=generic_x86 vga=788 androidboot.console=tty0 verbose
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

# The eth0 device should be started with dhcp on boot.
# Useful for emulators that don't provide a wifi connection.
NET_ETH0_STARTONBOOT := true

Use ext4 file system for generic_x86 userdata partition

TARGET_ARCH=x86
DISABLE_DEXPREOPT := true
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_EXT4 := 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 androidboot.console=tty0 verbose
BOARD_KERNEL_CMDLINE := init=/init console=tty0 console=ttyS0 androidboot.hardware=generic_x86 vga=788 androidboot.console=tty0 verbose
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
BOARD_USERDATAIMAGE_PARTITION_SIZE := 50M
BOARD_INSTALLERIMAGE_PARTITION_SIZE := 500M

# The eth0 device should be started with dhcp on boot.
# Useful for emulators that don't provide a wifi connection.
NET_ETH0_STARTONBOOT := true


#Architecture Settings
INTELARCH					= SSE4.2
CUDAVERSION					= 20
CUDAREGS					= 64
ARCHBITS					= 64

HIDEECHO					= @

CC_x86_64-pc-linux-gnu		= GCC
CC_i686-pc-cygwin			= ICC

INCLUDEPATHS				= include code base merger-ca cagpubuild
DEFINES						= HLTCA_STANDALONE BUILD_GPU

EXTRAFLAGSGCC				= -Weffc++

INTELFLAGSUSE				= $(INTELFLAGSDBG)
VSNETFLAGSUSE				= $(VSNETFLAGSOPT)
GCCFLAGSUSE					= $(GCCFLAGSOPT)
NVCCFLAGSUSE				= $(NVCCFLAGSOPT)

Improve GPU tracker standalone compile flags

#Architecture Settings
INTELARCH					= SSE4.2
CUDAVERSION					= 20
CUDAREGS					= 64
ARCHBITS					= 64

HIDEECHO					= @

CC_x86_64-pc-linux-gnu		= GCC
CC_i686-pc-cygwin			= ICC

INCLUDEPATHS				= include code base merger-ca cagpubuild
DEFINES						= HLTCA_STANDALONE BUILD_GPU

EXTRAFLAGSGCC				= -Weffc++

INTELFLAGSUSE				= $(INTELFLAGSOPT)
VSNETFLAGSUSE				= $(VSNETFLAGSOPT)
GCCFLAGSUSE					= $(GCCFLAGSOPT)
NVCCFLAGSUSE				= $(NVCCFLAGSOPT)


# top level project rules for the msm8960_virtio project
#
LOCAL_DIR := $(GET_LOCAL_DIR)

TARGET := msm8960

MODULES += app/aboot

DEBUG := 1

#DEFINES += WITH_DEBUG_DCC=1
DEFINES += WITH_DEBUG_UART=1
#DEFINES += WITH_DEBUG_FBCON=1

Enable debug logging to the display

# top level project rules for the msm8960_virtio project
#
LOCAL_DIR := $(GET_LOCAL_DIR)

TARGET := msm8960

MODULES += app/aboot

DEBUG := 1

#DEFINES += WITH_DEBUG_DCC=1
DEFINES += WITH_DEBUG_UART=1
DEFINES += WITH_DEBUG_FBCON=1


SRCS += \
	source/m2mbase.cpp \
	source/m2mconstants.cpp \
	source/m2mdevice.cpp \
        source/m2mfirmware.cpp \
	source/m2minterfacefactory.cpp \
	source/m2minterfaceimpl.cpp \
	source/m2mnsdlinterface.cpp \
        source/m2mobject.cpp \
	source/m2mobjectinstance.cpp \
	source/m2mreporthandler.cpp \
	source/m2mresource.cpp \
	source/m2mresourceinstance.cpp \
	source/m2msecurity.cpp \
	source/m2mserver.cpp \
	source/m2mstring.cpp \
	source/m2mtlvdeserializer.cpp \
	source/m2mtlvserializer.cpp \
	source/nsdlaccesshelper.cpp \
	source/m2mfirmware.cpp \
	../lwm2m-client-linux/source/m2mconnectionhandler.cpp \
	../lwm2m-client-linux/source/m2mconnectionhandlerpimpl.cpp \
	../lwm2m-client-linux/source/m2mtimer.cpp \
	../lwm2m-client-linux/source/m2mtimerpimpl.cpp \
	../lwm2m-client-linux/source/connthreadhelper.cpp \
	../lwm2m-client-linux/source/threadhelper.cpp \
        ../lwm2m-client-mbedtls/source/m2mconnectionsecurity.cpp \
        ../lwm2m-client-mbedtls/source/m2mconnectionsecuritypimpl.cpp \

Remove direct references to Linux platform implementations