CC              ?=cc
AR              ?=ar
RANLIB          ?=ranlib

CABAL           :=cabal
# IDRIS_ENABLE_STATS should not be set in final release
# Any flags defined here which alter the RTS API must also be added to src/IRTS/CodegenC.hs
CFLAGS          :=-O2 -Wall -DHAS_PTHREAD -DIDRIS_ENABLE_STATS $(CFLAGS)

#CABALFLAGS	:=
## Disable building of Effects
#CABALFLAGS :=-f NoEffects

ifneq (, $(findstring bsd, $(MACHINE)))
	GMP_INCLUDE_DIR      :=
else
	GMP_INCLUDE_DIR      :=-I/usr/local/include
endif

MACHINE         := $(shell $(CC) -dumpmachine)
ifneq (, $(findstring darwin, $(MACHINE)))
	OS      :=darwin
else ifneq (, $(findstring cygwin, $(MACHINE)))
	OS      :=windows
else ifneq (, $(findstring mingw, $(MACHINE)))
	OS      :=windows
else ifneq (, $(findstring windows, $(MACHINE)))
	OS      :=windows
else
	OS      :=unix
endif

ifeq ($(OS),darwin)
	SHLIB_SUFFIX    :=.dylib
else ifeq ($(OS),windows)
	SHLIB_SUFFIX    :=.DLL
else
	SHLIB_SUFFIX    :=.so
endif

Set C compiler properly on Windows

ifneq (, $(findstring MSYS, $(shell uname -a)))
	ifeq (cc,$(CC))
		# In MSYS2, when using the mingw version of gcc, there is no cc -> gcc
		# symlink. We can't use ?= here because CC is set implicitly to cc.
		# Cross compiling users can set CC to their cross compiler.
		CC		=gcc
	endif
endif

AR              ?=ar
RANLIB          ?=ranlib

CABAL           :=cabal
# IDRIS_ENABLE_STATS should not be set in final release
# Any flags defined here which alter the RTS API must also be added to src/IRTS/CodegenC.hs
CFLAGS          :=-O2 -Wall -DHAS_PTHREAD -DIDRIS_ENABLE_STATS $(CFLAGS)

#CABALFLAGS	:=
## Disable building of Effects
#CABALFLAGS :=-f NoEffects

ifneq (, $(findstring bsd, $(MACHINE)))
	GMP_INCLUDE_DIR      :=
else
	GMP_INCLUDE_DIR      :=-I/usr/local/include
endif

MACHINE         := $(shell $(CC) -dumpmachine)
ifneq (, $(findstring darwin, $(MACHINE)))
	OS      :=darwin
else ifneq (, $(findstring cygwin, $(MACHINE)))
	OS      :=windows
else ifneq (, $(findstring mingw, $(MACHINE)))
	OS      :=windows
else ifneq (, $(findstring windows, $(MACHINE)))
	OS      :=windows
else
	OS      :=unix
endif

ifeq ($(OS),darwin)
	SHLIB_SUFFIX    :=.dylib
else ifeq ($(OS),windows)
	SHLIB_SUFFIX    :=.DLL
else
	SHLIB_SUFFIX    :=.so
endif


VERSION = 1.0

PREFIX = /usr/local

DWARFINC =
DWARFLIB =

CFLAGS = -Wall -Werror -O2 -I${DWARFINC} -DATOSL_VERSION=\"${VERSION}\"
LDFLAGS = -L${DWARFLIB} -ldwarf -liberty

CC = cc

-include config.mk.local

Fix building with no DWARF variables defined

VERSION = 1.0

PREFIX = /usr/local

DWARFCFLAGS =
DWARFLDFLAGS =

CFLAGS = -Wall -Werror -O2 ${DWARFCFLAGS} -DATOSL_VERSION=\"${VERSION}\"
LDFLAGS = ${DWARFLDFLAGS} -ldwarf -liberty

CC = cc

-include config.mk.local


$(call setup-stamp-file,UFH_STAMP)

S1_RF_USR_STAMPS += $(UFH_STAMP)

$(call generate-stamp-rule,$(UFH_STAMP),,$(S1_RF_ACIROOTFSDIR), \
	$(call vb,v2,LN SF,host $(S1_RF_ACIROOTFSDIR)/flavor) \
	ln -sf 'host' "$(S1_RF_ACIROOTFSDIR)/flavor" && \
	mkdir -p "$(S1_RF_ACIROOTFSDIR)/usr/lib" && \
	ln -sf usr/lib "$(S1_RF_ACIROOTFSDIR)/lib" && \
	ln -sf usr/lib "$(S1_RF_ACIROOTFSDIR)/lib64"&& \
	ln -sf lib "$(S1_RF_ACIROOTFSDIR)/usr/lib64")

CLEAN_SYMLINKS += $(S1_RF_ACIROOTFSDIR)/flavor $(S1_RF_ACIROOTFSDIR)/lib $(S1_RF_ACIROOTFSDIR)/lib64 $(S1_RF_ACIROOTFSDIR)/usr/lib64

CLEAN_DIRS += $(S1_RF_ACIROOTFSDIR)/usr/lib

$(call undefine-namespaces,UFH)

Remove one level of lib

$(call setup-stamp-file,UFH_STAMP)

S1_RF_USR_STAMPS += $(UFH_STAMP)

$(call generate-stamp-rule,$(UFH_STAMP),,$(S1_RF_ACIROOTFSDIR), \
	$(call vb,v2,LN SF,host $(S1_RF_ACIROOTFSDIR)/flavor) \
	ln -sf 'host' "$(S1_RF_ACIROOTFSDIR)/flavor" && \
	mkdir -p "$(S1_RF_ACIROOTFSDIR)/usr/lib" && \
	mkdir -p "$(S1_RF_ACIROOTFSDIR)/usr/lib64" && \
	ln -sf usr/lib64 "$(S1_RF_ACIROOTFSDIR)/lib64" && \
	ln -sf usr/lib "$(S1_RF_ACIROOTFSDIR)/lib")

CLEAN_SYMLINKS += $(S1_RF_ACIROOTFSDIR)/flavor $(S1_RF_ACIROOTFSDIR)/lib64

CLEAN_DIRS += $(S1_RF_ACIROOTFSDIR)/usr/lib

$(call undefine-namespaces,UFH)


include build/platform-arch.mk
ifeq ($(ASM_ARCH), x86)
ifeq ($(ENABLE64BIT), Yes)
ASMFLAGS += -f win64
ASMFLAGS_PLATFORM = -DWIN64
CFLAGS += -DWIN64
else
ASMFLAGS += -f win32 -DPREFIX
CFLAGS += -DWIN32
endif
else
CFLAGS += -DWIN32
endif
ifeq ($(ASM_ARCH), arm)
CCAS = gas-preprocessor.pl -as-type armasm -force-thumb -- armasm
endif

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 -DNDEBUG
CFLAGS_DEBUG=-Od -Oy- -ZI -RTC1 -D_DEBUG
CFLAGS_M32=
CFLAGS_M64=
LINK_LIB=$(1).lib
LIBSUFFIX=lib
LIBPREFIX=
EXEEXT=.exe
OBJ=obj
SHAREDLIBSUFFIX=dll
SHARED=-LD
SHLDFLAGS=-link -def:wels.def -implib:wels_dll.lib
EXTRA_LIBRARY=wels_dll.lib

Use $(PROJECT_NAME) for naming the DLL import library as well

include build/platform-arch.mk
ifeq ($(ASM_ARCH), x86)
ifeq ($(ENABLE64BIT), Yes)
ASMFLAGS += -f win64
ASMFLAGS_PLATFORM = -DWIN64
CFLAGS += -DWIN64
else
ASMFLAGS += -f win32 -DPREFIX
CFLAGS += -DWIN32
endif
else
CFLAGS += -DWIN32
endif
ifeq ($(ASM_ARCH), arm)
CCAS = gas-preprocessor.pl -as-type armasm -force-thumb -- armasm
endif

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 -DNDEBUG
CFLAGS_DEBUG=-Od -Oy- -ZI -RTC1 -D_DEBUG
CFLAGS_M32=
CFLAGS_M64=
LINK_LIB=$(1).lib
LIBSUFFIX=lib
LIBPREFIX=
EXEEXT=.exe
OBJ=obj
SHAREDLIBSUFFIX=dll
SHARED=-LD
SHLDFLAGS=-link -def:wels.def -implib:$(PROJECT_NAME)_dll.lib
EXTRA_LIBRARY=$(PROJECT_NAME)_dll.lib


#
# 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 \
    ApplicationsProvider \
    ContactsProvider \
    DownloadProvider \
    MediaProvider \
    PicoTts \
    SettingsProvider \
    TelephonyProvider \
    TtsService \
    VpnServices \
    UserDictionaryProvider \
    PackageInstaller \
    DefaultContainerService \
    Bugreport

Add "ip" utility to all builds

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

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 \
    ApplicationsProvider \
    ContactsProvider \
    DownloadProvider \
    MediaProvider \
    PicoTts \
    SettingsProvider \
    TelephonyProvider \
    TtsService \
    VpnServices \
    UserDictionaryProvider \
    PackageInstaller \
    DefaultContainerService \
    Bugreport \
    ip


LOCAL_PATH := $(call my-dir)
PROJECT_ROOT_FROM_JNI:= ../../../..
PROJECT_ROOT:= $(call my-dir)/../../../..

include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on
OPENCV_CAMERA_MODULES:=off
OPENCV_LIB_TYPE:=STATIC

include /home/intermodalics/TangoApps/TangoxRos/OpenCV_sdk_native/jni/OpenCV.mk
LOCAL_MODULE    := tango_ros_native
LOCAL_SRC_FILES := tango_ros_node.cc tango_ros_util.cc jni_interface.cc
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
LOCAL_CFLAGS  += -g3 -ggdb --std=c++0x
LOCAL_LDLIBS += -landroid
LOCAL_STATIC_LIBRARIES += roscpp_android_ndk
LOCAL_SHARED_LIBRARIES := tango_client_api tango_support_api
include $(BUILD_SHARED_LIBRARY)

$(call import-add-path, $(PROJECT_ROOT))
$(call import-module,roscpp_android_ndk)
$(call import-module,tango_client_api)
$(call import-module,tango_support_api)

Use relative path to opencv sdk instead of absolute path

LOCAL_PATH := $(call my-dir)
PROJECT_ROOT_FROM_JNI:= ../../../..
PROJECT_ROOT:= $(call my-dir)/../../../..

include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on
OPENCV_CAMERA_MODULES:=off
OPENCV_LIB_TYPE:=STATIC

include $(PROJECT_ROOT)/OpenCV_sdk_native/jni/OpenCV.mk
LOCAL_MODULE    := tango_ros_native
LOCAL_SRC_FILES := tango_ros_node.cc tango_ros_util.cc jni_interface.cc
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
LOCAL_CFLAGS  += -g3 -ggdb --std=c++0x
LOCAL_LDLIBS += -landroid
LOCAL_STATIC_LIBRARIES += roscpp_android_ndk
LOCAL_SHARED_LIBRARIES := tango_client_api tango_support_api
include $(BUILD_SHARED_LIBRARY)

$(call import-add-path, $(PROJECT_ROOT))
$(call import-module,roscpp_android_ndk)
$(call import-module,tango_client_api)
$(call import-module,tango_support_api)


#
#
#

all: dummy
	(cd $(PROJECT_DIR) ; \
	 mkdir -p $(DOCUMENT_DIR) ; \
	 jazzy -o $(DOCUMENT_DIR) \
	   --author "Steel Wheels Project" \
	   --author_url "https://sites.google.com/site/steelwheelsproject/" \
	   --readme $(README_FILE) \
	   --module $(MODULE_NAME) \
	   --github_url https://github.com/steelwheels/$(GITHUB_NAME) \
	)

dummy:

Update script to generate document

#
#
#

all: dummy
	(cd $(PROJECT_DIR) ; \
	 mkdir -p $(DOCUMENT_DIR) ; \
	 jazzy -o $(DOCUMENT_DIR) \
	   --author "Steel Wheels Project" \
	   --author_url "http://steelwheels.github.io/" \
	   --readme $(README_FILE) \
	   --module $(MODULE_NAME) \
	   --github_url https://github.com/steelwheels/$(GITHUB_NAME) \
	)

dummy:


WITH_MRDOC ?= 1

ifdef WITH_MRDOC
  include $(__JAREDHANSON_MAKE_NODE_DIR)/lib/docs/mr-doc.mk
endif

Improve selection of doc implementation.

__docimpl = jsdoc mr-doc
__docbin = $(firstword $(filter $(__docimpl),$(WITH) $(notdir $(shell which $(__docimpl)))))

ifeq (jsdoc,$(__docbin))
#$(info Using JSDoc for 'doc'.)
include $(__JAREDHANSON_MAKE_NODE_DIR)/lib/docs/jsdoc.mk
else ifeq (mr-doc,$(__docbin))
#$(info Using Mr. Doc for 'doc'.)
include $(__JAREDHANSON_MAKE_NODE_DIR)/lib/docs/mr-doc.mk
endif


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

libraries/integer-gmp/mkGmpDerivedConstants_dist_C_SRCS          = mkGmpDerivedConstants.c
libraries/integer-gmp/mkGmpDerivedConstants_dist_PROGNAME        = mkGmpDerivedConstants
libraries/integer-gmp/mkGmpDerivedConstants_dist_TOPDIR          = YES
libraries/integer-gmp/mkGmpDerivedConstants_dist_INSTALL         = YES
libraries/integer-gmp/mkGmpDerivedConstants_dist_INSTALL_INPLACE = YES
libraries/integer-gmp/mkGmpDerivedConstants_dist_EXTRA_CC_OPTS += $(gmp_CC_OPTS)

$(eval $(call build-prog,libraries/integer-gmp/mkGmpDerivedConstants,dist,1))

GmpDerivedConstants_HEADER = libraries/integer-gmp/mkGmpDerivedConstants/dist/GmpDerivedConstants.h

$(GmpDerivedConstants_HEADER): $(mkGmpDerivedConstants_INPLACE)
	$< > $@

Fix build when gmp isn't installed

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

libraries/integer-gmp/mkGmpDerivedConstants_dist_C_SRCS          = mkGmpDerivedConstants.c
libraries/integer-gmp/mkGmpDerivedConstants_dist_PROGNAME        = mkGmpDerivedConstants
libraries/integer-gmp/mkGmpDerivedConstants_dist_TOPDIR          = YES
libraries/integer-gmp/mkGmpDerivedConstants_dist_INSTALL         = YES
libraries/integer-gmp/mkGmpDerivedConstants_dist_INSTALL_INPLACE = YES
libraries/integer-gmp/mkGmpDerivedConstants_dist_EXTRA_CC_OPTS += $(gmp_CC_OPTS)

$(eval $(call build-prog,libraries/integer-gmp/mkGmpDerivedConstants,dist,1))

GmpDerivedConstants_HEADER = libraries/integer-gmp/mkGmpDerivedConstants/dist/GmpDerivedConstants.h

$(GmpDerivedConstants_HEADER): $(mkGmpDerivedConstants_INPLACE)
	$< > $@

ifneq "$(HaveLibGmp)" "YES"
ifneq "$(HaveFrameworkGMP)" "YES"
$(libraries/integer-gmp/mkGmpDerivedConstants_dist_depfile_c_asm): libraries/integer-gmp/gmp/gmp.h
endif
endif


# This file is part of the HörTech Open Master Hearing Aid (openMHA)
# Copyright © 2013 2014 2016 HörTech gGmbH
#
# openMHA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# openMHA 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.  See the
# GNU Affero General Public License, version 3 for more details.
#
# You should have received a copy of the GNU Affero General Public License,
# version 3 along with openMHA.  If not, see <http://www.gnu.org/licenses/>.

# This file is part of the build system of the the MHA.  In the open
# source version of the MHA, this file exists, but is empty.  It
# should not be removed.

# Local Variables:
# coding: utf-8-unix
# End:

Fix copyright years: These files have been modified earlier this year.

# This file is part of the HörTech Open Master Hearing Aid (openMHA)
# Copyright © 2013 2014 2016 2017 HörTech gGmbH
#
# openMHA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# openMHA 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.  See the
# GNU Affero General Public License, version 3 for more details.
#
# You should have received a copy of the GNU Affero General Public License,
# version 3 along with openMHA.  If not, see <http://www.gnu.org/licenses/>.

# This file is part of the build system of the the MHA.  In the open
# source version of the MHA, this file exists, but is empty.  It
# should not be removed.

# Local Variables:
# coding: utf-8-unix
# End:


# arty targets

ifneq ($(PLATFORM),arty)
	$(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=$(TARGET_BUILD_DIR)/software/firmware/firmware.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

Support "make firmware-load" for F=micropython

# arty targets

ifneq ($(PLATFORM),arty)
	$(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


# Tell Android where to locate source files
# "my-dir" is a macro function which will return the path of the current directory (where Android.mk resides)
LOCAL_PATH := $(call my-dir)

# Clear contents of the LOCAL_* variables
include $(CLEAR_VARS)

# All the source files to include in this module
LOCAL_SRC_FILES := ../../core/tangram.cpp $(wildcard $(LOCAL_PATH)/../../core/util/*.cpp) jniExports.cpp platform_android.cpp

# The name of the module
LOCAL_MODULE := tangram

# Compilation flags
LOCAL_CFLAGS := -Werror -DPLATFORM_ANDROID

LOCAL_C_INCLUDES := $(LOCAL_PATH)/include-all ../../core/

# Static libraries to link with
LOCAL_LDLIBS := -llog -lGLESv2

# Build the module
include $(BUILD_SHARED_LIBRARY)

Fix merge by adding core/include to android project includes

# Tell Android where to locate source files
# "my-dir" is a macro function which will return the path of the current directory (where Android.mk resides)
LOCAL_PATH := $(call my-dir)

# Clear contents of the LOCAL_* variables
include $(CLEAR_VARS)

# All the source files to include in this module
LOCAL_SRC_FILES := ../../core/tangram.cpp $(wildcard $(LOCAL_PATH)/../../core/util/*.cpp) jniExports.cpp platform_android.cpp

# The name of the module
LOCAL_MODULE := tangram

# Compilation flags
LOCAL_CFLAGS := -Werror -DPLATFORM_ANDROID

LOCAL_C_INCLUDES := $(LOCAL_PATH)/include-all ../../core/ ../../core/include/

# Static libraries to link with
LOCAL_LDLIBS := -llog -lGLESv2

# Build the module
include $(BUILD_SHARED_LIBRARY)


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

Remove more linker options invalid on Clang

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


# 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

Append the list of languages to the list of locales

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

$(call inherit-product, build/target/product/languages_full.mk)


# example of local configuration
# copy to local.mk

# location of source
TOPDIR:=..

LTO:=n
ASAN:=n
TSAN:=n
UBSAN:=n

USE_GLEW:=n
PRELOAD_FILES:=fxaa3_11.h cube.frag cube.vert smaa.h utils.h

# compiler options etc
CC:=emcc
CXX:=em++
CFLAGS:=-g -Wall -Wextra -Werror -Wshadow
CFLAGS+=-Wno-unused-local-typedefs
OPTFLAGS:=-O3

# lazy assignment because CFLAGS is changed later
CXXFLAGS=$(CFLAGS)
CXXFLAGS+=-std=c++11

LDFLAGS:=-g
LDFLAGS+=-s TOTAL_MEMORY=67108864
LDFLAGS+=-s OUTLINING_LIMIT=5000
LDLIBS:=

LTOCFLAGS:=--llvm-lto 3
LTOLDFLAGS:=--llvm-lto 3

OBJSUFFIX:=.o
EXESUFFIX:=.js

Drop cube shaders from packaging

# example of local configuration
# copy to local.mk

# location of source
TOPDIR:=..

LTO:=n
ASAN:=n
TSAN:=n
UBSAN:=n

USE_GLEW:=n
PRELOAD_FILES:=fxaa3_11.h smaa.h utils.h

# compiler options etc
CC:=emcc
CXX:=em++
CFLAGS:=-g -Wall -Wextra -Werror -Wshadow
CFLAGS+=-Wno-unused-local-typedefs
OPTFLAGS:=-O3

# lazy assignment because CFLAGS is changed later
CXXFLAGS=$(CFLAGS)
CXXFLAGS+=-std=c++11

LDFLAGS:=-g
LDFLAGS+=-s TOTAL_MEMORY=67108864
LDFLAGS+=-s OUTLINING_LIMIT=5000
LDLIBS:=

LTOCFLAGS:=--llvm-lto 3
LTOLDFLAGS:=--llvm-lto 3

OBJSUFFIX:=.o
EXESUFFIX:=.js


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

Use -DPREFIX instead of --prefix _ on OS X

include build/platform-arch.mk
SHAREDLIBSUFFIX = dylib
SHARED = -dynamiclib
CFLAGS += -Werror -fPIC -DMACOS -DMT_ENABLED -MMD -MP
LDFLAGS += -lpthread
ifeq ($(ASM_ARCH), x86)
ASMFLAGS += -DPREFIX
ifeq ($(ENABLE64BIT), Yes)
ASMFLAGS += -f macho64
else
ASMFLAGS += -f macho
LDFLAGS += -read_only_relocs suppress
endif
endif


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/nest/p9_throttle_sync.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_throttle_sync
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/memory/)
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/memory/lib)
$(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/nest/p9_throttle_sync.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_throttle_sync
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/memory/)
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/generic/memory)
$(call BUILD_PROCEDURE)


SKIP_SQUASH?=0

build = hack/build.sh

ifeq ($(TARGET),rhel7)
	OS := rhel7
else
	OS := centos7
endif

script_env = \
	SKIP_SQUASH=$(SKIP_SQUASH)                      \
	UPDATE_BASE=$(UPDATE_BASE)                      \
	VERSIONS="$(VERSIONS)"                          \
	OS=$(OS)                                        \
	VERSION=$(VERSION)                              \
	BASE_IMAGE_NAME=$(BASE_IMAGE_NAME)              \
	OPENSHIFT_NAMESPACES="$(OPENSHIFT_NAMESPACES)"

.PHONY: build
build:
	$(script_env) $(build)

.PHONY: test
test:
	$(script_env) TAG_ON_SUCCESS=$(TAG_ON_SUCCESS) TEST_MODE=true $(build)

Fix selecting versions to build

SKIP_SQUASH?=0

build = hack/build.sh

ifeq ($(TARGET),rhel7)
	OS := rhel7
else
	OS := centos7
endif

script_env = \
	SKIP_SQUASH=$(SKIP_SQUASH)                      \
	UPDATE_BASE=$(UPDATE_BASE)                      \
	VERSIONS="$(VERSIONS)"                          \
	OS=$(OS)                                        \
	VERSION="$(VERSION)"                            \
	BASE_IMAGE_NAME=$(BASE_IMAGE_NAME)              \
	OPENSHIFT_NAMESPACES="$(OPENSHIFT_NAMESPACES)"

.PHONY: build
build:
	$(script_env) $(build)

.PHONY: test
test:
	$(script_env) TAG_ON_SUCCESS=$(TAG_ON_SUCCESS) TEST_MODE=true $(build)


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


# opsis loading

TARGET ?= video

gateware-load-opsis: tftp
	opsis-mode-switch --verbose --load-gateware $(TARGET_BUILD_DIR)/gateware/top.bit

firmware-load-opsis:
	opsis-mode-switch --verbose --mode=serial
	flterm --port=/dev/hdmi2usb/by-num/opsis0/tty --kernel=$(TARGET_BUILD_DIR)/software/firmware/firmware.bin

reset-opsis:
	opsis-mode-switch --verbose --mode=serial
	opsis-mode-switch --verbose --mode=jtag
	opsis-mode-switch --verbose --mode=serial

flash-opsis:
	opsis-mode-switch --verbose --flash-gateware=$(TARGET_BUILD_DIR)/gateware/top.bin
	opsis-mode-switch --verbose --flash-lm32-firmware=$(TARGET_BUILD_DIR)/software/firmware/firmware.fbi

.PHONY: gateware-load-opsis firmware-load-opsis reset-opsis flash-opsis

Use modeswitch for getting serial device on Opsis.

# opsis loading

TARGET ?= video

gateware-load-opsis: tftp
	opsis-mode-switch --verbose --load-gateware $(TARGET_BUILD_DIR)/gateware/top.bit

firmware-load-opsis:
	opsis-mode-switch --verbose --mode=serial
	flterm --port=$$(opsis-mode-switch --get-serial-dev) --kernel=$(TARGET_BUILD_DIR)/software/firmware/firmware.bin

reset-opsis:
	opsis-mode-switch --verbose --mode=serial
	opsis-mode-switch --verbose --mode=jtag
	opsis-mode-switch --verbose --mode=serial

flash-opsis:
	opsis-mode-switch --verbose --flash-gateware=$(TARGET_BUILD_DIR)/gateware/top.bin
	opsis-mode-switch --verbose --flash-lm32-firmware=$(TARGET_BUILD_DIR)/software/firmware/firmware.fbi

.PHONY: gateware-load-opsis firmware-load-opsis reset-opsis flash-opsis


ifeq ($(OS),Darwin)
CFLAGS_ARCH += -mmacosx-version-min=10.7
endif

CFLAGS_PTHREAD += -pthread
CFLAGS_GENERAL += -Wextra -ansi -pedantic -Wno-long-long

ifneq ($(TIGHTDB_OBJC_INCLUDEDIR),)
PROJECT_CFLAGS = -I$(TIGHTDB_OBJC_INCLUDEDIR)
endif

ifneq ($(TIGHTDB_OBJC_LIBDIR),)
PROJECT_CFLAGS = -L$(TIGHTDB_OBJC_LIBDIR) -Wl,-rpath,$(TIGHTDB_OBJC_LIBDIR)
endif

Fix for: Upgraded to support new build process

ifeq ($(OS),Darwin)
CFLAGS_ARCH += -mmacosx-version-min=10.7
endif

CFLAGS_PTHREAD += -pthread
CFLAGS_GENERAL += -Wextra -ansi -pedantic -Wno-long-long

ifneq ($(TIGHTDB_OBJC_INCLUDEDIR),)
PROJECT_CFLAGS = -I$(TIGHTDB_OBJC_INCLUDEDIR)
endif

ifneq ($(TIGHTDB_OBJC_LIBDIR),)
PROJECT_LDFLAGS = -L$(TIGHTDB_OBJC_LIBDIR) -Wl,-rpath,$(TIGHTDB_OBJC_LIBDIR)
endif


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

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

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

endif # ifndef GOOGLE_BENCHMARK_MK

Add linkage flag and fix indentation 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 .. && make

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

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

endif # ifndef GOOGLE_BENCHMARK_MK


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

Fix coding style checks for out-of-tree builds

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


USB_VID = 0x04D8
USB_PID = 0xEC63
USB_PRODUCT = "CircuitBrains Basic"
USB_MANUFACTURER = "Kevin Neubauer"

CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q32JV_IQ"
LONGINT_IMPL = MPZ

CIRCUITPY_BITBANGIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_VECTORIO = 0

Use optimization flags to let ja translation fit

USB_VID = 0x04D8
USB_PID = 0xEC63
USB_PRODUCT = "CircuitBrains Basic"
USB_MANUFACTURER = "Kevin Neubauer"

CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q32JV_IQ"
LONGINT_IMPL = MPZ

CIRCUITPY_BITBANGIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_VECTORIO = 0

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


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

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

LOCAL_MODULE_TAGS := user development eng
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME := TSCalibration2
LOCAL_OVERRIDES_PACKAGES := TSCalibration
LOCAL_CERTIFICATE := platform
include $(BUILD_PACKAGE)

Remove development and eng tag from LOCAL_MODULE_TAGS

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

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

LOCAL_MODULE_TAGS := user
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME := TSCalibration2
LOCAL_OVERRIDES_PACKAGES := TSCalibration
LOCAL_CERTIFICATE := platform
include $(BUILD_PACKAGE)


SOURCE_ROOT = src
INSTALL_DEBUG_PROGS = 1

# Construct fat binaries on Darwin when using Clang
ifneq ($(TIGHTDB_ENABLE_FAT_BINARIES),)
ifneq ($(call CC_CXX_AND_LD_ARE,clang),)
ifeq ($(shell uname),Darwin)
CFLAGS_DEFAULT  += -arch i386 -arch x86_64
LDFLAGS_DEFAULT += -arch i386 -arch x86_64
endif
endif
endif

ifneq ($(CC_CXX_AND_LD_ARE_GCC_LIKE),)
CFLAGS_DEFAULT += -Wextra -ansi -pedantic -Wno-long-long
# FIXME: '-fno-elide-constructors' currently causes TightDB to fail
#CFLAGS_DEBUG   += -fno-elide-constructors
CFLAGS_PTHREAD += -pthread
endif

ifeq ($(TIGHTDB_DISABLE_SSE),)
CFLAGS_DEFAULT += -msse4.2 -DUSE_SSE42
endif

ifneq ($(TIGHTDB_ENABLE_REPLICATION),)
CFLAGS_DEFAULT += -DTIGHTDB_ENABLE_REPLICATION
endif

CFLAGS_DEBUG += -DTIGHTDB_DEBUG -DMAX_LIST_SIZE=4
CFLAGS_COVER += -DTIGHTDB_DEBUG -DMAX_LIST_SIZE=4

Fix for: Minor update of generic.mk: Allow CFLAGS to be specified for each library and program

SOURCE_ROOT = src
INSTALL_DEBUG_PROGS = 1

# Construct fat binaries on Darwin when using Clang
ifneq ($(TIGHTDB_ENABLE_FAT_BINARIES),)
ifneq ($(call CC_CXX_AND_LD_ARE,clang),)
ifeq ($(shell uname),Darwin)
CFLAGS_DEFAULT  += -arch i386 -arch x86_64
LDFLAGS_DEFAULT += -arch i386 -arch x86_64
endif
endif
endif

CFLAGS_DEFAULT += -Wextra -ansi -pedantic -Wno-long-long
# FIXME: '-fno-elide-constructors' currently causes TightDB to fail
#CFLAGS_DEBUG   += -fno-elide-constructors
CFLAGS_PTHREAD += -pthread

ifeq ($(TIGHTDB_DISABLE_SSE),)
CFLAGS_DEFAULT += -msse4.2 -DUSE_SSE42
endif

ifneq ($(TIGHTDB_ENABLE_REPLICATION),)
CFLAGS_DEFAULT += -DTIGHTDB_ENABLE_REPLICATION
endif

CFLAGS_DEBUG += -DTIGHTDB_DEBUG -DMAX_LIST_SIZE=4
CFLAGS_COVER += -DTIGHTDB_DEBUG -DMAX_LIST_SIZE=4


# The Mordax Microkernel OS
# (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com>
# Report bugs and issues on <http://github.com/skordal/mordax/issues>

# ARMv7 build configuration.

# Target prefix:
TARGET_PREFIX  ?= arm-none-eabi

# Target-dependent build tools:
export TARGET_CC      ?= $(TARGET_PREFIX)-gcc
export TARGET_LD      ?= $(TARGET_PREFIX)-ld
export TARGET_AR      ?= $(TARGET_PREFIX)-ar
export TARGET_OBJCOPY ?= $(TARGET_PREFIX)-objcopy

# Target-dependent build flags:
export TARGET_ASFLAGS  += -mno-unaligned-access
export TARGET_CFLAGS   += -mno-unaligned-access
export TARGET_LDFLAGS  +=

Add -mcpu flag to the toplevel ARM CFLAGS

# The Mordax Microkernel OS
# (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com>
# Report bugs and issues on <http://github.com/skordal/mordax/issues>

# ARMv7 build configuration.

# Target prefix:
TARGET_PREFIX  ?= arm-none-eabi
TARGET_CFLAGS  += -mcpu=cortex-a8

# Target-dependent build tools:
export TARGET_CC      ?= $(TARGET_PREFIX)-gcc
export TARGET_LD      ?= $(TARGET_PREFIX)-ld
export TARGET_AR      ?= $(TARGET_PREFIX)-ar
export TARGET_OBJCOPY ?= $(TARGET_PREFIX)-objcopy

# Target-dependent build flags:
export TARGET_ASFLAGS  += -mno-unaligned-access
export TARGET_CFLAGS   += -mno-unaligned-access
export TARGET_LDFLAGS  +=


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 -u LDSHARED
ENV += LD= CPP= NM= CC= RANLIB= CXX= AR= STRIP= OBJDUM= CFLAGS= CPPFLAGS= LDFLAGS= CXXFLAGS= READELF= AS= OBJDUMP=
ENV += INSTALL_PREFIX=$(INSTALL_PREFIX)

Allow to use NATIVE_* flags in native builds

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 -u LDSHARED
ENV += LD= CPP= NM= CC= RANLIB= CXX= AR= STRIP= OBJDUM= CFLAGS="$(NATIVE_CFLAGS)" CPPFLAGS="$(NATIVE_CPPFLAGS)" LDFLAGS="$(NATIVE_LDFLAGS)" CXXFLAGS="$(NATIVE_CXXFLAGS)" READELF= AS= OBJDUMP=
ENV += INSTALL_PREFIX=$(INSTALL_PREFIX)


packages:=boost openssl libevent zeromq
native_packages := native_ccache

qt_native_packages = native_protobuf
qt_packages = qrencode protobuf zlib

qt_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans libseccomp libcap attr
#qt_i686_linux_packages:=$(qt_x86_64_linux_packages)

qt_darwin_packages=qt
qt_mingw32_packages=qt

wallet_packages=bdb

upnp_packages=miniupnpc

darwin_native_packages = native_biplist native_ds_store native_mac_alias

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

Move Linux Tor depends away from QT

packages:=boost openssl libevent zeromq
native_packages := native_ccache

qt_native_packages = native_protobuf
qt_packages = qrencode protobuf zlib

linux_packages:=libseccomp libcap attr

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

qt_darwin_packages=qt
qt_mingw32_packages=qt

wallet_packages=bdb

upnp_packages=miniupnpc

darwin_native_packages = native_biplist native_ds_store native_mac_alias

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


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

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

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

LOCAL_MODULE := hamcrest-host

LOCAL_MODULE_TAGS := optional

include $(BUILD_HOST_JAVA_LIBRARY)

#-------------------------------
# build a target jar

include $(CLEAR_VARS)

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

LOCAL_MODULE := hamcrest

LOCAL_MODULE_TAGS := optional

include $(BUILD_STATIC_JAVA_LIBRARY)

Build hamcrest against the SDK.

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

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

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

LOCAL_MODULE := hamcrest-host

LOCAL_MODULE_TAGS := optional

include $(BUILD_HOST_JAVA_LIBRARY)

#-------------------------------
# build a target jar

include $(CLEAR_VARS)

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

LOCAL_MODULE := hamcrest

LOCAL_SDK_VERSION := 4

LOCAL_MODULE_TAGS := optional

include $(BUILD_STATIC_JAVA_LIBRARY)


## -*- coding: utf-8 -*-
<%inherit file="netprofile:templates/ddl_trigger.mak"/>\
<%block name="sql">\
	IF (@stashio_ignore IS NULL) OR (@stashio_ignore <> 1) THEN
		INSERT INTO `stashes_ops` (`stashid`, `type`, `ts`, `operator`, `diff`, `comments`)
		VALUES (NEW.stashid, 'oper', NEW.ts, IF(@accessuid > 0, @accessuid, NULL), NEW.diff, CONCAT('sio:', NEW.sioid, '|'));
	END IF;
</%block>

Simplify after-insert trigger for stashes_io_def

## -*- coding: utf-8 -*-
<%inherit file="netprofile:templates/ddl_trigger.mak"/>\
<%block name="sql">\
	IF (@stashio_ignore IS NULL) OR (@stashio_ignore <> 1) THEN
		INSERT INTO `stashes_ops` (`stashid`, `type`, `ts`, `operator`, `diff`, `comments`)
		VALUES (NEW.stashid, 'oper', NEW.ts, NEW.uid, NEW.diff, CONCAT('sio:', NEW.sioid, '|'));
	END IF;
</%block>


$(call assert-variable,iso.path)

/:=$(BUILD_DIR)/test/

$/%: /:=$/

test: test-integration

clean: $/clean-integration-test-cache-file

.PHONY: $/clean-integration-test-cache-file
$/clean-integration-test-environment:
	test -f $/environment-id && \
		python test/integration.py -l INFO --cache-file $(abspath $/environment-id) destroy

.PHONY: test-integration
test-integration: $/environment-id
	python test/integration.py -l INFO --cache-file $(abspath $<) --iso $(abspath $(iso.path)) test

$/environment-id: | $(iso.path)
	@mkdir -p $(@D)
	python test/integration.py -l INFO --cache-file $(abspath $@) destroy
	python test/integration.py -l INFO --cache-file $(abspath $@) --iso $(abspath $(iso.path)) setup

ifdef FORCE_INTEGRATION_ENVIRONMENT
$/environment-id: FORCE
endif

Fix clean to remove broken environments also

$(call assert-variable,iso.path)

/:=$(BUILD_DIR)/test/

$/%: /:=$/

test: test-integration

clean: $/clean-integration-test-cache-file

.PHONY: $/clean-integration-test-cache-file
$/clean-integration-test-environment:
	test -f $/environment-id.candidate && \
		python test/integration.py -l INFO --cache-file $(abspath $/environment-id.candidate) destroy
	test -f $/environment-id && \
		python test/integration.py -l INFO --cache-file $(abspath $/environment-id) destroy

.PHONY: test-integration
test-integration: $/environment-id
	python test/integration.py -l INFO --cache-file $(abspath $<) --iso $(abspath $(iso.path)) test

$/environment-id: | $(iso.path)
	@mkdir -p $(@D)
	python test/integration.py -l INFO --cache-file $(abspath $@) destroy
	python test/integration.py -l INFO --cache-file $(abspath $@) --iso $(abspath $(iso.path)) setup

ifdef FORCE_INTEGRATION_ENVIRONMENT
$/environment-id: FORCE
endif


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

# In dist tarballs, the version is stored in the VERSION files.
VERSION := '$(shell [ -f VERSION ] && cat VERSION)'
ifeq ('',$(VERSION))
VERSION := $(shell git describe)
endif

# Xinerama, comment if you don't want it
XINERAMALIBS  = -lXinerama
XINERAMAFLAGS = -DXINERAMA

# uncomment to disable parsing of dunstrc
# or use "CFLAGS=-DSTATIC_CONFIG make" to build
#STATIC= -DSTATIC_CONFIG

# inih flags
INIFLAGS = -DINI_ALLOW_MULTILINE=0

# includes and libs
INCS = $(shell pkg-config --cflags dbus-1 libxdg-basedir x11 freetype2 xext xft xscrnsaver)
LIBS = -lm -L${X11LIB} -lXss ${XINERAMALIBS} $(shell pkg-config --libs dbus-1 libxdg-basedir x11 freetype2 xext xft xscrnsaver)

# flags
CPPFLAGS += -D_BSD_SOURCE -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} ${INIFLAGS}
CFLAGS   += -g --std=c99 -pedantic -Wall -Wno-overlength-strings -Os ${INCS} ${STATIC} ${CPPFLAGS} ${EXTRACFLAGS}
LDFLAGS  += ${LIBS}

Allow prefix to be set on the make line.. make PREFIX=<path>

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

# In dist tarballs, the version is stored in the VERSION files.
VERSION := '$(shell [ -f VERSION ] && cat VERSION)'
ifeq ('',$(VERSION))
VERSION := $(shell git describe)
endif

# Xinerama, comment if you don't want it
XINERAMALIBS  = -lXinerama
XINERAMAFLAGS = -DXINERAMA

# uncomment to disable parsing of dunstrc
# or use "CFLAGS=-DSTATIC_CONFIG make" to build
#STATIC= -DSTATIC_CONFIG

# inih flags
INIFLAGS = -DINI_ALLOW_MULTILINE=0

# includes and libs
INCS = $(shell pkg-config --cflags dbus-1 libxdg-basedir x11 freetype2 xext xft xscrnsaver)
LIBS = -lm -L${X11LIB} -lXss ${XINERAMALIBS} $(shell pkg-config --libs dbus-1 libxdg-basedir x11 freetype2 xext xft xscrnsaver)

# flags
CPPFLAGS += -D_BSD_SOURCE -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} ${INIFLAGS}
CFLAGS   += -g --std=c99 -pedantic -Wall -Wno-overlength-strings -Os ${INCS} ${STATIC} ${CPPFLAGS} ${EXTRACFLAGS}
LDFLAGS  += ${LIBS}


NAME = dwmstatus
VERSION = 1.1

# Customize below to fit your system

DEBUGFLAGS=
#DEBUGFLAGS=-g

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

# includes and libs
INCS = -I. -I/usr/include
LIBS = -L/usr/lib -lc -lX11 -lm

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

# compiler and linker
CC = cc

# Conditional stuff

ifdef NO_PULSE
	CFLAGS  += -DNO_PULSE=1
else
	LIBS += -lpulse
endif

ifdef NO_MPD
	CFLAGS  += -DNO_MPD=1
else
	LIBS += -lmpdclient
endif

ifdef NO_WIRELESS
	CFLAGS  += -DNO_WIRELESS=1
else
	LIBS += -liw
endif

Allow specifying network devices from commandline

NAME = dwmstatus
VERSION = 1.1

# Customize below to fit your system

DEBUGFLAGS=
#DEBUGFLAGS=-g

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

# includes and libs
INCS = -I. -I/usr/include
LIBS = -L/usr/lib -lc -lX11 -lm

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

# compiler and linker
CC = cc

# Conditional stuff

ifdef NO_PULSE
	CFLAGS  += -DNO_PULSE=1
else
	LIBS += -lpulse
endif

ifdef NO_MPD
	CFLAGS  += -DNO_MPD=1
else
	LIBS += -lmpdclient
endif

ifdef NO_WIRELESS
	CFLAGS  += -DNO_WIRELESS=1
else
	LIBS += -liw
endif

ifdef WIRELESS_DEV
	CFLAGS  += -DWIRELESS_DEV="${WIRELESS_DEV}"
endif

ifdef WIRED_DEV
	CFLAGS  += -DWIRED_DEV="${WIRED_DEV}"
endif

ifdef BONDED_DEV
	CFLAGS  += -DBONDED_DEV="${BONDED_DEV}"
endif


LIBS_SUBDIRS = libmainloop

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

ifeq ($(shell ls $(TOPDIR)/libtu/obj.h 2>/dev/null),)

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

else

#In-tree libtu
LIBS_SUBDIRS += libtu

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

endif

ifeq ($(shell ls $(TOPDIR)/libextl/luaextl.h 2>/dev/null),)

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

MKEXPORTS = libextl-mkexports

else

#In-tree libextl
LIBS_SUBDIRS += libextl

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

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

endif

Use $(wildcard ...) instead of $(shell ...).

LIBS_SUBDIRS = libmainloop

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

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

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

else

#In-tree libtu
LIBS_SUBDIRS += libtu

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

endif

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

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

MKEXPORTS = libextl-mkexports

else

#In-tree libextl
LIBS_SUBDIRS += libextl

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

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

endif


USB_VID = 0x239A
USB_PID = 0x80CA
USB_PRODUCT = "Matrix Portal M4"
USB_MANUFACTURER = "Adafruit Industries LLC"

CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51

QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ESP32SPI
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Display_Text
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_FakeRequests

Remove DisplayText Frozen Lib from MatrixPortal saving about 60K

USB_VID = 0x239A
USB_PID = 0x80CA
USB_PRODUCT = "Matrix Portal M4"
USB_MANUFACTURER = "Adafruit Industries LLC"

CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51

QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ESP32SPI
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_FakeRequests


###############################################################################
# BRLTTY - A background process providing access to the Linux console (when in
#          text mode) for a blind person using a refreshable braille display.
#
# Copyright (C) 1995-2003 by The BRLTTY Team. All rights reserved.
#
# BRLTTY comes with ABSOLUTELY NO WARRANTY.
#
# This is free software, placed under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation.  Please see the file COPYING for details.
#
# Web Page: http://mielke.cc/brltty/
#
# This software is maintained by Dave Mielke <dave@mielke.cc>.
###############################################################################

default: all

include $(SRC_TOP)absdeps.mk
include $(SRC_DIR)/reldeps.mk

clean::
	-rm -f *.$O *.auto.h core

distclean::
	-rm -f *~ *orig \#*\# *.rej ? a.out
	-rm -f Makefile

Add some explicit absolute dependencies which can't be calculated automatically. (dm)

###############################################################################
# BRLTTY - A background process providing access to the Linux console (when in
#          text mode) for a blind person using a refreshable braille display.
#
# Copyright (C) 1995-2003 by The BRLTTY Team. All rights reserved.
#
# BRLTTY comes with ABSOLUTELY NO WARRANTY.
#
# This is free software, placed under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation.  Please see the file COPYING for details.
#
# Web Page: http://mielke.cc/brltty/
#
# This software is maintained by Dave Mielke <dave@mielke.cc>.
###############################################################################

default: all

include $(SRC_DIR)/reldeps.mk
include $(SRC_TOP)absdeps.mk

$(BLD_TOP)Drivers/VarioHT/braille.$O: $(BLD_TOP)Drivers/VarioHT/vario.$O
$(BLD_TOP)Drivers/VarioHT/braille.$O: $(BLD_TOP)Drivers/VarioHT/variolow.$O
	cd $(@D) && $(MAKE) $(@F)

$(SRC_TOP)Drivers/VideoBraille/braille.$O: $(BLD_TOP)Drivers/VideoBraille/vb.$O
$(BLD_TOP)Drivers/VideoBraille/braille.$O: $(BLD_TOP)Drivers/VideoBraille/vblow.$O
	cd $(@D) && $(MAKE) $(@F)

$(BLD_TOP)Drivers/Voyager/braille.$O: $(BLD_TOP)Drivers/Voyager/brlvger.auto.h
$(BLD_TOP)Drivers/Voyager/brlvger.auto.h:
	cd $(@D) && $(MAKE) $(@F)

clean::
	-rm -f *.$O *.auto.h core

distclean::
	-rm -f *~ *orig \#*\# *.rej ? a.out
	-rm -f Makefile


SHELL := /usr/bin/env bash
RUBY_SOURCE_FILES = $(shell find . -name "*.rb")
GEMSPEC = $(shell find . -name "*.gemspec")

default: .tested
.PHONY: default

.deps: Gemfile.lock
	touch $@

Gemfile.lock: Gemfile $(GEMSPEC)
	bundle install
	touch $@

.tested: .deps $(RUBY_SOURCE_FILES)
	bundle exec rspec --color
	touch $@

update-dependencies:
	./scripts/update-gemspec
.PHONY: update-dependencies

update-version:
ifdef NEW_VERSION
	sed -i "s/\(s\.version *= *'\)[0-9]*\.[0-9]*\.[0-9]*\('\)/\1$(NEW_VERSION)\2/" $(GEMSPEC)
else
	@echo -e "\033[0;NEW_VERSION is not defined. Can't update version :-(\033[0m"
	exit 1
endif

publish:
	gem build $(GEMSPEC)
	gem push $$(find . -name "*.gem")
.PHONY: publish

clean: clean-ruby
.PHONY: clean

clean-ruby:
	rm -f .deps .linked .tested Gemfile.lock
.PHONY: clean-ruby

Remove Makefile duplication. Fix some target dependencies.

SHELL := /usr/bin/env bash
RUBY_SOURCE_FILES = $(shell find . -name "*.rb")
GEMSPEC = $(shell find . -name "*.gemspec")

default: .tested
.PHONY: default

.deps: Gemfile.lock
	touch $@

Gemfile.lock: Gemfile $(GEMSPEC)
	bundle install
	touch $@

.tested: .deps $(RUBY_SOURCE_FILES)
	bundle exec rspec --color
	touch $@

update-dependencies:
	./scripts/update-gemspec
.PHONY: update-dependencies

update-version:
ifdef NEW_VERSION
	sed -i "s/\(s\.version *= *'\)[0-9]*\.[0-9]*\.[0-9]*\('\)/\1$(NEW_VERSION)\2/" $(GEMSPEC)
else
	@echo -e "\033[0;NEW_VERSION is not defined. Can't update version :-(\033[0m"
	exit 1
endif
.PHONY: update-version

publish: .deps
	gem build $(GEMSPEC)
	gem push $$(find . -name "*.gem")
.PHONY: publish

clean: clean-ruby
.PHONY: clean

clean-ruby:
	rm -f .deps .linked .tested Gemfile.lock
.PHONY: clean-ruby


LOCAL_DIR := $(GET_LOCAL_DIR)

ARCH    := arm
#Compiling this as cortex-a8 until the compiler supports krait
ARM_CPU := cortex-a8
CPU     := generic

DEFINES += ARM_CPU_CORE_A7

MMC_SLOT         := 1

DEFINES += PERIPH_BLK_BLSP=1
DEFINES += WITH_CPU_EARLY_INIT=0 WITH_CPU_WARM_BOOT=0 \
          MMC_SLOT=$(MMC_SLOT) SSD_ENABLE

DEFINES += TZ_SAVE_KERNEL_HASH

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

DEVS += fbcon
MODULES += dev/fbcon

OBJS += \
       $(LOCAL_DIR)/platform.o \
       $(LOCAL_DIR)/acpuclock.o \
       $(LOCAL_DIR)/msm8916-clock.o \
       $(LOCAL_DIR)/gpio.o

LINKER_SCRIPT += $(BUILDDIR)/system-onesegment.ld

include platform/msm_shared/rules.mk

Revert "platforms: added TZ_SAVE_KERNEL_HASH build flag to msm8916"

LOCAL_DIR := $(GET_LOCAL_DIR)

ARCH    := arm
#Compiling this as cortex-a8 until the compiler supports krait
ARM_CPU := cortex-a8
CPU     := generic

DEFINES += ARM_CPU_CORE_A7

MMC_SLOT         := 1

DEFINES += PERIPH_BLK_BLSP=1
DEFINES += WITH_CPU_EARLY_INIT=0 WITH_CPU_WARM_BOOT=0 \
          MMC_SLOT=$(MMC_SLOT) SSD_ENABLE

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

DEVS += fbcon
MODULES += dev/fbcon

OBJS += \
       $(LOCAL_DIR)/platform.o \
       $(LOCAL_DIR)/acpuclock.o \
       $(LOCAL_DIR)/msm8916-clock.o \
       $(LOCAL_DIR)/gpio.o

LINKER_SCRIPT += $(BUILDDIR)/system-onesegment.ld

include platform/msm_shared/rules.mk


# The Mordax Microkernel
# (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com>
# Report bugs and issues on <http://github.com/skordal/mordax/issues>

# Target independent build tools:
DTC     ?= dtc
GZIP    ?= gzip
MAKE    ?= make
MKIMAGE ?= mkimage
RM      ?= rm

# Build flags:
TARGET_ASFLAGS += -Wall -g -O2 -ffreestanding -std=gnu11 -I$(TOPLEVEL)/kernel -DASSEMBLER
TARGET_CFLAGS  += -Wall -g -O2 -ffreestanding -std=gnu11 -I$(TOPLEVEL)/kernel
TARGET_LDFLAGS += -nostdlib

# Target independent source files:
SOURCE_FILES += \
	abort.c \
	debug.c \
	dt.c \
	irq.c \
	kernel.c \
	mm.c \
	queue.c \
	rbtree.c \
	process.c \
	scheduler.c \
	stack.c \
	syscall.c \
	thread.c \
	utils.c

# Include build configuration files for the drivers:
include drivers/config.mk

Add compiler flag for errors on implicit function declarations

# The Mordax Microkernel
# (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com>
# Report bugs and issues on <http://github.com/skordal/mordax/issues>

# Target independent build tools:
DTC     ?= dtc
GZIP    ?= gzip
MAKE    ?= make
MKIMAGE ?= mkimage
RM      ?= rm

# Build flags:
TARGET_ASFLAGS += -Wall -g -O2 -ffreestanding -std=gnu11 -I$(TOPLEVEL)/kernel -DASSEMBLER
TARGET_CFLAGS  += -Wall -g -O2 -ffreestanding -std=gnu11 -I$(TOPLEVEL)/kernel \
	-Werror=implicit-function-declaration
TARGET_LDFLAGS += -nostdlib

# Target independent source files:
SOURCE_FILES += \
	abort.c \
	debug.c \
	dt.c \
	irq.c \
	kernel.c \
	mm.c \
	queue.c \
	rbtree.c \
	process.c \
	scheduler.c \
	stack.c \
	syscall.c \
	thread.c \
	utils.c

# Include build configuration files for the drivers:
include drivers/config.mk


# Service specific Makefile

include etc/proto.mk

DB_USER ?= root
DB_PASS ?=
DB_HOST ?= 127.0.0.1
DB_PORT ?= 3306
DB_NAME ?= service

.PHONY: migrate

migrate: ## Run migrations
ifdef GODOTENV
	@${GODOTENV} $(MAKE) GODOTENV="" migrate
else
	migrate -path ${PWD}/migrations/ -database mysql://${DB_USER}:${DB_PASS}@tcp\(${DB_HOST}:${DB_PORT}\)/${DB_NAME} up
endif

docker-compose.override.yml: ## Create docker-compose override file
	cp docker-compose.override.yml.example docker-compose.override.yml

setup::
	mkdir -p .docker/

clean::
	rm -rf .docker/ docker-compose.override.yml

envcheck::
	$(call executable_check,Docker Compose,docker-compose)

Remove docker compose file creation

# Service specific Makefile

include etc/proto.mk

DB_USER ?= root
DB_PASS ?=
DB_HOST ?= 127.0.0.1
DB_PORT ?= 3306
DB_NAME ?= service

.PHONY: migrate

migrate: ## Run migrations
ifdef GODOTENV
	@${GODOTENV} $(MAKE) GODOTENV="" migrate
else
	migrate -path ${PWD}/migrations/ -database mysql://${DB_USER}:${DB_PASS}@tcp\(${DB_HOST}:${DB_PORT}\)/${DB_NAME} up
endif

setup::
	mkdir -p .docker/

clean::
	rm -rf .docker/ docker-compose.override.yml

envcheck::
	$(call executable_check,Docker Compose,docker-compose)


# Compilation
INCLUDE+=       -I..
CFLAGS+=		-Wall -Wno-unknown-pragmas -std=c99 -ggdb $(INCLUDE) -D_XOPEN_SOURCE=500

# Installation
DESTDIR?=		/
PREFIX?=		/usr/local/

MANDEST=		$(DESTDIR)/usr/share/man/man1/
BINDEST=		$(DESTDIR)/$(PREFIX)/bin/
LIBDEST=		$(DESTDIR)/$(PREFIX)/lib/
INCDEST=		$(DESTDIR)/$(PREFIX)/include/

Use _XOPEN_SOURCE_EXTENDED instead of _XOPEN_SOURCE=500, since 500 breaks compilation on actual BSD machines

# Compilation
INCLUDE+=       -I..
CFLAGS+=		-Wall -Wno-unknown-pragmas -std=c99 -ggdb $(INCLUDE) -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED

# Installation
DESTDIR?=		/
PREFIX?=		/usr/local/

MANDEST=		$(DESTDIR)/usr/share/man/man1/
BINDEST=		$(DESTDIR)/$(PREFIX)/bin/
LIBDEST=		$(DESTDIR)/$(PREFIX)/lib/
INCDEST=		$(DESTDIR)/$(PREFIX)/include/


# Also bump lib/mosquitto.h, lib/python/setup.py, CMakeLists.txt
VERSION=0.9.90
TIMESTAMP:=$(shell date "+%F %T%z")

#MANCOUNTRIES=en_GB

CFLAGS=-I. -I.. -ggdb -Wall -O3 -I../lib
LDFLAGS=
# Add -lwrap to LDFLAGS if compiling with tcp wrappers support.

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

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

Revert to using -O2 for compiling.

# Also bump lib/mosquitto.h, lib/python/setup.py, CMakeLists.txt
VERSION=0.9.90
TIMESTAMP:=$(shell date "+%F %T%z")

#MANCOUNTRIES=en_GB

CFLAGS=-I. -I.. -ggdb -Wall -O2 -I../lib
LDFLAGS=
# Add -lwrap to LDFLAGS if compiling with tcp wrappers support.

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

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


package=libxcb_util
$(package)_version=0.4.0
$(package)_download_path=https://xcb.freedesktop.org/dist
$(package)_file_name=xcb-util-$($(package)_version).tar.bz2
$(package)_sha256_hash=46e49469cb3b594af1d33176cd7565def2be3fa8be4371d62271fabb5eae50e9
$(package)_dependencies=libxcb

define $(package)_set_vars
$(package)_config_opts = --disable-shared --disable-devel-docs --without-doxygen
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_cflags += -fPIC
endef

define $(package)_preprocess_cmds
  cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
endef

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

define $(package)_build_cmds
  $(MAKE)
endef

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

define $(package)_postprocess_cmds
  rm -rf share/man share/doc lib/*.la
endef

Use config_opts instead of passing a compiler flag directly

package=libxcb_util
$(package)_version=0.4.0
$(package)_download_path=https://xcb.freedesktop.org/dist
$(package)_file_name=xcb-util-$($(package)_version).tar.bz2
$(package)_sha256_hash=46e49469cb3b594af1d33176cd7565def2be3fa8be4371d62271fabb5eae50e9
$(package)_dependencies=libxcb

define $(package)_set_vars
$(package)_config_opts = --disable-shared --disable-devel-docs --without-doxygen
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts += --with-pic
endef

define $(package)_preprocess_cmds
  cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
endef

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

define $(package)_build_cmds
  $(MAKE)
endef

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

define $(package)_postprocess_cmds
  rm -rf share/man share/doc lib/*.la
endef


CONSOLE_DEV_DIR = $(DEV_ARCH_DIR)/console
CONSOLE_DEV_OBJ_DIR = $(CONSOLE_DEV_DIR)/$(OBJ_DIR)
DEV_OBJS += \
	$(CONSOLE_DEV_OBJ_DIR)/console.o \
	$(CONSOLE_DEV_OBJ_DIR)/keyboard.o

DEV_SUB_INCLUDES += \
	-I$(DEV_ARCH_DIR)/console

$(CONSOLE_DEV_OBJ_DIR)/%.o: $(CONSOLE_DEV_DIR)/%.c
	@mkdir -p $(CONSOLE_DEV_OBJ_DIR)
	$(CC) -c $< $(GLOBAL_CFLAGS) $(DEV_INCLUDES) -o $@

$(CONSOLE_DEV_OBJ_DIR)/%.d: $(CONSOLE_DEV_DIR)/%.c
	@mkdir -p $(CONSOLE_DEV_OBJ_DIR)
	@echo "making deps for $<..."
	@(echo -n $(dir $@); $(CC) $(GLOBAL_CFLAGS) $(DEV_INCLUDES) -M -MG $<) > $@

$(CONSOLE_DEV_OBJ_DIR)/%.d: $(CONSOLE_DEV_DIR)/%.S
	@mkdir -p $(CONSOLE_DEV_OBJ_DIR)
	@echo "making deps for $<..."
	@(echo -n $(dir $@);$(CC) $(GLOBAL_CFLAGS) $(DEV_INCLUDES) -M -MG $<) > $@

$(CONSOLE_DEV_OBJ_DIR)/%.o: $(CONSOLE_DEV_DIR)/%.S
	@mkdir -p $(CONSOLE_DEV_OBJ_DIR)
	$(CC) -c $< $(GLOBAL_CFLAGS) $(DEV_INCLUDES) -o $@

Make all of sh4 build build on sparc.

CONSOLE_DEV_DIR = $(DEV_ARCH_DIR)/console
CONSOLE_DEV_OBJ_DIR = $(CONSOLE_DEV_DIR)/$(OBJ_DIR)
DEV_OBJS += \
	$(CONSOLE_DEV_OBJ_DIR)/console.o \
	$(CONSOLE_DEV_OBJ_DIR)/keyboard.o

DEV_SUB_INCLUDES += \
	-I$(DEV_ARCH_DIR)/console

$(CONSOLE_DEV_OBJ_DIR)/%.o: $(CONSOLE_DEV_DIR)/%.c
	@mkdir -p $(CONSOLE_DEV_OBJ_DIR)
	$(CC) -c $< $(GLOBAL_CFLAGS) $(DEV_INCLUDES) -o $@

$(CONSOLE_DEV_OBJ_DIR)/%.d: $(CONSOLE_DEV_DIR)/%.c
	@mkdir -p $(CONSOLE_DEV_OBJ_DIR)
	@echo "making deps for $<..."
	@($(ECHO) -n $(dir $@); $(CC) $(GLOBAL_CFLAGS) $(DEV_INCLUDES) -M -MG $<) > $@

$(CONSOLE_DEV_OBJ_DIR)/%.d: $(CONSOLE_DEV_DIR)/%.S
	@mkdir -p $(CONSOLE_DEV_OBJ_DIR)
	@echo "making deps for $<..."
	@($(ECHO) -n $(dir $@);$(CC) $(GLOBAL_CFLAGS) $(DEV_INCLUDES) -M -MG $<) > $@

$(CONSOLE_DEV_OBJ_DIR)/%.o: $(CONSOLE_DEV_DIR)/%.S
	@mkdir -p $(CONSOLE_DEV_OBJ_DIR)
	$(CC) -c $< $(GLOBAL_CFLAGS) $(DEV_INCLUDES) -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_ExternalProject_ExternalProject,fontconfig))

$(eval $(call gb_ExternalProject_use_packages,fontconfig,\
	freetype \
))

$(eval $(call gb_ExternalProject_register_targets,fontconfig,\
	build \
))

$(call gb_ExternalProject_get_state_target,fontconfig,build) :
	$(call gb_ExternalProject_run,build,\
		CFLAGS="$(if $(debug),-g) $(gb_VISIBILITY_FLAGS)" $(if $(filter ANDROID,$(OS)),LIBS="-lm") \
		./configure \
			--disable-shared \
			--with-arch=arm \
			--with-expat-includes=$(call gb_UnpackedTarball_get_dir,expat)/lib \
			--with-expat-lib=$(OUTDIR)/lib \
			--with-freetype-config=$(OUTDIR)/bin/freetype-config \
			--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
		&& $(MAKE) \
	)

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

Fix up the expat dependency

# -*- 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_ExternalProject_ExternalProject,fontconfig))

$(eval $(call gb_ExternalProject_use_packages,fontconfig,\
	expat \
	freetype \
))

$(eval $(call gb_ExternalProject_register_targets,fontconfig,\
	build \
))

$(call gb_ExternalProject_get_state_target,fontconfig,build) :
	$(call gb_ExternalProject_run,build,\
		CFLAGS="$(if $(debug),-g) $(gb_VISIBILITY_FLAGS)" $(if $(filter ANDROID,$(OS)),LIBS="-lm") \
		./configure \
			--disable-shared \
			--with-arch=arm \
			--with-expat-includes=$(call gb_UnpackedTarball_get_dir,expat)/lib \
			--with-expat-lib=$(gb_StaticLibrary_WORKDIR) \
			--with-freetype-config=$(OUTDIR)/bin/freetype-config \
			--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
		&& $(MAKE) \
	)

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


# VARIABLES #

# Define the path to the executable for generating REPL help docs:
REPL_HELP ?= $(SRC_DIR)/@stdlib/namespace/scripts/build.js

# TARGETS #

# Generate REPL help.
#
# This target generates REPL help documentation.

repl-help: $(NODE_MODULES)
	$(QUIET) $(NODE) $(REPL_HELP)

.PHONY: repl-help

Refactor REPL recipes into separate targets

# VARIABLES #

# Define the path to the executable for generating REPL help docs:
REPL_HELP ?= $(SRC_DIR)/@stdlib/repl/help/scripts/build.js

# Define the path to the executable for aggregating REPL examples:
REPL_EXAMPLES ?= $(SRC_DIR)/@stdlib/repl/example/scripts/build.js

# TARGETS #

# Generate REPL docs.
#
# This target generates REPL documentation.

repl-docs: repl-help repl-examples

.PHONY: repl-docs

# Generate REPL help.
#
# This target generates REPL help documentation.

repl-help: $(NODE_MODULES) $(REPL_HELP)
	$(QUIET) $(NODE) $(REPL_HELP)

.PHONY: repl-help

# Aggregate REPL examples.
#
# This target aggregates REPL examples.

repl-examples: $(NODE_MODULES) $(REPL_EXAMPLES)
	$(QUIET) $(NODE) $(REPL_EXAMPLES)

.PHONY: repl-examples


LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)

LOCAL_SRC_FILES := \
        Socket.cpp \
        ListeningSocket.cpp \
        ConnectionSocket.cpp \
        Message.cpp \
        RequestMessage.cpp \
        AnswerMessage.cpp \
        RemoteProcessorServer.cpp \
        RemoteProcessorServerBuilder.cpp

LOCAL_MODULE := libremote-processor

LOCAL_MODULE_TAGS := optional

TARGET_ERROR_FLAGS += -Wno-non-virtual-dtor

LOCAL_C_INCLUDES +=

LOCAL_C_INCLUDES += \
        external/stlport/stlport/ \
        bionic/libstdc++ \
        bionic/

LOCAL_C_INCLUDES +=

LOCAL_SHARED_LIBRARIES := libstlport libicuuc
LOCAL_STATIC_LIBRARIES :=

LOCAL_LDLIBS +=

include $(BUILD_SHARED_LIBRARY)

Add support for host build

LOCAL_PATH := $(call my-dir)

####################
# Common definitions

COMMON_SRC_FILES := \
        Socket.cpp \
        ListeningSocket.cpp \
        ConnectionSocket.cpp \
        Message.cpp \
        RequestMessage.cpp \
        AnswerMessage.cpp \
        RemoteProcessorServer.cpp \
        RemoteProcessorServerBuilder.cpp

COMMON_MODULE := libremote-processor
COMMON_MODULE_TAGS := optional

COMMON_ERROR_FLAGS := -Wno-non-virtual-dtor

COMMON_LDLIBS := -lpthread

#############################
# Target build

include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(COMMON_SRC_FILES)

LOCAL_MODULE := $(COMMON_MODULE)
LOCAL_MODULE_TAGS := $(COMMON_MODULE_TAGS)

TARGET_ERROR_FLAGS += $(COMMON_ERROR_FLAGS)

LOCAL_C_INCLUDES += \
    external/stlport/stlport/ \
    bionic/libstdc++ \
    bionic/

LOCAL_SHARED_LIBRARIES := libstlport

LOCAL_LDLIBS += $(COMMON_LDLIBS)

include $(BUILD_SHARED_LIBRARY)

##############################
# Host build

include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(COMMON_SRC_FILES)

LOCAL_MODULE := $(COMMON_MODULE)
LOCAL_MODULE_TAGS := $(COMMON_MODULE_TAGS)

TARGET_ERROR_FLAGS += $(COMMON_ERROR_FLAGS)

LOCAL_LDLIBS += $(COMMON_LDLIBS)

include $(BUILD_HOST_SHARED_LIBRARY)


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

Add L1 procedures for p9a and makefiles

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

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

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


# Create a way to reformat just some files
ifdef PPFILES
  PP_INPUTS_FILTERED := $(wildcard $(PPFILES))
else
  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) \
              $(wildcard $(S)src/fuzzer/*.rs)

  PP_INPUTS_FILTERED = $(shell echo $(PP_INPUTS) | xargs grep -L \
                       "no-reformat\|xfail-pretty\|xfail-stage2")
endif

reformat: $(SREQ1)
	@$(call E, reformat [stage1]: $@)
	for i in $(PP_INPUTS_FILTERED);  \
    do $(call CFG_RUN_TARG,stage1,stage1/rustc$(X)) \
       --pretty normal $$i >$$i.tmp; \
    if cmp --silent $$i.tmp $$i; \
        then echo no changes to $$i; rm $$i.tmp; \
        else mv $$i.tmp $$i; fi \
    done

Add more verbosity to 'make reformat'

# Create a way to reformat just some files
ifdef PPFILES
  PP_INPUTS_FILTERED := $(wildcard $(PPFILES))
else
  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) \
              $(wildcard $(S)src/fuzzer/*.rs)

  PP_INPUTS_FILTERED = $(shell echo $(PP_INPUTS) | xargs grep -L \
                       "no-reformat\|xfail-pretty\|xfail-stage2")
endif

reformat: $(SREQ1)
	@$(call E, reformat [stage1]: $@)
	for i in $(PP_INPUTS_FILTERED);  \
    do $(call CFG_RUN_TARG,stage1,stage1/rustc$(X)) \
       --pretty normal $$i >$$i.tmp; \
    if [ $$? -ne 0 ]; \
        then echo failed to print $$i; rm $$i.tmp; \
        else if cmp --silent $$i.tmp $$i; \
            then echo no changes to $$i; rm $$i.tmp; \
            else echo reformated $$i; mv $$i.tmp $$i; \
        fi; \
    fi; \
    done


# -*- 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_CustomTarget_CustomTarget,extras/glade))

#
# Rules
#

$(call gb_CustomTarget_get_workdir,extras/source/glade)/libreoffice-catalog.xml : \
        $(SRCDIR)/extras/source/glade/libreoffice-catalog.xml.in \
        $(SRCDIR)/extras/source/glade/makewidgetgroup.xslt \
        | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XSLT,4)
	$(call gb_Helper_abbreviate_dirs, \
	$(call gb_ExternalExecutable_get_command,xsltproc) --nonet \
		-o $@ $(SRCDIR)/extras/source/glade/makewidgetgroup.xslt $< \
	)

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

Make sure output dir exsits for xsltproc

# -*- 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_CustomTarget_CustomTarget,extras/glade))

#
# Rules
#

$(call gb_CustomTarget_get_workdir,extras/source/glade)/libreoffice-catalog.xml : \
        $(SRCDIR)/extras/source/glade/libreoffice-catalog.xml.in \
        $(SRCDIR)/extras/source/glade/makewidgetgroup.xslt \
        | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XSLT,4)
	$(call gb_Helper_abbreviate_dirs, \
	mkdir -p $(dir $@) && \
	$(call gb_ExternalExecutable_get_command,xsltproc) --nonet \
		-o $@ $(SRCDIR)/extras/source/glade/makewidgetgroup.xslt $< \
	)

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


# VARIABLES #

# Define the command for `node`:
NODE ?= node

# Define the command for `cat`:
CAT ?= cat
CAT_FLAGS ?=

# Define the path to the Codecov executable:
CODECOV ?= bash <(curl -s https://codecov.io/bash)

# Define the command-line options to be used when reporting coverage statistics:
CODECOV_FLAGS ?= \
	-F $(CI_SERVICE) \
	-F $(shell echo $(KERNEL) | tr '[:upper:]' '[:lower:]') \
	-F $(shell $(NODE) --version | tr '\.' '_' | (printf 'node_' && $(CAT)))

ifdef COVERAGE_NAME
	CODECOV_FLAGS := $(CODECOV_FLAGS) -F $(COVERAGE_NAME)
endif

# TARGETS #

# Report coverage statistics.
#
# This target sends coverage statistics to [Codecov][1].
#
# [1]: https://codecov.io/

coverage-codecov:
	$(QUIET) $(CAT) $(CAT_FLAGS) $(LCOV_INFO) | $(CODECOV) $(CODECOV_FLAGS) || echo "Failed to upload coverage reports to Codecov. :("

.PHONY: coverage-codecov

Add recipe to validate a configuration file

# VARIABLES #

# Define the command for `node`:
NODE ?= node

# Define the command for `cat`:
CAT ?= cat
CAT_FLAGS ?=

# Define the path to the [Codecov][1] executable.
#
# [1]: https://github.com/codecov/codecov-bash

CODECOV ?= bash <(curl -s https://codecov.io/bash)

# Define the command-line options to be used when reporting coverage statistics:
CODECOV_FLAGS ?= \
	-F $(CI_SERVICE) \
	-F $(shell echo $(KERNEL) | tr '[:upper:]' '[:lower:]') \
	-F $(shell $(NODE) --version | tr '\.' '_' | (printf 'node_' && $(CAT)))

ifdef COVERAGE_NAME
	CODECOV_FLAGS := $(CODECOV_FLAGS) -F $(COVERAGE_NAME)
endif

# Define the path to the Codecov configuration file:
CODECOV_CONF ?= $(ROOT)/.codecov.yml

# TARGETS #

# Report coverage statistics.
#
# This target sends coverage statistics to [Codecov][1].
#
# [1]: https://codecov.io/

coverage-codecov: validate-codecov-configuration
	$(QUIET) $(CAT) $(CAT_FLAGS) $(LCOV_INFO) | $(CODECOV) $(CODECOV_FLAGS) || echo "Failed to upload coverage reports to Codecov. :("

.PHONY: coverage-codecov

# Validate configuration.
#
# This target validates a Codecov configuration file.

validate-codecov-configuration:
	$(QUIET) curl --data-binary $(CODECOV_CONF) https://codecov.io/validate

.PHONY: validate-codecov-configuration


CXX=cl
AR=lib
CXX_O=-Fo$@
CFLAGS += -nologo
CXX_LINK_O=-nologo -Fe$@
AR_OPTS=-nologo -out:$@
CFLAGS_OPT=-O2
CFLAGS_DEBUG=
CFLAGS_M32=
CFLAGS_M64=
LINK_LIB=$(1).lib
LIBSUFFIX=lib
LIBPREFIX=

Update msvc options from VS projects.

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=


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p10/procedures/hwp/pm/p10_qme_build_attributes.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,2020
# [+] 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=p10_qme_build_attributes
$(call BUILD_PROCEDURE)

Add missing path due to build error

# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p10/procedures/hwp/pm/p10_qme_build_attributes.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,2020
# [+] 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=p10_qme_build_attributes
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(PROJECT_ROOT)/chips/p10/procedures/hwp/lib)
$(call BUILD_PROCEDURE)


APP_STL     := stlport_static
APP_MODULES := libgameplay

Build for armeabi-v7a by default for Android targets.

APP_STL     := stlport_static
APP_MODULES := libgameplay
APP_ABI     := armeabi-v7a


# Copyright (C) 2016 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_USE_AAPT2 := true
LOCAL_PACKAGE_NAME := SupportTransitionDemos
LOCAL_MODULE_TAGS := samples
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_ANDROID_LIBRARIES := \
        android-support-v4 \
        android-support-v7-appcompat \
        android-support-transition
LOCAL_AAPT_FLAGS := --no-version-vectors
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
include $(BUILD_PACKAGE)

Fix SupportTransitionDemos make build. am: 44f2fd9e59 am: fed5203548 am: 7909cc94e0

# Copyright (C) 2016 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_USE_AAPT2 := true
LOCAL_PACKAGE_NAME := SupportTransitionDemos
LOCAL_MODULE_TAGS := samples
LOCAL_SDK_VERSION := current
LOCAL_MIN_SDK_VERSION := 14
LOCAL_DEX_PREOPT := false
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_ANDROID_LIBRARIES := \
        android-support-v4 \
        android-support-v7-appcompat \
        android-support-transition
LOCAL_AAPT_FLAGS := --no-version-vectors
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
include $(BUILD_PACKAGE)


CONFIGURE_OPTS_opt := --with-ccache --enable-release

FLAVORS := opt

USE_COMMON_CONFIG := 1

include /usr/releng/share/build_scripts/ci.mk

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

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

build_flavor:
	mkdir -p $(BUILD_DIR)
	cd $(BUILD_DIR) && ../configure $(CONFIGURE_OPTS_$(FLAVOR))
	$(MAKE) -C $(BUILD_DIR)

package:
	rm -f $(BUILD_DIR)/*.tar.gz
	$(MAKE) -C $(BUILD_DIR) tarball

test:
	ulimit -n 1024; $(MAKE) -C $(BUILD_DIR) test_tinderbox

Add TAP_PREFIX to test target so failed tests don't exit the build and a TAP report is created from inktest

CONFIGURE_OPTS_opt := --with-ccache --enable-release

FLAVORS := opt

USE_COMMON_CONFIG := 1

include /usr/releng/share/build_scripts/ci.mk

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

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

build_flavor:
	mkdir -p $(BUILD_DIR)
	cd $(BUILD_DIR) && ../configure $(CONFIGURE_OPTS_$(FLAVOR))
	$(MAKE) -C $(BUILD_DIR)

package:
	rm -f $(BUILD_DIR)/*.tar.gz
	$(MAKE) -C $(BUILD_DIR) tarball

test:
	ulimit -n 1024; $(MAKE) -C $(BUILD_DIR) TAP_PREFIX= test_tinderbox


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

Add no variable tracking to initfile procedures to imporve build time

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


LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := libtranscode
LOCAL_SRC_FILES := transcode.c
LOCAL_SHARED_LIBRARIES := gstreamer_android
LOCAL_LDLIBS := -landroid -llog

include $(BUILD_SHARED_LIBRARY)

GSTREAMER_SDK_ROOT := $(GSTREAMER_SDK_ROOT_ANDROID)
GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
GSTREAMER_PLUGINS := \
	$(GSTREAMER_PLUGINS_CORE) \
	$(GSTREAMER_PLUGINS_PLAYBACK) \
	debug \
	audioparsers id3demux isomp4 ogg vorbis  \
	amrnb amrwbdec faad mad mpegaudioparse \
	amc

include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk

Drop GStreamer amc codecs temporarily

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := libtranscode
LOCAL_SRC_FILES := transcode.c
LOCAL_SHARED_LIBRARIES := gstreamer_android
LOCAL_LDLIBS := -landroid -llog

include $(BUILD_SHARED_LIBRARY)

GSTREAMER_SDK_ROOT := $(GSTREAMER_SDK_ROOT_ANDROID)
GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
GSTREAMER_PLUGINS := \
	$(GSTREAMER_PLUGINS_CORE) \
	$(GSTREAMER_PLUGINS_PLAYBACK) \
	debug \
	audioparsers id3demux isomp4 ogg vorbis  \
	amrnb amrwbdec faad mad mpegaudioparse

include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk


PRODUCT_LOCALES := en_US cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_NZ en_SG 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 am_ET hi_IN

$(call inherit-product, build/target/product/languages_full.mk)

Add Esperanto to the list of locales

PRODUCT_LOCALES := en_US cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_NZ en_SG eo_EU 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 am_ET hi_IN

$(call inherit-product, build/target/product/languages_full.mk)


# Copyright 2015 The Android Open Source Project
# Copyright (C) 2015 Valve Corporation

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#      http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_PLATFORM := android-23
APP_STL := gnustl_static
APP_MODULES := VkCube
APP_CPPFLAGS += -std=c++11 -fexceptions -Wall -Werror -Wextra -Wno-unused-parameter -DVK_NO_PROTOTYES -DGLM_FORCE_RADIANS
APP_CFLAGS += -Wall -Werror -Wextra -Wno-unused-parameter -DVK_NO_PROTOTYES -DGLM_FORCE_RADIANS
NDK_TOOLCHAIN_VERSION := clang

Use c++_static instead of unsupported gnustl_static for STL

# Copyright 2015 The Android Open Source Project
# Copyright (C) 2015 Valve Corporation

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#      http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_PLATFORM := android-23
APP_STL := c++_static
APP_MODULES := VkCube
APP_CPPFLAGS += -std=c++11 -fexceptions -Wall -Werror -Wextra -Wno-unused-parameter -DVK_NO_PROTOTYES -DGLM_FORCE_RADIANS
APP_CFLAGS += -Wall -Werror -Wextra -Wno-unused-parameter -DVK_NO_PROTOTYES -DGLM_FORCE_RADIANS
NDK_TOOLCHAIN_VERSION := clang


# Build a mostly static binary.

CC					= gcc-7
CXX					= g++-7

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

Build with Clang on Linux

# Build a mostly static binary.

LLVM_ROOT				= /usr/lib/llvm-6.0
CLANG_INCLUDE_DIR		= $(LLVM_ROOT)/lib/clang/6.0.0/include

CC						= clang-6.0
CXX						= clang++-6.0
LIBDISPATCH_CFLAGS		= -U__STDC_HOSTED__ -isystem $(CLANG_INCLUDE_DIR)
LIBDISPATCH_CXXFLAGS	= -U__STDC_HOSTED__ -isystem $(CLANG_INCLUDE_DIR)

CFLAGS					= -fblocks -U__STDC_HOSTED__ -isystem $(CLANG_INCLUDE_DIR)
CXXFLAGS				= -fblocks -U__STDC_HOSTED__ -isystem $(CLANG_INCLUDE_DIR)

BOOST_LIBS				= -L$(BOOST_ROOT)/lib -lboost_iostreams
LDFLAGS					= -static-libstdc++ -static-libgcc


USB_VID = 0x239A
USB_PID = 0x80E2
USB_PRODUCT = "Metro M7 1011"
USB_MANUFACTURER = "Adafruit"

CHIP_VARIANT = MIMXRT1011DAE5A
CHIP_FAMILY = MIMXRT1011
FLASH = W25Q16JV

# Include these Python libraries in the firmware
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ESP32SPI
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests

Update board name, flash chip size

USB_VID = 0x239A
USB_PID = 0x80E2
USB_PRODUCT = "Metro M7 iMX RT1011"
USB_MANUFACTURER = "Adafruit"

CHIP_VARIANT = MIMXRT1011DAE5A
CHIP_FAMILY = MIMXRT1011
FLASH = W25Q32JV

# Include these Python libraries in the firmware
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ESP32SPI
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests


package=bdb
$(package)_version=4.8.30
$(package)_download_path=http://download.oracle.com/berkeley-db
$(package)_file_name=db-$($(package)_version).NC.tar.gz
$(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef
$(package)_build_subdir=build_unix

define $(package)_set_vars
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
$(package)_config_opts_mingw32=--enable-mingw
$(package)_config_opts_linux=--with-pic
endef

define $(package)_preprocess_cmds
  sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h
endef

define $(package)_config_cmds
  ../dist/$($(package)_autoconf)
endef

define $(package)_build_cmds
  $(MAKE) libdb_cxx-4.8.a libdb-4.8.a
endef

define $(package)_stage_cmds
  $(MAKE) DESTDIR=$($(package)_staging_dir) install_lib install_include
endef

Update config.{guess,sub} for Berkeley DB 4.8.30

package=bdb
$(package)_version=4.8.30
$(package)_download_path=http://download.oracle.com/berkeley-db
$(package)_file_name=db-$($(package)_version).NC.tar.gz
$(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef
$(package)_build_subdir=build_unix

define $(package)_set_vars
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
$(package)_config_opts_mingw32=--enable-mingw
$(package)_config_opts_linux=--with-pic
endef

define $(package)_preprocess_cmds
  sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h && \
  cp -f $(BASEDIR)/config.guess dist && \
  cp -f $(BASEDIR)/config.sub dist
endef

define $(package)_config_cmds
  ../dist/$($(package)_autoconf)
endef

define $(package)_build_cmds
  $(MAKE) libdb_cxx-4.8.a libdb-4.8.a
endef

define $(package)_stage_cmds
  $(MAKE) DESTDIR=$($(package)_staging_dir) install_lib install_include
endef


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

TARGET := ferrum

MODULES += app/aboot

DEBUG := 1
EMMC_BOOT := 1

#DEFINES += WITH_DEBUG_DCC=1
DEFINES += WITH_DEBUG_UART=1
#DEFINES += WITH_DEBUG_FBCON=1
DEFINES += DEVICE_TREE=1
#DEFINES += MMC_BOOT_BAM=1
#DEFINES += CRYPTO_BAM=1
#DEFINES += ABOOT_IGNORE_BOOT_HEADER_ADDRS=1

#DEFINES += ABOOT_FORCE_KERNEL_ADDR=0x80008000
#DEFINES += ABOOT_FORCE_RAMDISK_ADDR=0x82000000
#DEFINES += ABOOT_FORCE_TAGS_ADDR=0x81E00000

#Disable thumb mode
ENABLE_THUMB := false

ifeq ($(EMMC_BOOT),1)
DEFINES += _EMMC_BOOT=1
endif

Add SDHCI support for Ferrum

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

TARGET := ferrum

MODULES += app/aboot

DEBUG := 1
EMMC_BOOT := 1

#DEFINES += WITH_DEBUG_DCC=1
DEFINES += WITH_DEBUG_UART=1
#DEFINES += WITH_DEBUG_FBCON=1
DEFINES += DEVICE_TREE=1
#DEFINES += MMC_BOOT_BAM=1
#DEFINES += CRYPTO_BAM=1
#DEFINES += ABOOT_IGNORE_BOOT_HEADER_ADDRS=1

#DEFINES += ABOOT_FORCE_KERNEL_ADDR=0x80008000
#DEFINES += ABOOT_FORCE_RAMDISK_ADDR=0x82000000
#DEFINES += ABOOT_FORCE_TAGS_ADDR=0x81E00000

#Disable thumb mode
ENABLE_THUMB := false

ENABLE_SDHCI_SUPPORT := 1

ifeq ($(ENABLE_SDHCI_SUPPORT),1)
DEFINES += MMC_SDHCI_SUPPORT=1
endif

ifeq ($(EMMC_BOOT),1)
DEFINES += _EMMC_BOOT=1
endif