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

products_pdf := $(OUT_DIR)/products.pdf

# This rule doens't include any nodes that don't inherit from
# anything or don't have anything inherit from them, to make the
# graph more readable.  To add that, add this line to the rule
# below:
#		$(foreach p,$(ALL_PRODUCTS), echo \"$(p)\";) \

$(products_pdf):
	$(hide) ( \
		echo 'digraph {'; \
		$(foreach p,$(ALL_PRODUCTS), \
			$(foreach d,$(PRODUCTS.$(strip $(p)).INHERITS_FROM), \
			echo \"$(d)\" -\> \"$(p)\";)) \
		echo '}' \
	) | dot -Tpdf -Nshape=box -o $@

product-graph: $(products_pdf)

Make the product graph slightly more readable.

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

products_pdf := $(OUT_DIR)/products.pdf

# This rule doens't include any nodes that don't inherit from
# anything or don't have anything inherit from them, to make the
# graph more readable.  To add that, add this line to the rule
# below:
#		$(foreach p,$(ALL_PRODUCTS), echo \"$(p)\";) \

$(products_pdf):
	$(hide) ( \
		echo 'digraph {'; \
		echo 'graph [ ratio = .6, pack=false];'; \
		$(foreach p,$(ALL_PRODUCTS), \
			$(foreach d,$(PRODUCTS.$(strip $(p)).INHERITS_FROM), \
			echo \"$(d)\" -\> \"$(p)\";)) \
		echo '}' \
	) | dot -Tpdf -Nshape=box -o $@

product-graph: $(products_pdf)


# Get absolute path to containing directory: http://stackoverflow.com/a/324782
TOP := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
LOCAL_INCLUDE_DIR := $(abspath $(TOP)Modules)

include $(TOP)/common.mk

# Use libisri, created in Modules/
CPPFLAGS += -I$(LOCAL_INCLUDE_DIR)
LDFLAGS += -L$(LOCAL_INCLUDE_DIR)
LDLIBS += -lisri

Reorder include path for GNU ld.

# Get absolute path to containing directory: http://stackoverflow.com/a/324782
TOP := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
LOCAL_INCLUDE_DIR := $(abspath $(TOP)Modules)

include $(TOP)/common.mk

# Use libisri, created in Modules/
CPPFLAGS += -I$(LOCAL_INCLUDE_DIR)
LDFLAGS += -L$(LOCAL_INCLUDE_DIR)
LDLIBS := -lisri $(LDLIBS)


ifeq ($(strip $(HPC_SYSTEM)),marconi)
INCLUDE += -I$(HOME)/include # cusp, thrust
INCLUDE += -I$(NETCDF_INC) -I$(HDF5_INC)
GLFLAGS  = -lm
CC=icc
MPICC=mpiicc
OPT=-O3 -xHost
#MPICFLAGS+= -DMPICH_IGNORE_CXX_SEEK
OMPFLAG=-qopenmp
JSONLIB=-L$(HOME)/include/json/../../src/lib_json -ljsoncpp # json library for input parameters
LIBS    +=-L$(HDF5_LIB) -lhdf5 -lhdf5_hl
LIBS    +=-L$(NETCDF_LIB) -lnetcdf -lcurl
endif
#############################modules to load in .bashrc#######################
#module load profile/base
#module load intel/pe-xe-2017--binary
#module load intelmpi/2017--binary
#module load szip/2.1--gnu--6.1.0
#module load zlib/1.2.8--gnu--6.1.0
#module load hdf5/1.8.17--intelmpi--2017--binary
#module load netcdf/4.4.1--intelmpi--2017--binary

Add compilation optimization flags for Marconi KNL

ifeq ($(strip $(HPC_SYSTEM)),marconi)
INCLUDE += -I$(HOME)/include # cusp, thrust
INCLUDE += -I$(NETCDF_INC) -I$(HDF5_INC)
GLFLAGS  = -lm
CC=icc
MPICC=mpiicc
OPT=-O3 -xHost -fma -xMIC-AVX512 -finline-functions -align
#MPICFLAGS+= -DMPICH_IGNORE_CXX_SEEK
OMPFLAG=-qopenmp
JSONLIB=-L$(HOME)/include/json/../../src/lib_json -ljsoncpp # json library for input parameters
LIBS    +=-L$(HDF5_LIB) -lhdf5 -lhdf5_hl
LIBS    +=-L$(NETCDF_LIB) -lnetcdf -lcurl
endif
#############################modules to load in .bashrc#######################
#module load profile/base
#module load intel/pe-xe-2017--binary
#module load intelmpi/2017--binary
#module load szip/2.1--gnu--6.1.0
#module load zlib/1.2.8--gnu--6.1.0
#module load hdf5/1.8.17--intelmpi--2017--binary
#module load netcdf/4.4.1--intelmpi--2017--binary


APP_OPTIM := debug
APP_PLATFORM := android-10
APP_STL := gnustl_static
APP_ABI := armeabi,armeabi-v7a,arm64-v8a

Set APP_SHORT_COMMANDS true where not building for OSX. This is required on Windows because there are too many arguments to the linker. This manifests as an error invoking CreateProcess at link time. Do not use on OSX as the documentation states will cause builds to be slower.

APP_OPTIM := debug
APP_PLATFORM := android-10
APP_STL := gnustl_static
APP_ABI := armeabi,armeabi-v7a,arm64-v8a

ifneq ($(os_name),Darwin)
	APP_SHORT_COMMANDS := true
endif


          ${applist_widget(category = 'right-content-column', layout = layout)}

          % if tmpl_context.auth('Not(not_anonymous())'):

Welcome to Fedora Community!

          FIXME: This is not correct wording. Fedora Community is a place where
          Fedora package maintainers can collaborate on building and maintaining
          their packages.  Logging into your Fedora account in Fedora Community
          allows you to keep up with your packages and to keep track of your
          friends' packages as well.

          Need an account?
          % endif
          ${applist_widget(category = 'left-content-column', layout = layout)}

Remove the obsolete layout widget preloader image


USB_VID = 0x239A
USB_PID = 0x8098
USB_PRODUCT = "OpenMV-H7 R1"
USB_MANUFACTURER = "OpenMV, LLC"
USB_DEVICES = "CDC,MSC"

INTERNAL_FLASH_FILESYSTEM = 1

MCU_SERIES = H7
MCU_VARIANT = STM32H743xx
MCU_PACKAGE = LQFP100_x7

LD_COMMON = boards/common_tcm.ld
LD_FILE = boards/STM32H743_fs.ld

Add correct PID for the OpenMV

USB_VID = 0x239A
USB_PID = 0x80A4
USB_PRODUCT = "OpenMV-H7 R1"
USB_MANUFACTURER = "OpenMV, LLC"
USB_DEVICES = "CDC,MSC"

INTERNAL_FLASH_FILESYSTEM = 1

MCU_SERIES = H7
MCU_VARIANT = STM32H743xx
MCU_PACKAGE = LQFP100_x7

LD_COMMON = boards/common_tcm.ld
LD_FILE = boards/STM32H743_fs.ld


TARGET=GPIMAKEMAKE

all: $(TARGET).pdf

## Generalized rule: how to build a .pdf from each .tex
LATEXPDFS=$(patsubst %.tex,%.pdf,$(wildcard *.tex))
$(LATEXPDFS): %.pdf: %.tex
	pdflatex -interaction nonstopmode $(patsubst %.pdf,%.tex,$@)

clean:
	rm *.aux *.log || true

veryclean: clean
	rm $(TARGET).pdf

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

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

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

.PHONY: all clean veryclean view print

Remove files generated by beamer for make clean

TARGET=GPIMAKEMAKE

all: $(TARGET).pdf

## Generalized rule: how to build a .pdf from each .tex
LATEXPDFS=$(patsubst %.tex,%.pdf,$(wildcard *.tex))
$(LATEXPDFS): %.pdf: %.tex
	pdflatex -interaction nonstopmode $(patsubst %.pdf,%.tex,$@)

clean:
	rm -f $(TARGET).aux $(TARGET).log $(TARGET).snm $(TARGET).nav $(TARGET).toc $(TARGET).vrb $(TARGET).out || true

veryclean: clean
	rm -f $(TARGET).pdf

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

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

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

.PHONY: all clean veryclean view print


# This file is included by all the "stub makefiles" in every directory
# in the tree except the root.  Its job is to invoke $(MAKE) on the
# top-level Makefile, but modifying the target so that it applies to
# the current directory only.
#
# eg.
#  make foo.o  ==>  make -C $(TOP) dir/foo.o
#  make all    ==>  make -C $(TOP) all_dir
#  make clean  ==>  make -C $(TOP) clean_dir
#

# Important, otherwise we get silly built-in rules:
.SUFFIXES:

TOPMAKE = $(MAKE) -C $(TOP)

default: all

# We must not execute multiple recursive invocations of make in parallel.
.NOTPARALLEL:

STD_TARGETS = all clean distclean maintainer_clean install html ps pdf

# The + tells make that we're recursively invoking make, otherwise 'make -j2'
# goes wrong.
$(STD_TARGETS):
	+$(TOPMAKE) $@_$(dir)

OTHERTARGETS=$(filter-out $(STD_TARGETS) $(SPEC_TARGETS),$(MAKECMDGOALS))
.PHONY: $(OTHERTARGETS)
$(OTHERTARGETS):
	+$(TOPMAKE) $(dir)/$@

Add 'make fast' which omits deps (for a library) and some of the phases

# This file is included by all the "stub makefiles" in every directory
# in the tree except the root.  Its job is to invoke $(MAKE) on the
# top-level Makefile, but modifying the target so that it applies to
# the current directory only.
#
# eg.
#  make foo.o  ==>  make -C $(TOP) dir/foo.o
#  make all    ==>  make -C $(TOP) all_dir
#  make clean  ==>  make -C $(TOP) clean_dir
#

# Important, otherwise we get silly built-in rules:
.SUFFIXES:

TOPMAKE = $(MAKE) -C $(TOP)

default: all

fast :
	+$(TOPMAKE) all_$(dir) $(dir)_dist-install_NO_BUILD_DEPS=YES \
	   OMIT_PHASE_1=YES OMIT_PHASE_2=YES OMIT_PHASE_3=YES

# We must not execute multiple recursive invocations of make in parallel.
.NOTPARALLEL:

STD_TARGETS = all clean distclean maintainer_clean install html ps pdf

# The + tells make that we're recursively invoking make, otherwise 'make -j2'
# goes wrong.
$(STD_TARGETS):
	+$(TOPMAKE) $@_$(dir)

OTHERTARGETS=$(filter-out fast $(STD_TARGETS) $(SPEC_TARGETS),$(MAKECMDGOALS))
.PHONY: $(OTHERTARGETS)
$(OTHERTARGETS):
	+$(TOPMAKE) $(dir)/$@


# Copyright (C) 2015 The Android Open Source Project

LOCAL_PATH:= $(call my-dir)

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

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

Add libz4 static library for targets

# Copyright (C) 2015 The Android Open Source Project

LOCAL_PATH:= $(call my-dir)

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

include $(CLEAR_VARS)
LOCAL_MODULE := liblz4-static
LOCAL_SRC_FILES := $(liblz4_src_files)
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_LIBRARY)

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


CXX           ?= g++
NVCC          ?= nvcc
LINKER        ?= g++
CPPFLAGS      ?=
CXXFLAGS      ?= -O3 -Wall -Wpedantic
NVCCFLAGS     ?= -O3 -Xcompiler "-Wall" #-Xptxas -v
LDFLAGS       ?=
DOXYGEN       ?= doxygen
PYBUILDFLAGS   ?=
PYINSTALLFLAGS ?=

#GPU_ARCHS     ?= 30 32 35 37 50 52 53 # Nap time!
#GPU_ARCHS     ?= 35 52
GPU_ARCHS     ?= 35 61

CUDA_HOME     ?= /usr/local/cuda
CUDA_LIBDIR   ?= $(CUDA_HOME)/lib
CUDA_LIBDIR64 ?= $(CUDA_HOME)/lib64
CUDA_INCDIR   ?= $(CUDA_HOME)/include

ALIGNMENT ?= 4096 # Memory allocation alignment

#NODEBUG    = 1 # Disable debugging mode (use this for production releases)
#TRACE      = 1 # Enable tracing mode (generates annotations for use with nvprof/nvvp)
#NOCUDA     = 1 # Disable CUDA support
#ANY_ARCH   = 1 # Disable native architecture compilation
#CUDA_DEBUG = 1 # Enable CUDA debugging (nvcc -G)
#NUMA       = 1 # Enable use of numa library for setting affinity of ring memory
#HWLOC      = 1 # Enable use of hwloc library for memory binding in udp_capture
#VMA        = 1 # Enable use of Mellanox libvma in udp_capture

Change compiler flag -Wpedantic to -pedantic

CXX           ?= g++
NVCC          ?= nvcc
LINKER        ?= g++
CPPFLAGS      ?=
CXXFLAGS      ?= -O3 -Wall -pedantic
NVCCFLAGS     ?= -O3 -Xcompiler "-Wall" #-Xptxas -v
LDFLAGS       ?=
DOXYGEN       ?= doxygen
PYBUILDFLAGS   ?=
PYINSTALLFLAGS ?=

#GPU_ARCHS     ?= 30 32 35 37 50 52 53 # Nap time!
#GPU_ARCHS     ?= 35 52
GPU_ARCHS     ?= 35 61

CUDA_HOME     ?= /usr/local/cuda
CUDA_LIBDIR   ?= $(CUDA_HOME)/lib
CUDA_LIBDIR64 ?= $(CUDA_HOME)/lib64
CUDA_INCDIR   ?= $(CUDA_HOME)/include

ALIGNMENT ?= 4096 # Memory allocation alignment

#NODEBUG    = 1 # Disable debugging mode (use this for production releases)
#TRACE      = 1 # Enable tracing mode (generates annotations for use with nvprof/nvvp)
#NOCUDA     = 1 # Disable CUDA support
#ANY_ARCH   = 1 # Disable native architecture compilation
#CUDA_DEBUG = 1 # Enable CUDA debugging (nvcc -G)
#NUMA       = 1 # Enable use of numa library for setting affinity of ring memory
#HWLOC      = 1 # Enable use of hwloc library for memory binding in udp_capture
#VMA        = 1 # Enable use of Mellanox libvma in udp_capture


# VARIABLES #

# Define the command for returning a citation reference:
LINKS_INSERT ?= $(NODE) $(TOOLS_DIR)/links/create/bin/cli

# Define the command-line options to be used when executing the command:
LINKS_INSERT_FLAGS ?= \
	--database $(ROOT_DIR)/docs/links/database.json

# TARGETS #

# Create a link entry.
#
# This target creates a link entry in the link database.

links-insert: $(NODE_MODULES)
	$(QUIET) $(LINKS_INSERT) $(LINKS_INSERT_FLAGS)

.PHONY: links-insert

Add recipe to resolving a link id

# VARIABLES #

# Define the command for inserting a link into the database:
LINKS_INSERT ?= $(NODE) $(TOOLS_DIR)/links/create/bin/cli

# Define the command-line options to be used when executing the command:
LINKS_INSERT_FLAGS ?= \
	--database $(ROOT_DIR)/docs/links/database.json

# Define the command for resolving an id from a URI:
LINKS_URI2ID ?= $(NODE) $(TOOLS_DIR)/links/uri2id/bin/cli

# Define the command-line options to be used when executing the command:
LINKS_URI2ID_FLAGS ?= \
	--database $(ROOT_DIR)/docs/links/database.json

# TARGETS #

# Create a link entry.
#
# This target creates a link entry in the link database.

links-insert: $(NODE_MODULES)
	$(QUIET) $(LINKS_INSERT) $(LINKS_INSERT_FLAGS)

.PHONY: links-insert

# Resolve a link id.
#
# This target resolves a database link identifier from a URI.

links-uri2id: $(NODE_MODULES)
	$(QUIET) $(LINKS_URI2ID) $(LINKS_URI2ID_FLAGS)

.PHONY: links-uri2id


# Top directory for building complete system, fall back to this directory
ROOTDIR    ?= $(TOPDIR)

# Strip binaries unless user explicitly disables it
STRIPARGS ?= -s --strip-program=$(CROSS)strip -m 0755

# Some junk files we always want to be removed when doing a make clean.
JUNK        = *~ *.bak *.map .*.d *.d DEADJOE semantic.cache *.gdb *.elf core core.*
MAKE       := @$(MAKE)
MAKEFLAGS   = --no-print-directory --silent
CHECK      := cppcheck $(CPPFLAGS) --quiet --enable=all
INSTALL    := install --backup=off
STRIPINST  := $(INSTALL) $(STRIPARGS)
ARFLAGS    := crus

export libdir plugindir incdir ROOTDIR CPPFLAGS LDFLAGS LDLIBS STATIC

# Override default implicit rules
%.o: %.c
	@printf "  CC      $(subst $(ROOTDIR)/,,$(shell pwd)/$@)\n"
	@$(CC) $(CFLAGS) $(CPPFLAGS) -c -MMD -MP -o $@ $<

%: %.o
	@printf "  LINK    $(subst $(ROOTDIR)/,,$(shell pwd)/$@)\n"
	@$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$@.map -o $@ $^ $(LDLIBS$(LDLIBS-$(@)))

%.so: %.o
	@printf "  PLUGIN  $(subst $(ROOTDIR)/,,$(shell pwd)/$@)\n"
	@$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)

Increase indentation in pretty printing slightly for autotools


# $FreeBSD$

MAINTAINER=tyler@freebsd.org

CFLAGS+=-g -I${PWD}/../launchd \
		-I${PWD}/../liblaunch \
		-I/usr/local/include \
		-DDEBUG

.include <bsd.prog.mk>

Add more CFLAGS and warnings to help track down bad code

# $FreeBSD$

MAINTAINER=tyler@freebsd.org

CFLAGS+=-g -fPIC -fno-exceptions -fstack-protector -fvisibility=hidden

# WARNINGS
CFLAGS+=-Wall -Wextra -Wno-unused-parameter \
		-Wno-unused-label -Wformat -Wreturn-type \
		-Wsign-compare -Wmultichar -Winit-self \
		-Wuninitialized -Wno-deprecated -Wformat-security \
		-Werror

# INCLUDES
CFLAGS+=-I${PWD}/../launchd \
		-I${PWD}/../liblaunch \
		-I/usr/local/include

# DEFINES
CFLAGS+=-DDEBUG

.include <bsd.prog.mk>


#  Licensed to the Apache Software Foundation (ASF) under one or more
#  contributor license agreements.  See the NOTICE file distributed with
#  this work for additional information regarding copyright ownership.
#  The ASF licenses this file to You under the Apache License, Version 2.0
#  (the "License"); you may not use this file except in compliance with
#  the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

DEFINES += -DFREEBSD -DFREEBSD_X86 -DHYX86 -DNEEDS_SYS_TYPES
OPT += -march=pentium3
OSLIBS = -lc_r -lm

Use pthread not the "deprecated" libc_r on FreeBSD.

#  Licensed to the Apache Software Foundation (ASF) under one or more
#  contributor license agreements.  See the NOTICE file distributed with
#  this work for additional information regarding copyright ownership.
#  The ASF licenses this file to You under the Apache License, Version 2.0
#  (the "License"); you may not use this file except in compliance with
#  the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

DEFINES += -DFREEBSD -DFREEBSD_X86 -DHYX86 -DNEEDS_SYS_TYPES
OPT += -march=pentium3
OSLIBS = -lpthread -lm


DOCKER_COMMON=./common
DOCKER_CIRCUS=./circus
DOCKER_PYTHON_VENV=./python-venv
DOCKER_PYTHON_EXAMPLE=./python-example
DOCKER_ARANGO=./arangodb
DOCKER_NODE=./node
DOCKER_NODE_UNSTABLE=./node-unstable
DOCKER_MARIA=./maria
DOCKER_MEMSQL=./memsql
DOCKER_LEVELDB=./leveldb
DOCKER_MULTILEVEL=./multilevel
DOCKER_LEVELHUD=./levelhud
DOCKER_FTPD=./ftpd
DOCKER_IMAGE_OPTMIN=./image-optmin
DOCKER_ORIENT=./orientdb
DOCKER_NGINX=./nginx
DOCKER_SPIDER=./spidermonkey
DOCKER_MOODLE=./moodle
DOCKER_MOODLE_FTP=./moodle-ftp

Enable oracle-jdk and gocd server images.

DOCKER_COMMON=./common
DOCKER_CIRCUS=./circus
DOCKER_PYTHON_VENV=./python-venv
DOCKER_PYTHON_EXAMPLE=./python-example
DOCKER_ARANGO=./arangodb
DOCKER_NODE=./node
DOCKER_NODE_UNSTABLE=./node-unstable
DOCKER_MARIA=./maria
DOCKER_MEMSQL=./memsql
DOCKER_LEVELDB=./leveldb
DOCKER_MULTILEVEL=./multilevel
DOCKER_LEVELHUD=./levelhud
DOCKER_FTPD=./ftpd
DOCKER_IMAGE_OPTMIN=./image-optmin
DOCKER_ORIENT=./orientdb
DOCKER_NGINX=./nginx
DOCKER_SPIDER=./spidermonkey
DOCKER_MOODLE=./moodle
DOCKER_JDK=./oracle-jdk
DOCKER_GO_SERVER=./gocd-server


DEFAULTGXX:=arm-linux-gnueabihf-g++
DEFAULTGCC:=arm-linux-gnueabihf-gcc
# To explain the extra COMPARE_AND_SWAP arguments, they fix pure
# virtual method and std::thread problems on the Pi.  See here:
# https://groups.google.com/forum/#!msg/automatak-dnp3/Jisp_zGhd5I/ck_Cj6nO8joJ
ARCHFLAGS:=-fPIC -funwind-tables -fno-omit-frame-pointer -funsafe-math-optimizations -mfpu=neon-vfpv4 -ftree-vectorize -Os -I$(BUILD)/$(ARCH)/osdeps/usr/include -I$(BUILD)/$(ARCH)/osdeps/usr/include/arm-linux-gnueabihf $(foreach width,1 2 8,-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_$(width))
PORT_LIBRARY_DIRS := \
	$(BUILD)/$(ARCH)/osdeps/usr/lib/arm-linux-gnueabihf \
	$(BUILD)/$(ARCH)/osdeps/usr/lib \
	$(BUILD)/$(ARCH)/osdeps/lib/arm-linux-gnueabihf \
	$(BUILD)/$(ARCH)/osdeps/usr/lib/lapack \
	$(BUILD)/$(ARCH)/osdeps/usr/lib/libblas

PORT_LINK_FLAGS:=$(foreach dir,$(PORT_LIBRARY_DIRS), -L$(dir) -Wl,--rpath,$(dir))

TCMALLOC_ENABLED:=0
port:=ubuntu1404

Use system libraries for Pi (MLDB-1940)

DEFAULTGXX:=arm-linux-gnueabihf-g++
DEFAULTGCC:=arm-linux-gnueabihf-gcc
# To explain the extra COMPARE_AND_SWAP arguments, they fix pure
# virtual method and std::thread problems on the Pi.  See here:
# https://groups.google.com/forum/#!msg/automatak-dnp3/Jisp_zGhd5I/ck_Cj6nO8joJ
ARCHFLAGS:=-fPIC -funwind-tables -fno-omit-frame-pointer -funsafe-math-optimizations -mfpu=neon-vfpv4 -ftree-vectorize -Os -I$(BUILD)/$(ARCH)/osdeps/usr/include -I$(BUILD)/$(ARCH)/osdeps/usr/include/arm-linux-gnueabihf $(foreach width,1 2 8,-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_$(width))
PORT_LIBRARY_DIRS := \
	$(BUILD)/$(ARCH)/osdeps/usr/lib/arm-linux-gnueabihf \
	$(BUILD)/$(ARCH)/osdeps/usr/lib \
	$(BUILD)/$(ARCH)/osdeps/lib/arm-linux-gnueabihf \
	$(BUILD)/$(ARCH)/osdeps/usr/lib/lapack \
	$(BUILD)/$(ARCH)/osdeps/usr/lib/libblas

PORT_LINK_FLAGS:=$(foreach dir,$(PORT_LIBRARY_DIRS), -L$(dir) -Wl,--rpath-link,$(dir))

TCMALLOC_ENABLED:=0
port:=ubuntu1404


#############################################################
#
# extra-dts
#
#############################################################

# Remember to bump the version when anything changes in this
# directory.
EXTRA_DTS_SOURCE =
EXTRA_DTS_VERSION = 0.0.1
EXTRA_DTS_DEPENDENCIES = host-dtc

define EXTRA_DTS_BUILD_CMDS
	cp $(NERVES_DEFCONFIG_DIR)/package/extra-dts/*.dts* $(@D)
        for filename in $(@D)/*.dts; do \
            $(CPP) -I$(@D) -nostdinc -undef -D__DTS__ -x assembler-with-cpp $$filename | \
              $(HOST_DIR)/usr/bin/dtc -Wno-unit_address_vs_reg -@ -I dts -O dtb -b 0 -o $${filename%.dts}.dtbo || exit 1; \
        done
endef

define EXTRA_DTS_INSTALL_TARGET_CMDS
        cp $(@D)/*.dtbo $(TARGET_DIR)/lib/firmware
endef

$(eval $(generic-package))

Allow kernel includes for device tree overlays

#############################################################
#
# extra-dts
#
#############################################################

# Remember to bump the version when anything changes in this
# directory.
EXTRA_DTS_SOURCE =
EXTRA_DTS_VERSION = 0.0.2
EXTRA_DTS_DEPENDENCIES = host-dtc

define EXTRA_DTS_BUILD_CMDS
	cp $(NERVES_DEFCONFIG_DIR)/package/extra-dts/*.dts* $(@D)
        for filename in $(@D)/*.dts; do \
            $(CPP) -I$(@D) -I $(LINUX_SRCDIR)include -I $(LINUX_SRCDIR)arch -nostdinc -undef -D__DTS__ -x assembler-with-cpp $$filename | \
              $(HOST_DIR)/usr/bin/dtc -Wno-unit_address_vs_reg -@ -I dts -O dtb -b 0 -o $${filename%.dts}.dtbo || exit 1; \
        done
endef

define EXTRA_DTS_INSTALL_TARGET_CMDS
        cp $(@D)/*.dtbo $(TARGET_DIR)/lib/firmware
endef

$(eval $(generic-package))


# dmenu version
VERSION = 4.5p

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

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

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

# Xft, comment if you don't want it
XFTINC = -I/usr/include/freetype2
XFTLIBS  = -lXft -lXrender -lfreetype -lz -lfontconfig

# includes and libs
INCS = -I${X11INC} ${XFTINC}
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${XFTLIBS}

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

# compiler and linker
CC = cc

Add path to X11 libraries for Mac OS X

# dmenu version
VERSION = 4.5p

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

X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
# on mac os x
#X11INC = /opt/X11/include
#X11LIB = /opt/X11/lib

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

# Xft, comment if you don't want it
XFTINC = -I/usr/include/freetype2
XFTLIBS  = -lXft -lXrender -lfreetype -lz -lfontconfig

# includes and libs
INCS = -I${X11INC} ${XFTINC}
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${XFTLIBS}

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

# compiler and linker
CC = cc


LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_PATH :=

LOCAL_SRC_FILES := \
        main.cpp

LOCAL_MODULE := remote-process

LOCAL_MODULE_TAGS := optional

TARGET_ERROR_FLAGS += -Wno-non-virtual-dtor

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

LOCAL_C_INCLUDES += $(LOCAL_PATH)/../remote-processor/

LOCAL_SHARED_LIBRARIES := libstlport libicuuc libremote-processor
LOCAL_STATIC_LIBRARIES :=

LOCAL_LDLIBS +=
LOCAL_LDFLAGS +=

include $(BUILD_EXECUTABLE)

Add support for host build

LOCAL_PATH := $(call my-dir)

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

COMMON_SRC_FILES := \
        main.cpp

COMMON_MODULE := remote-process
COMMON_MODULE_TAGS := optional

COMMON_ERROR_FLAGS := -Wno-non-virtual-dtor

COMMON_C_INCLUDES := \
    $(LOCAL_PATH)/../remote-processor/

COMMON_SHARED_LIBRARIES := libremote-processor

#############################
# 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 += \
    $(COMMON_C_INCLUDES) \
    external/stlport/stlport/ \
    bionic/libstdc++ \
    bionic/

LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES) libstlport

include $(BUILD_EXECUTABLE)

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

include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(COMMON_SRC_FILES)

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

TARGET_ERROR_FLAGS += $(COMMON_ERROR_FLAGS)

LOCAL_C_INCLUDES += \
    $(COMMON_C_INCLUDES)

LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)

include $(BUILD_HOST_EXECUTABLE)


RUDIX_UNIVERSAL=yes
RUDIX_DISABLE_DEPENDENCY_TRACKING=yes
RUDIX_SAVE_CONFIGURE_CACHE=yes
RUDIX_STRIP_PACKAGE=yes
#RUDIX_ENABLE_NLS=yes

Set global config to use NLS and build with static lib (when available).

RUDIX_UNIVERSAL=yes
RUDIX_DISABLE_DEPENDENCY_TRACKING=yes
RUDIX_SAVE_CONFIGURE_CACHE=yes
RUDIX_STRIP_PACKAGE=yes
RUDIX_ENABLE_NLS=yes
RUDIX_BUILD_WITH_STATIC_LIB=yes


# $FreeBSD$

CFLAGS+=-Werror -I${PWD}/../src -I${PWD}/../liblaunch

.include <bsd.prog.mk>

Add /usr/local/include to all Makefiles, god place to pick up uuid/uuid.h

# $FreeBSD$

CFLAGS+=-Werror -g -I${PWD}/../src \
		-I${PWD}/../liblaunch \
		-I/usr/local/include

.include <bsd.prog.mk>


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

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

all:: ${SHLIB_NAME}

clean::
	rm -f ${OBJS} ${SHLIB_NAME}

distclean:: clean
	rm -f config.h

install:: all
	mkdir -p ${INSTALLDIR}
	install -c -o ${DSTUSR} -g ${DSTGRP} -m 444 ${SHLIB_NAME} ${INSTALLDIR}
	$(SILENT)../pkg_mkindex.tcl ${INSTALLDIR}

Make Pextlib.dylib depend on config.h

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

$(SHLIB_NAME):: ${OBJS} config.h
	${SHLIB_LD} ${OBJS} -o ${SHLIB_NAME} ${TCL_STUB_LIB_SPEC} ${LIBS}

all:: ${SHLIB_NAME}

clean::
	rm -f ${OBJS} ${SHLIB_NAME}

distclean:: clean
	rm -f config.h

install:: all
	mkdir -p ${INSTALLDIR}
	install -c -o ${DSTUSR} -g ${DSTGRP} -m 444 ${SHLIB_NAME} ${INSTALLDIR}
	$(SILENT)../pkg_mkindex.tcl ${INSTALLDIR}


###
#default: all
SHELL = /bin/bash
ifdef SLURMMASTER
	SHELL=srun
	.SHELLFLAGS= -N1 --cpus-per-task=1 bash -c
endif
$(info $(SHELL))
USR = $(shell whoami)
INCLMK =
include $(INCLMK)
### may override on cl
GZTAB=1
PREFIX =
SUFFIX =
PROJ = mktest
INDIR = .
OUTDIR = .
LOGDIR = $(OUTDIR)
TMPDIR = /tmp/$(USR)/$(PROJ)
###
inFile = $(wildcard $(INDIR)/$(PREFIX)*$(SUFFIX))
#$(info $(inBam))
o0 = $(addprefix $(OUTDIR)/, $(patsubst %$(SUFFIX),%-norm$(SUFFIX),$(notdir $(inFile))))
#$(info $(o0))
.DELETE_ON_ERROR:

all: $(o0)

ifeq ($(GZTAB),1)
$(OUTDIR)/%-norm$(SUFFIX): $(INDIR)/%$(SUFFIX)
	mkdir -p $(LOGDIR)
	mkdir -p $(TMPDIR)
	mkdir -p $(OUTDIR)
	$(VT) normalize -r $(GENOMEREF) -q -o - $< | bgzip > $@
	$(TABIX) -p vcf $@
else
$(OUTDIR)/%-norm$(SUFFIX): $(INDIR)/%$(SUFFIX)
	mkdir -p $(LOGDIR)
	mkdir -p $(TMPDIR)
	mkdir -p $(OUTDIR)
	$(VT) normalize -r $(GENOMEREF) -q -o $@ $<
endif

Revert "Added references to vt,tabix and bgzip so that only paths in include.mk need to be updated"

###
#default: all
SHELL = /bin/bash
ifdef SLURMMASTER
	SHELL=srun
	.SHELLFLAGS= -N1 --cpus-per-task=1 bash -c
endif
$(info $(SHELL))
USR = $(shell whoami)
INCLMK =
include $(INCLMK)
### may override on cl
GZTAB=1
PREFIX =
SUFFIX =
PROJ = mktest
INDIR = .
OUTDIR = .
LOGDIR = $(OUTDIR)
TMPDIR = /tmp/$(USR)/$(PROJ)
###
inFile = $(wildcard $(INDIR)/$(PREFIX)*$(SUFFIX))
#$(info $(inBam))
o0 = $(addprefix $(OUTDIR)/, $(patsubst %$(SUFFIX),%-norm$(SUFFIX),$(notdir $(inFile))))
#$(info $(o0))
.DELETE_ON_ERROR:

all: $(o0)

ifeq ($(GZTAB),1)
$(OUTDIR)/%-norm$(SUFFIX): $(INDIR)/%$(SUFFIX)
	mkdir -p $(LOGDIR)
	mkdir -p $(TMPDIR)
	mkdir -p $(OUTDIR)
	vt normalize -r $(GENOMEREF) -q -o - $< | bgzip > $@
	tabix -p vcf $@
else
$(OUTDIR)/%-norm$(SUFFIX): $(INDIR)/%$(SUFFIX)
	mkdir -p $(LOGDIR)
	mkdir -p $(TMPDIR)
	mkdir -p $(OUTDIR)
	vt normalize -r $(GENOMEREF) -q -o $@ $<
endif


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

darwin_CFLAGS=-pipe
darwin_CXXFLAGS=$(darwin_CFLAGS)

darwin_release_CFLAGS=-O2
darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)

darwin_debug_CFLAGS=-O1
darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS)

darwin_native_toolchain=native_cctools

Revert "update oxx sdk min version"

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

darwin_CFLAGS=-pipe
darwin_CXXFLAGS=$(darwin_CFLAGS)

darwin_release_CFLAGS=-O2
darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)

darwin_debug_CFLAGS=-O1
darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS)

darwin_native_toolchain=native_cctools


dist_libuobject_la_SOURCES +=			\
  $(coroutines_sources)				\
  scheduler/exception.hh			\
  scheduler/exception.hxx			\
  scheduler/fwd.hh				\
  scheduler/job.cc				\
  scheduler/job.hh				\
  scheduler/job.hxx				\
  scheduler/pthread-coro.cc			\
  scheduler/pthread-coro.hh			\
  scheduler/pthread-coro.hxx			\
  scheduler/scheduler.cc			\
  scheduler/scheduler.hh			\
  scheduler/scheduler.hxx			\
  scheduler/tag.cc				\
  scheduler/tag.hh				\
  scheduler/tag.hxx

coroutines_sources = 				\
  scheduler/coroutine.hh			\
  scheduler/coroutine.hxx

Add missing end-of-line at end-of-file.


INSTANCE_ID = elemoine
VARS_FILE = vars_${INSTANCE_ID}.yaml
PRINT_OUTPUT = /tmp
DISABLE_BUILD_RULES = apache

include geoportailv3.mk

.PHONY: dbtunnel
dbtunnel:
	@echo "Opening tunnel…"
	ssh -N -L 9999:localhost:5432 luxembourg-geomapfish.infra.internal

.PHONY: watchless
watchless:
	@echo "Watching changes to less files…"
	nosier -p geoportailv3/static/less "make -f elemoine.mk geoportailv3/static/build/build.css"

Use a better way to disable print target

INSTANCE_ID = elemoine
VARS_FILE = vars_${INSTANCE_ID}.yaml
DISABLE_BUILD_RULES = apache print

include geoportailv3.mk

.PHONY: dbtunnel
dbtunnel:
	@echo "Opening tunnel…"
	ssh -N -L 9999:localhost:5432 luxembourg-geomapfish.infra.internal

.PHONY: watchless
watchless:
	@echo "Watching changes to less files…"
	nosier -p geoportailv3/static/less "make -f elemoine.mk geoportailv3/static/build/build.css"


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

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ

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

CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB

CIRCUITPY_MODULE=wroom

Update vendor ID for Espressif ESP32S2 Modules

USB_VID = 0x303A
USB_PID = 0x80AA
USB_PRODUCT = "Franzininho WIFI w/Wroom"
USB_MANUFACTURER = "Espressif"

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ

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

CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB

CIRCUITPY_MODULE=wroom


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p10/procedures/hwp/corecache/p10_hcd_core_poweroff.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 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=p10_hcd_core_poweroff
OBJS += p10_hcd_corecache_power_control.o
#lib$(PROCEDURE)_COMMONFLAGS += -DPFET_SENSE_POLL_DISABLE
$(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p10/common/include)
$(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p10/procedures/hwp/lib)
$(call BUILD_PROCEDURE)

Revert "Disable PFET checking in QME (until drop Z)"

# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p10/procedures/hwp/corecache/p10_hcd_core_poweroff.mk $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2019,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_hcd_core_poweroff
OBJS += p10_hcd_corecache_power_control.o
lib$(PROCEDURE)_COMMONFLAGS += -DPFET_SENSE_POLL_DISABLE
$(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p10/common/include)
$(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p10/procedures/hwp/lib)
$(call BUILD_PROCEDURE)


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

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

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

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

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

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

Fix download link for gitian builds

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

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

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

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

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

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


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

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

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

Allow to specify extra dependencies in py_templatize_dir_rule

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

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

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


#------------------
# LogicBlox Tools
#------------------

BLOXCOMPILER_VERSION := $(shell bloxcompiler -version)

# Compile project command
ifneq (,$(findstring 3.9,$(BLOXCOMPILER_VERSION)))
  define compile-datalog-project
    bloxcompiler -compileProject $1 -outDir $2
  endef
else
  define compile-datalog-project
    bloxcompiler compileProject -outDir $2 $1
  endef
endif

# Execute datalog script command
define deploy-datalog-project
  bloxbatch -script $1
endef

# Disassemble protobuf command
define generate-protobuf-message
  $(info Generating protobuf message file for $1 ...)
  bloxdisassembler -p $1 > $2
  $(QUIET) cut-protobuf-message.sh $2 > tmp.pb
  $(QUIET) mv tmp.pb $2
endef

Deal with constantly changing LB cli.

#------------------
# LogicBlox Tools
#------------------

BLOXCOMPILER_VERSION := $(shell bloxcompiler -version 2>/dev/null || bloxcompiler version)

# Compile project command
ifneq (,$(findstring 3.9,$(BLOXCOMPILER_VERSION)))
  define compile-datalog-project
    bloxcompiler -compileProject $1 -outDir $2
  endef
else
  define compile-datalog-project
    bloxcompiler compileProject -outDir $2 $1
  endef
endif

# Execute datalog script command
define deploy-datalog-project
  bloxbatch -script $1
endef

# Disassemble protobuf command
define generate-protobuf-message
  $(info Generating protobuf message file for $1 ...)
  bloxdisassembler -p $1 > $2
  $(QUIET) cut-protobuf-message.sh $2 > tmp.pb
  $(QUIET) mv tmp.pb $2
endef


# VARIABLES #

# Define the path of the linter executable:
FILENAME_LINTER ?= $(TOOLS_DIR)/lint/filenames/lint.sh

# TARGETS #

# Lint filenames.
#
# This target lints filenames.

lint-filenames:
	chmod +x $(FILENAME_LINTER)
	$(FILENAME_LINTER)

.PHONY: lint-filenames

Update recipe to use variable

# VARIABLES #

# Define the command for setting executable permissions:
MAKE_EXECUTABLE ?= chmod +x

# Define the path of the linter executable:
FILENAME_LINTER ?= $(TOOLS_DIR)/lint/filenames/lint.sh

# TARGETS #

# Lint filenames.
#
# This target lints filenames.

lint-filenames:
	$(MAKE_EXECUTABLE) $(FILENAME_LINTER)
	$(FILENAME_LINTER)

.PHONY: lint-filenames


TOOLPATH ?= $(shell \
sh -c "if [ -d /usr/include/linux ]; then echo /usr/bin; \
      else echo; fi" \
)

# Get the $(CFLAGSENV), $(CXXFLAGSENV), $(LDFLAGSENV)
include $(OPENMRNPATH)/etc/env.mk

CC = gcc
CXX = g++
AR = ar
LD = g++

HOST_TARGET := 1

STARTGROUP := -Wl,--start-group
ENDGROUP := -Wl,--end-group

ARCHOPTIMIZATION = -g -O0 -m32

CSHAREDFLAGS = -c $(ARCHOPTIMIZATION) -Wall -Werror -MD -MP -m32 -fno-stack-protector -D_GNU_SOURCE

CFLAGS = $(CSHAREDFLAGS) -std=gnu99

CXXFLAGS = $(CSHAREDFLAGS) -std=c++0x -D__STDC_FORMAT_MACROS \
           -D__STDC_LIMIT_MACROS #-D__LINEAR_MAP__

LDFLAGS = -g -m32 -pg -Wl,-Map="$(@:%=%.map)"
SYSLIBRARIES = -lrt -lpthread

EXTENTION =

Test out a new console under Linux target only for now.

TOOLPATH ?= $(shell \
sh -c "if [ -d /usr/include/linux ]; then echo /usr/bin; \
      else echo; fi" \
)

# Get the $(CFLAGSENV), $(CXXFLAGSENV), $(LDFLAGSENV)
include $(OPENMRNPATH)/etc/env.mk

CC = gcc
CXX = g++
AR = ar
LD = g++

HOST_TARGET := 1

STARTGROUP := -Wl,--start-group
ENDGROUP := -Wl,--end-group

ARCHOPTIMIZATION = -g -O0 -m32

CSHAREDFLAGS = -c $(ARCHOPTIMIZATION) -Wall -Werror -MD -MP -m32 -fno-stack-protector -D_GNU_SOURCE

CFLAGS = $(CSHAREDFLAGS) -std=gnu99

CXXFLAGS = $(CSHAREDFLAGS) -std=c++0x -D__STDC_FORMAT_MACROS \
           -D__STDC_LIMIT_MACROS #-D__LINEAR_MAP__

LDFLAGS = -g -m32 -pg -Wl,-Map="$(@:%=%.map)"
SYSLIB_SUBDIRS += console
SYSLIBRARIES = -lrt -lpthread -lconsole

EXTENTION =


MCU_SERIES = h7
CMSIS_MCU = STM32H743xx
MICROPY_FLOAT_IMPL = double
AF_FILE = boards/stm32h743_af.csv
LD_FILES = boards/stm32h743.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08040000

Add config options to support mboot.

USE_MBOOT ?= 0

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

ifeq ($(USE_MBOOT),1)
# When using Mboot all the text goes together after the filesystem
LD_FILES = boards/stm32h743.ld boards/common_blifs.ld
TEXT0_ADDR = 0x08040000
else
# When not using Mboot the ISR text goes first, then the rest after the filesystem
LD_FILES = boards/stm32h743.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08040000
endif


all:

install: all simpleinstall
uninstall: simpleuninstall

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

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

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

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

Fix installation broken 2 commits prior.

all:

install: all simpleinstall
uninstall: simpleuninstall

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

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

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

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


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

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

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

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

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

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

Make sure the line added to end of .dockerfile has a newline in front

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

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

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

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

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

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


# Function:    timing
# Description: Measure the execution time of a command a put it in a file
# Argument $1: Command (in a string) to execute and time
# Argument $2: File where the timing should be stored
define timing
	@start=$$(date +%s); \
	eval $(1); \
	end=$$(date +%s); \
	T=$$(($$end-$$start)); \
	printf "$$T" > $(2);
endef

# Binary arguments
ITER=200000

Store LUPS computed by the LBM simulation side by side with the execution time

# Function:    timing
# Description: Store the execution time and LUPS of a LBM simulation in a file
# Argument $1: LBM simulation command (in a string) to execute
# Argument $2: File where the timing and lups are stored
define timing
	@start=$$(date +%s); \
	echo $$(eval "$(1)" | sed -n 's/average lups: \(.*\).*/\1/p') > $(2); \
	end=$$(date +%s); \
	T=$$(($$end-$$start)); \
	printf "$$T" >> $(2);
endef

# Binary arguments
ITER=200000


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

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

Allow the use of local libraries for native

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

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


# src/bin/psql/nls.mk
CATALOG_NAME     = psql
AVAIL_LANGUAGES  = cs de es fr ja pt_BR sv tr zh_CN zh_TW
GETTEXT_FILES    = command.c common.c copy.c help.c input.c large_obj.c \
                   mainloop.c print.c psqlscan.c startup.c describe.c sql_help.h sql_help.c \
                   tab-complete.c variable.c \
                   ../../port/exec.c
GETTEXT_TRIGGERS = N_ psql_error simple_prompt
GETTEXT_FLAGS    = psql_error:1:c-format

Fix recently introduced typo in NLS file lists

# src/bin/psql/nls.mk
CATALOG_NAME     = psql
AVAIL_LANGUAGES  = cs de es fr ja pt_BR sv tr zh_CN zh_TW
GETTEXT_FILES    = command.c common.c copy.c help.c input.c large_obj.c \
                   mainloop.c print.c psqlscan.c startup.c describe.c sql_help.h sql_help.c \
                   tab-complete.c variables.c \
                   ../../port/exec.c
GETTEXT_TRIGGERS = N_ psql_error simple_prompt
GETTEXT_FLAGS    = psql_error:1:c-format


LOCAL_PATH := $(call my-dir)

common_cflags := \
	-DANDROID \
	-DHAVE_CONFIG_H

LIBUSB_PATH := $(LOCAL_PATH)/../libusb

include $(CLEAR_VARS)
LOCAL_C_INCLUDES := \
	$(LOCAL_PATH) \
	$(LOCAL_PATH)/src \
	$(PCSC_PATH)/src/PCSC \
	$(LIBUSB_PATH) \

LOCAL_SRC_FILES:= \
	src/ccid.c \
        src/commands.c \
        src/ifdhandler.c \
        src/utils.c \
        src/ccid_usb.c \
        src/towitoko/atr.c \
        src/towitoko/pps.c \
        src/openct/buffer.c \
        src/openct/checksum.c \
        src/openct/proto-t1.c \
        src/tokenparser.c \
        src/strlcpy.c \
        src/simclist.c \
        src/debug.c

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/

LOCAL_MODULE_TAGS = eng
LOCAL_MODULE:= libccid
LOCAL_SHARED_LIBRARIES := libc libdl libpcsclite
LOCAL_STATIC_LIBRARIES := libusb
LOCAL_PRELINK_MODULE := false
include $(BUILD_SHARED_LIBRARY)

Move external libraries to ldlibs remove pcsclite

LOCAL_PATH := $(call my-dir)

common_cflags := \
	-DANDROID \
	-DHAVE_CONFIG_H

LIBUSB_PATH := $(LOCAL_PATH)/../libusb

include $(CLEAR_VARS)
LOCAL_C_INCLUDES := \
	$(LOCAL_PATH) \
	$(LOCAL_PATH)/src \
	$(PCSC_PATH)/src/PCSC \
	$(LIBUSB_PATH) \

LOCAL_SRC_FILES:= \
	src/ccid.c \
        src/commands.c \
        src/ifdhandler.c \
        src/utils.c \
        src/ccid_usb.c \
        src/towitoko/atr.c \
        src/towitoko/pps.c \
        src/openct/buffer.c \
        src/openct/checksum.c \
        src/openct/proto-t1.c \
        src/tokenparser.c \
        src/strlcpy.c \
        src/simclist.c \
        src/debug.c

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/

LOCAL_MODULE_TAGS = eng
LOCAL_MODULE:= libccid
LOCAL_LDLIBS := -llog -ldl -lc
LOCAL_SHARED_LIBRARIES :=
LOCAL_STATIC_LIBRARIES := libusb
LOCAL_PRELINK_MODULE := false
include $(BUILD_SHARED_LIBRARY)


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

# Copyright 2008 Roy Marples

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

include ${MK}/sys.mk
# Some systems don't include /lib in their standard link path
# so we should embed it if different
# This is currently hardcoded for NetBSD which has two dynamic linkers
# and we need to use the one in /libexec instead of /usr/libexec
_DYNLINK_SH=		if test -e /libexec/ld.elf_so; then \
				echo "-Wl,-dynamic-linker=/libexec/ld.elf_so"; \
			fi
_DYNLINK!=		${_DYNLINK_SH}
LDFLAGS+=		${_DYNLINK}$(shell ${_DYNLINK_SH})
LDFLAGS+=		-Wl,-rpath=/${LIBNAME} -L/${LIBNAME}
LDFLAGS+=		${PROGLDFLAGS}

all: depend ${PROG}

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

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

include ${MK}/depend.mk

Fix pmake requiring some output here.

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

# Copyright 2008 Roy Marples

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

include ${MK}/sys.mk
# Some systems don't include /lib in their standard link path
# so we should embed it if different
# This is currently hardcoded for NetBSD which has two dynamic linkers
# and we need to use the one in /libexec instead of /usr/libexec
_DYNLINK_SH=		if test -e /libexec/ld.elf_so; then \
				echo "-Wl,-dynamic-linker=/libexec/ld.elf_so"; \
			else \
				echo ""; \
			fi
_DYNLINK!=		${_DYNLINK_SH}
LDFLAGS+=		${_DYNLINK}$(shell ${_DYNLINK_SH})
LDFLAGS+=		-Wl,-rpath=/${LIBNAME} -L/${LIBNAME}
LDFLAGS+=		${PROGLDFLAGS}

all: depend ${PROG}

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

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

include ${MK}/depend.mk


# scc version
VERSION = 0.1

## Customize below to fit your system
# TARGETS is defined by a list of backend-arch-abi-sys. First
# element of the list becomes the default target

TARGETS = amd64-sysv-linux-elf \
          i386-sysv-linux-elf \
          amd64-sysv-openbsd-elf

# USEQBE selects QBE by default in the targets that support it
USEQBE = 1

#MKQBE enable build of qbe backends
MKQBE = 1

DRIVER = posix

# Can be c89 or c99
STD = c99

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

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

# for Plan9 add -D_SUSV2_SOURCE
SCC_CFLAGS = $(MOREFLAGS) \
             -g \
             $(CFLAGS)

SCC_LDFLAGS = -L$(LIBDIR)/ $(LDFLAGS)

.s.o:
	$(AS) $< -o $@

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

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

Add define flags for NetBSD

# scc version
VERSION = 0.1

## Customize below to fit your system
# TARGETS is defined by a list of backend-arch-abi-sys. First
# element of the list becomes the default target

TARGETS = amd64-sysv-linux-elf \
          i386-sysv-linux-elf \
          amd64-sysv-openbsd-elf

# USEQBE selects QBE by default in the targets that support it
USEQBE = 1

#MKQBE enable build of qbe backends
MKQBE = 1

DRIVER = posix

# Can be c89 or c99
STD = c99

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

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

# for Plan9 add -D_SUSV2_SOURCE
# for NetBSD add -D_ANSI_SOURCE
SCC_CFLAGS = $(MOREFLAGS) \
             -g \
             $(CFLAGS)

SCC_LDFLAGS = -L$(LIBDIR)/ $(LDFLAGS)

.s.o:
	$(AS) $< -o $@

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

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


# swc: common.mk

.PHONY: build-$(dir)
build-$(dir): $($(dir)_TARGETS)

.PHONY: install-$(dir)
install-$(dir):

.deps/$(dir):
	@mkdir -p "$@"

$(dir)/%.o: $(dir)/%.c | .deps/$(dir)
	$(compile) $($(@D)_CFLAGS) $($(@D)_PACKAGE_CFLAGS)

$(dir)/%.lo: $(dir)/%.c | .deps/$(dir)
	$(compile) -fPIC $($(@D)_CFLAGS) $($(@D)_PACKAGE_CFLAGS)

ifdef $(dir)_PACKAGES
    ifndef $(dir)_PACKAGE_CFLAGS
        $(dir)_PACKAGE_CFLAGS := $(call pkgconfig,$($(dir)_PACKAGES),cflags,CFLAGS)
    endif
    ifndef $(dir)_PACKAGE_LIBS
        $(dir)_PACKAGE_LIBS := $(call pkgconfig,$($(dir)_PACKAGES),libs,LIBS)
    endif
endif

CLEAN_FILES += $($(dir)_TARGETS)

Use a pattern-specific dir variable so we can use it in the rule definitions

# swc: common.mk

.PHONY: build-$(dir)
build-$(dir): $($(dir)_TARGETS)

.PHONY: install-$(dir)
install-$(dir):

.deps/$(dir):
	@mkdir -p "$@"

$(dir)/%: dir := $(dir)

$(dir)/%.o: $(dir)/%.c | .deps/$(dir)
	$(compile) $($(dir)_CFLAGS) $($(dir)_PACKAGE_CFLAGS)

$(dir)/%.lo: $(dir)/%.c | .deps/$(dir)
	$(compile) -fPIC $($(dir)_CFLAGS) $($(dir)_PACKAGE_CFLAGS)

ifdef $(dir)_PACKAGES
    ifndef $(dir)_PACKAGE_CFLAGS
        $(dir)_PACKAGE_CFLAGS := $(call pkgconfig,$($(dir)_PACKAGES),cflags,CFLAGS)
    endif
    ifndef $(dir)_PACKAGE_LIBS
        $(dir)_PACKAGE_LIBS := $(call pkgconfig,$($(dir)_PACKAGES),libs,LIBS)
    endif
endif

CLEAN_FILES += $($(dir)_TARGETS)


CLANG_VERSION ?= 3.6
ABIS ?= armeabi-v7a armeabi-v7a-hard x86 mips x86_64

Add 'armeabi', 'arm64-v8a' and 'mips64' to list of default ABIs

CLANG_VERSION ?= 3.6
ABIS ?= armeabi armeabi-v7a armeabi-v7a-hard x86 mips arm64-v8a x86_64 mips64


GMP_INCLUDE_DIR :=
CC              :=gcc
CABAL           :=cabal
CABALFLAGS	:=-f Java
## Enable Java RTS:
#CABALFLAGS    :=-f Java

Make no java default compilation method

GMP_INCLUDE_DIR :=
CC              :=gcc
CABAL           :=cabal
CABALFLAGS	:=
## Enable Java RTS:
#CABALFLAGS    :=-f Java


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

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

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


LOCAL_DIR := $(GET_LOCAL_DIR)

MODULE := $(LOCAL_DIR)

STM32_CHIP := stm32f756

PLATFORM := stm32f7xx

SDRAM_SIZE := 0x00800000
SDRAM_BASE := 0xc0000000

GLOBAL_DEFINES += \
    ENABLE_UART3=1 \
    ENABLE_SDRAM=1 \
    USE_HSE_XTAL=1 \
    SDRAM_BASE=$(SDRAM_BASE) \
    SDRAM_SIZE=$(SDRAM_SIZE) \
    PLL_M_VALUE=8 \
    PLL_N_VALUE=336 \
    PLL_P_VALUE=2 \
\
    PKTBUF_POOL_SIZE=16 \
\
    TARGET_HAS_DEBUG_LED=1

GLOBAL_INCLUDES += $(LOCAL_DIR)/include

MODULE_SRCS += \
    $(LOCAL_DIR)/init.c \
    $(LOCAL_DIR)/usb.c \

MODULE_DEPS += \
    dev/usb

include make/module.mk

Add sensorbus back to dartuino deps

LOCAL_DIR := $(GET_LOCAL_DIR)

MODULE := $(LOCAL_DIR)

STM32_CHIP := stm32f756

PLATFORM := stm32f7xx

SDRAM_SIZE := 0x00800000
SDRAM_BASE := 0xc0000000

GLOBAL_DEFINES += \
    ENABLE_UART3=1 \
    ENABLE_SDRAM=1 \
    USE_HSE_XTAL=1 \
    SDRAM_BASE=$(SDRAM_BASE) \
    SDRAM_SIZE=$(SDRAM_SIZE) \
    PLL_M_VALUE=8 \
    PLL_N_VALUE=336 \
    PLL_P_VALUE=2 \
\
    PKTBUF_POOL_SIZE=16 \
\
    TARGET_HAS_DEBUG_LED=1

GLOBAL_INCLUDES += $(LOCAL_DIR)/include

MODULE_SRCS += \
    $(LOCAL_DIR)/init.c \
    $(LOCAL_DIR)/sensor_bus.c \
    $(LOCAL_DIR)/usb.c \

MODULE_DEPS += \
    dev/usb

include make/module.mk


###########################################
## A thin wrapper around BUILD_EXECUTABLE
## Common flags for native tests are added.
###########################################

LOCAL_CFLAGS += -DGTEST_OS_LINUX -DGTEST_HAS_STD_STRING
LOCAL_C_INCLUDES += bionic \
                    bionic/libstdc++/include \
                    external/gtest/include \
                    external/stlport/stlport
LOCAL_STATIC_LIBRARIES += libgtest libgtest_main
LOCAL_SHARED_LIBRARIES += libstlport

ifndef LOCAL_MODULE_PATH
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
endif

include $(BUILD_EXECUTABLE)

Define the proper macro "GTEST_OS_LINUX_ANDROID" for native tests.

###########################################
## A thin wrapper around BUILD_EXECUTABLE
## Common flags for native tests are added.
###########################################

LOCAL_CFLAGS += -DGTEST_OS_LINUX_ANDROID -DGTEST_HAS_STD_STRING
LOCAL_C_INCLUDES += bionic \
                    bionic/libstdc++/include \
                    external/gtest/include \
                    external/stlport/stlport
LOCAL_STATIC_LIBRARIES += libgtest libgtest_main
LOCAL_SHARED_LIBRARIES += libstlport

ifndef LOCAL_MODULE_PATH
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
endif

include $(BUILD_EXECUTABLE)


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

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

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

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

include $(BUILD_HOST_JAVA_LIBRARY)

Fix dependency in runner tests. am: 0f87ba807a

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

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

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

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

include $(BUILD_HOST_JAVA_LIBRARY)


$(call setup-stamp-file,UFH_STAMP)

STAGE1_USR_STAMPS += $(UFH_STAMP)

$(call forward-vars,$(UFH_STAMP), \
	ACIROOTFSDIR)
$(UFH_STAMP): | $(ACIROOTFSDIR)
	ln -sf 'host' "$(ACIROOTFSDIR)/flavor"
	touch "$@"

CLEAN_SYMLINKS += $(ACIROOTFSDIR)/flavor

$(call undefine-namespaces,UFH)

Move host flavor to common variables

$(call setup-stamp-file,UFH_STAMP)

S1_RF_USR_STAMPS += $(UFH_STAMP)

$(call forward-vars,$(UFH_STAMP), \
	S1_RF_ACIROOTFSDIR)
$(UFH_STAMP): | $(S1_RF_ACIROOTFSDIR)
	ln -sf 'host' "$(S1_RF_ACIROOTFSDIR)/flavor"
	touch "$@"

CLEAN_SYMLINKS += $(S1_RF_ACIROOTFSDIR)/flavor

$(call undefine-namespaces,UFH)


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

LOCAL_PATH := $(call my-dir)

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

Add flag to disable inclusion

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

LOCAL_PATH := $(call my-dir)

ifeq ($(TARGET_USES_STAGEFRIGHT_PLUGINS),true)
include $(call first-makefiles-under,$(LOCAL_PATH))
endif


all:

install: all simpleinstall
uninstall: simpleuninstall

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

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

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

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

Fix installation broken 2 commits prior.

all:

install: all simpleinstall
uninstall: simpleuninstall

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

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

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

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


# command plugin makefile - includes others when enabled

ifdef PLUGIN_SAI
include ${P4FACTORY}/submodules/p4c-behavioral/p4c_bm/plugin/sai-plugin.mk
GLOBAL_CFLAGS += -DENABLE_PLUGIN_SAI
endif

ifdef PLUGIN_OPENFLOW
include ${P4FACTORY}/submodules/p4c-behavioral/p4c_bm/plugin/openflow-plugin.mk
BM_PARAMS += -DOPENFLOW_ENABLE
endif

Revert "defining flag OPENFLOW_ENABLE when compiling OF plugin"

# command plugin makefile - includes others when enabled

ifdef PLUGIN_SAI
include ${P4FACTORY}/submodules/p4c-behavioral/p4c_bm/plugin/sai-plugin.mk
GLOBAL_CFLAGS += -DENABLE_PLUGIN_SAI
endif

ifdef PLUGIN_OPENFLOW
include ${P4FACTORY}/submodules/p4c-behavioral/p4c_bm/plugin/openflow-plugin.mk
endif


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

# Device tree file for the Beagleboard:
DTS_FILE ?= armv7/platforms/beagleboard.dts

# Processor flags:
TARGET_CFLAGS  += -mcpu=cortex-a8
TARGET_ASFLAGS += -mcpu=cortex-a8

# Extra configuration for early debugging support:
CONFIG += -DCONFIG_EARLY_DEBUG -DCONFIG_EARLY_DEBUG_ADDRESS=0x49020000

# Early debugging support:
ASSEMBLER_FILES += \
	armv7/platforms/16c750-early.S

Disable early debugging output by default

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

# Device tree file for the Beagleboard:
DTS_FILE ?= armv7/platforms/beagleboard.dts

# Processor flags:
TARGET_CFLAGS  += -mcpu=cortex-a8
TARGET_ASFLAGS += -mcpu=cortex-a8

# Extra configuration for early debugging support:
#CONFIG += -DCONFIG_EARLY_DEBUG -DCONFIG_EARLY_DEBUG_ADDRESS=0x49020000

# Early debugging support:
ASSEMBLER_FILES += \
	armv7/platforms/16c750-early.S


NAME = dwmstatus
VERSION = 1.2

# Customize below to fit your system

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

X11INC = /usr/include/X11
X11LIB = /usr/lib/X11

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

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

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

# compiler and linker
CC = cc

Change directory where dwmstatus installed

NAME = dwmstatus
VERSION = 1.2

# Customize below to fit your system

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

X11INC = /usr/include/X11
X11LIB = /usr/lib/X11

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

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

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

# compiler and linker
CC = cc


utils/haddock_USES_CABAL = YES
utils/haddock_PACKAGE = haddock
utils/haddock_CONFIGURE_OPTS = --flag in-ghc-tree
# XXX This is a temporary hack:
utils/haddock_HC_OPTS += -Wwarn

ifeq "$(Windows)" "YES"
utils/haddock_dist_PROG = haddock
else
utils/haddock_dist_PROG = haddock-real

$(INPLACE_BIN)/haddock: $(INPLACE_BIN)/haddock-real
	$(RM) -f $@
	echo '#!$(SHELL)' >> $@
	echo 'executablename=$(FPTOOLS_TOP_ABS)/$<' >> $@
	echo 'datadir=$(FPTOOLS_TOP_ABS)/inplace/lib' >> $@
	cat utils/haddock/haddock.wrapper >> $@
	$(EXECUTABLE_FILE) $@
endif

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

utils/haddock_dist_MODULES += Paths_haddock

Create inplace/lib/html in the new GHC build system

utils/haddock_USES_CABAL = YES
utils/haddock_PACKAGE = haddock
utils/haddock_CONFIGURE_OPTS = --flag in-ghc-tree
# XXX This is a temporary hack:
utils/haddock_HC_OPTS += -Wwarn

ifeq "$(Windows)" "YES"
utils/haddock_dist_PROG = haddock
else
utils/haddock_dist_PROG = haddock-real

$(INPLACE_BIN)/haddock: $(INPLACE_BIN)/haddock-real
	$(RM) -f $@
	echo '#!$(SHELL)' >> $@
	echo 'executablename=$(FPTOOLS_TOP_ABS)/$<' >> $@
	echo 'datadir=$(FPTOOLS_TOP_ABS)/inplace/lib' >> $@
	cat utils/haddock/haddock.wrapper >> $@
	$(EXECUTABLE_FILE) $@
endif

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

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

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

utils/haddock_dist_MODULES += Paths_haddock


# @configure_input@
###############################################################################
# BRLTTY - A background process providing access to the console screen (when in
#          text mode) for a blind person using a refreshable braille display.
#
# Copyright (C) 1995-2012 by The BRLTTY Developers.
#
# 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; either version 2 of the License, or (at your option) any
# later version. Please see the file LICENSE-GPL for details.
#
# Web Page: http://mielke.cc/brltty/
#
# This software is maintained by Dave Mielke <dave@mielke.cc>.
###############################################################################

SRC_TOP = @top_srcdir@/
SRC_DIR = @srcdir@
VPATH = @srcdir@

BLD_TOP = ./@top_builddir@/
BLD_DIR = @builddir@

include $(SRC_TOP)common.mk

Comment the VPATH line back out again. (dm)

# @configure_input@
###############################################################################
# BRLTTY - A background process providing access to the console screen (when in
#          text mode) for a blind person using a refreshable braille display.
#
# Copyright (C) 1995-2012 by The BRLTTY Developers.
#
# 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; either version 2 of the License, or (at your option) any
# later version. Please see the file LICENSE-GPL for details.
#
# Web Page: http://mielke.cc/brltty/
#
# This software is maintained by Dave Mielke <dave@mielke.cc>.
###############################################################################

SRC_TOP = @top_srcdir@/
SRC_DIR = @srcdir@
# VPATH = @srcdir@

BLD_TOP = ./@top_builddir@/
BLD_DIR = @builddir@

include $(SRC_TOP)common.mk


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_FREQUENCYIO = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_VECTORIO = 0

Disable countio on circuitbrains basic

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


# defaults commands
CC=gcc
RM=rm -f
INSTALL=install
INSTALL_PROGRAM=install -s -m 555
INSTALL_DATA=$(INSTALL) -m 444
INSTALL_SCRIPT=$(INSTALL_PROGRAM)
MKDIR=mkdir -p -m 755
CP=cp

Use CC instead of GCC.

# defaults commands
CC=cc
RM=rm -f
INSTALL=install
INSTALL_PROGRAM=install -s -m 555
INSTALL_DATA=$(INSTALL) -m 444
INSTALL_SCRIPT=$(INSTALL_PROGRAM)
MKDIR=mkdir -p -m 755
CP=cp


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

Add no variable tracking to initfile procedures to imporve build time

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


hal:
	$(CC) $(CFLAGS) $(INC_DIRS) $(TOPDIR)arch/mips/baikal-t1/eth.c -o $(TOPDIR)apps/$(APP)/eth.o
	$(CC) $(CFLAGS) $(INC_DIRS) $(TOPDIR)arch/mips/baikal-t1/platform.c -o $(TOPDIR)apps/$(APP)/platform.o
	$(CC) $(CFLAGS) $(INC_DIRS) $(TOPDIR)arch/mips/baikal-t1/crt0.s -o $(TOPDIR)apps/$(APP)/crt.o

Add default header to the file.

#
#Copyright (c) 2016, prpl Foundation
#
#Permission to use, copy, modify, and/or distribute this software for any purpose with or without
#fee is hereby granted, provided that the above copyright notice and this permission notice appear
#in all copies.
#
#THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
#INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
#FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
#LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
#ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
#This code was written by Carlos Moratelli at Embedded System Group (GSE) at PUCRS/Brazil.

hal:
	$(CC) $(CFLAGS) $(INC_DIRS) $(TOPDIR)arch/mips/baikal-t1/eth.c -o $(TOPDIR)apps/$(APP)/eth.o
	$(CC) $(CFLAGS) $(INC_DIRS) $(TOPDIR)arch/mips/baikal-t1/platform.c -o $(TOPDIR)apps/$(APP)/platform.o
	$(CC) $(CFLAGS) $(INC_DIRS) $(TOPDIR)arch/mips/baikal-t1/crt0.s -o $(TOPDIR)apps/$(APP)/crt.o


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

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


ifndef SOURCES
$(error SOURCES is not set)
endif

SOURCES_C = $(filter %.c,$(SOURCES))
SOURCES_ASM = $(filter %.S,$(SOURCES))
OBJECTS = $(SOURCES_C:%.c=%.o) $(SOURCES_ASM:%.S=%.o)
DEPFILES = $(foreach f,$(SOURCES_C) $(SOURCES_ASM), \
	    $(dir $(f))$(patsubst %.c,.%.D,$(patsubst %.S,.%.D,$(notdir $(f)))))

define emit_dep_rule
CFILE = $(1)
DFILE = $(dir $(1))$(patsubst %.c,.%.D,$(patsubst %.S,.%.D,$(notdir $(1))))
$$(DFILE): $$(CFILE)
	@echo "[DEP] $$(DIR)$$@"
	$(CC) $(CFLAGS) $(CPPFLAGS) -MM -MG $$^ -o $$@
endef

$(foreach file,$(SOURCES),$(eval $(call emit_dep_rule,$(file))))

build-dependencies: $(DEPFILES)

ifeq ($(words $(findstring $(MAKECMDGOALS), download clean distclean)), 0)
  -include $(DEPFILES)
endif

BUILD-FILES += $(OBJECTS)
CLEAN-FILES += $(DEPFILES) $(OBJECTS)
PRECIOUS-FILES += $(OBJECTS)

Fix generated dependency rules to use mimiker toolchain.

ifndef SOURCES
$(error SOURCES is not set)
endif

SOURCES_C = $(filter %.c,$(SOURCES))
SOURCES_ASM = $(filter %.S,$(SOURCES))
OBJECTS = $(SOURCES_C:%.c=%.o) $(SOURCES_ASM:%.S=%.o)
DEPFILES = $(foreach f,$(SOURCES_C) $(SOURCES_ASM), \
	    $(dir $(f))$(patsubst %.c,.%.D,$(patsubst %.S,.%.D,$(notdir $(f)))))

define emit_dep_rule
CFILE = $(1)
DFILE = $(dir $(1))$(patsubst %.c,.%.D,$(patsubst %.S,.%.D,$(notdir $(1))))
$$(DFILE): $$(CFILE)
	@echo "[DEP] $$(DIR)$$@"
	$$(CC) $$(CFLAGS) $$(CPPFLAGS) -MM -MG $$^ -o $$@
endef

$(foreach file,$(SOURCES),$(eval $(call emit_dep_rule,$(file))))

build-dependencies: $(DEPFILES)

ifeq ($(words $(findstring $(MAKECMDGOALS), download clean distclean)), 0)
  -include $(DEPFILES)
endif

BUILD-FILES += $(OBJECTS)
CLEAN-FILES += $(DEPFILES) $(OBJECTS)
PRECIOUS-FILES += $(OBJECTS)


# -*- 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,android/sdremote))

sdremote_DIR := $(call gb_CustomTarget_get_workdir,android/sdremote)

$(call gb_CustomTarget_get_target,android/sdremote) : $(sdremote_DIR)/done

$(sdremote_DIR)/done : $(gb_Helper_PHONY)
	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MAK,1)
	cd $(SRCDIR)/android/sdremote && $(MAKE)

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

Clean first for reliability. Copy the apk so push_nightlies.sh finds it

# -*- 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,android/sdremote))

sdremote_DIR := $(call gb_CustomTarget_get_workdir,android/sdremote)

$(call gb_CustomTarget_get_target,android/sdremote) : $(sdremote_DIR)/done

$(sdremote_DIR)/done : $(gb_Helper_PHONY)
	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MAK,1)
	cd $(SRCDIR)/android/sdremote && $(MAKE) clean && $(MAKE) all
	mkdir -p $(SRCDIR)/instsetoo_native/$(INPATH)/bin
	cp $(SRCDIR)/android/sdremote/bin/ImpressRemote-debug.apk $(SRCDIR)/instsetoo_native/$(INPATH)/bin

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


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

include $(DIR)/path.mk

NIXD_VERSION := 9699b0d35324401326a73b7b5ae88eef8588e45e
NIXD_SHA1SUM := 960a66543ba38b60bbf05d18d108147a0d4dc29a

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

export VENDOR

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

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

Support bash before 4.3 in nixd bootstrapping.

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

include $(DIR)/path.mk

NIXD_VERSION := fa4fc39e7fd8c9a9183684e349c81931326d7523
NIXD_SHA1SUM := b30e0e2927fef8b492223c1daf35e9f818584065

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

export VENDOR

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

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


# -----------------------------------------------------------------------------
#
# (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://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------

$(MKDIRHIER) : utils/mkdirhier/mkdirhier.sh
	-mkdir $(INPLACE)
	-mkdir $(INPLACE_BIN)
	-mkdir $(INPLACE_LIB)
	$(call removeFiles,$@)
	echo '#!$(SHELL)'  		 >> $@
	cat utils/mkdirhier/mkdirhier.sh >> $@
	$(EXECUTABLE_FILE) $@

$(eval $(call all-target,utils/mkdirhier,$(MKDIRHIER)))
$(eval $(call clean-target,utils/mkdirhier,,$(MKDIRHIER)))

Build system: use `mkdir -p` instead of `-mkdir`

# -----------------------------------------------------------------------------
#
# (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://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------

$(MKDIRHIER) : utils/mkdirhier/mkdirhier.sh
	mkdir -p $(INPLACE_BIN)
	mkdir -p $(INPLACE_LIB)
	$(call removeFiles,$@)
	echo '#!$(SHELL)'  		 >> $@
	cat utils/mkdirhier/mkdirhier.sh >> $@
	$(EXECUTABLE_FILE) $@

$(eval $(call all-target,utils/mkdirhier,$(MKDIRHIER)))
$(eval $(call clean-target,utils/mkdirhier,,$(MKDIRHIER)))


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:openh264.def -implib:$(PROJECT_NAME)_dll.lib
EXTRA_LIBRARY=$(PROJECT_NAME)_dll.lib

Fix gtest build error when OS=msvc.

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=1 -DGTEST_USE_OWN_TR1_TUPLE=1
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:openh264.def -implib:$(PROJECT_NAME)_dll.lib
EXTRA_LIBRARY=$(PROJECT_NAME)_dll.lib


.PHONY: format clean all run versionning include

all: $(EXE)

include $(wildcard */rules.mk)

# Object dependency files
-include $(OBJS:%.o=%.d)

$(OUT)/%.o: %.c | $(BUILT_SRCS)
	@echo "CC: $@"
	@mkdir -p $(dir $@)
	@$(CC) $(CFLAGS) -c $< -o $@

%.o: %.c | $(BUILT_SRCS)
	@echo "CC: $@"
	@$(CC) $(CFLAGS) -c $< -o $@

$(OUT)/%.o: %.cpp | $(BUILT_SRCS)
	@echo "CPP: $@"
	@mkdir -p $(dir $@)
	@$(CPP) $(CPPFLAGS) -c $< -o $@

%.o: %.cpp | $(BUILT_SRCS)
	@echo "CPP: $@"
	@$(CPP) $(CPPFLAGS) -c $< -o $@

$(ELF): $(OBJS)
	@mkdir -p $(dir $@)
	@echo "CCLD: $@"
	@+$(CC) $(LDFLAGS) $^ -o $(ELF)

clean:
	@echo "RM: $(OUT)"
	@rm -rf $(OUT)

format:
	@echo "Formatting source using clang-format"
	@clang-format -i -style=file $(SRCS_C) $(SRCS_CPP) $(shell find $(INCLUDE) -name *.h)

include:
	@echo -n $(addprefix -I ,$(INCLUDE) $(INCLUDE_EXT))

.FORCE:

Fix detection of files to format, again

.PHONY: format clean all run versionning include

all: $(EXE)

include $(wildcard */rules.mk)

# Object dependency files
-include $(OBJS:%.o=%.d)

$(OUT)/%.o: %.c | $(BUILT_SRCS)
	@echo "CC: $@"
	@mkdir -p $(dir $@)
	@$(CC) $(CFLAGS) -c $< -o $@

%.o: %.c | $(BUILT_SRCS)
	@echo "CC: $@"
	@$(CC) $(CFLAGS) -c $< -o $@

$(OUT)/%.o: %.cpp | $(BUILT_SRCS)
	@echo "CPP: $@"
	@mkdir -p $(dir $@)
	@$(CPP) $(CPPFLAGS) -c $< -o $@

%.o: %.cpp | $(BUILT_SRCS)
	@echo "CPP: $@"
	@$(CPP) $(CPPFLAGS) -c $< -o $@

$(ELF): $(OBJS)
	@mkdir -p $(dir $@)
	@echo "CCLD: $@"
	@+$(CC) $(LDFLAGS) $^ -o $(ELF)

clean:
	@echo "RM: $(OUT)"
	@rm -rf $(OUT)

format:
	@echo "Formatting source using clang-format"
	@clang-format -i -style=file $(shell git ls-files -c -o --exclude-standard *.c *.cpp *.h)

include:
	@echo -n $(addprefix -I ,$(INCLUDE) $(INCLUDE_EXT))

.FORCE:


# VARIABLES #

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

DAVID ?= $(BIN_DIR)/david

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

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

# TARGETS #

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

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

.PHONY: check-javascript-deps

Update list of ignored deps

# VARIABLES #

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

DAVID ?= $(BIN_DIR)/david

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

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

# TARGETS #

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

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

.PHONY: check-javascript-deps


# -*- makefile -*-
#
#  Common definitions for all systems that use GNU make
#

# Tack the extra deps onto the autogenerated variables
INCFLAGS += -I$(LIBFFI_BUILD_DIR)/include
LOCAL_LIBS += $(LIBFFI)
BUILD_DIR = $(shell pwd)
LIBFFI_CFLAGS = $(FFI_MMAP_EXEC)
LIBFFI_BUILD_DIR = $(BUILD_DIR)/libffi

ifeq ($(srcdir),.)
  LIBFFI_SRC_DIR := $(shell pwd)/libffi
else
  LIBFFI_SRC_DIR := $(srcdir)/libffi
endif

LIBFFI = $(LIBFFI_BUILD_DIR)/.libs/libffi_convenience.a
LIBFFI_CONFIGURE = $(LIBFFI_SRC_DIR)/configure --disable-static \
	--with-pic=yes --disable-dependency-tracking

$(OBJS):	$(LIBFFI)

#
# libffi.mk or libffi.darwin.mk contains rules for building the actual library
#

Use $(abspath ..) so cross compilation works again

# -*- makefile -*-
#
#  Common definitions for all systems that use GNU make
#

# Tack the extra deps onto the autogenerated variables
INCFLAGS += -I$(LIBFFI_BUILD_DIR)/include
LOCAL_LIBS += $(LIBFFI)
BUILD_DIR = $(shell pwd)
LIBFFI_CFLAGS = $(FFI_MMAP_EXEC)
LIBFFI_BUILD_DIR = $(BUILD_DIR)/libffi

ifeq ($(srcdir),.)
  LIBFFI_SRC_DIR := $(shell pwd)/libffi
else
  LIBFFI_SRC_DIR := $(abspath $(srcdir)/libffi)
endif

LIBFFI = $(LIBFFI_BUILD_DIR)/.libs/libffi_convenience.a
LIBFFI_CONFIGURE = $(LIBFFI_SRC_DIR)/configure --disable-static \
	--with-pic=yes --disable-dependency-tracking

$(OBJS):	$(LIBFFI)

#
# libffi.mk or libffi.darwin.mk contains rules for building the actual library
#


# VARIABLES #

# Define the citation:
CITATION ?=

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

# Define the command-line options to be used when executing the command:
CITATION_REFERENCE_FLAGS ?= \
	--database $(ROOT_DIR)/docs/references/bib.bib \
	--csl $(ROOT_DIR)/docs/references/csl/chicago-author-date.csl

# TARGETS #

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

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

.PHONY: citation-reference

Update path in make command

# VARIABLES #

# Define the citation:
CITATION ?=

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

# Define the command-line options to be used when executing the command:
CITATION_REFERENCE_FLAGS ?= \
	--database $(ROOT_DIR)/docs/references/bib.bib \
	--csl $(ROOT_DIR)/docs/references/csl/chicago-author-date.csl

# TARGETS #

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

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

.PHONY: citation-reference


#
# Attitude estimator (Nonlinear SO(3) complementary Filter)
#

MODULE_COMMAND	 = attitude_estimator_so3

SRCS		 = attitude_estimator_so3_main.cpp \
		   attitude_estimator_so3_params.c

Reduce start tool stack size

#
# Attitude estimator (Nonlinear SO(3) complementary Filter)
#

MODULE_COMMAND	 = attitude_estimator_so3

SRCS		 = attitude_estimator_so3_main.cpp \
		   attitude_estimator_so3_params.c

MODULE_STACKSIZE = 1200


DSPOUTDIR = DSPLib

DSPSRCDIR = Drivers/CMSIS/DSP_Lib/Source/FastMathFunctions \
			Drivers/CMSIS/DSP_Lib/Source/BasicMathFunctions \
			Drivers/CMSIS/DSP_Lib/Source/SupportFunctions \
			Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions

DSPINCDIR =

DSPSRC += $(wildcard $(addsuffix /*.c,$(DSPSRCDIR))) \
		  $(wildcard $(addsuffix /*.s,$(DSPSRCDIR)))

INCLUDES += $(addprefix -I,$(DSPINCDIR))

DSPOBJS += $(addprefix $(OUTDIR)/$(DSPOUTDIR)/,$(patsubst %.s,%.o,$(DSPSRC:.c=.o)))

$(OUTDIR)/$(DSPOUTDIR)/%.o: %.c
	@echo "   DSP   |   CC    "$@
	@mkdir -p $(dir $@)
	@$(CC) $(CFLAGS) -MMD -MF $@.d -c $(INCLUDES) $< -o $@

.PHONY: clean-dsplib
clean-dsplib:
	@rm -rf $(OUTDIR)/$(DSPOUTDIR)
	@echo "Removing DSP Library Object Files"

Add CFFT and RFFT into compiling sequence

DSPOUTDIR = DSPLib

DSPSRCDIR = Drivers/CMSIS/DSP_Lib/Source/FastMathFunctions \
			Drivers/CMSIS/DSP_Lib/Source/BasicMathFunctions \
			Drivers/CMSIS/DSP_Lib/Source/SupportFunctions \
			Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions \
			Drivers/CMSIS/DSP_Lib/Source/TransformFunctions

DSPINCDIR =

DSPSRC += $(wildcard $(addsuffix /*.c,$(DSPSRCDIR))) \
		  $(wildcard $(addsuffix /*.s,$(DSPSRCDIR)))

INCLUDES += $(addprefix -I,$(DSPINCDIR))

DSPOBJS += $(addprefix $(OUTDIR)/$(DSPOUTDIR)/,$(patsubst %.s,%.o,$(DSPSRC:.c=.o)))

$(OUTDIR)/$(DSPOUTDIR)/%.o: %.c
	@echo "   DSP   |   CC    "$@
	@mkdir -p $(dir $@)
	@$(CC) $(CFLAGS) -MMD -MF $@.d -c $(INCLUDES) $< -o $@

.PHONY: clean-dsplib
clean-dsplib:
	@rm -rf $(OUTDIR)/$(DSPOUTDIR)
	@echo "Removing DSP Library Object Files"


VPATH+=	${TOPDIR}/network

ifndef USE_PCAP
ifeq "${OSNAME}" "Darwin"
USE_PCAP=	yes
endif

ifeq "${OSNAME}" "FreeBSD"
USE_PCAP=	yes
endif

ifndef USE_PCAP
USE_PCAP=	no
endif
endif

ifeq "${USE_PCAP}" "yes"
LDADD+=	-lpcap
USE_NETWORK_INTERFACES=	pcap
endif

ifdef USE_NETWORK_INTERFACES
SRCS+=	network_interface.cc
SRCS+=	$(addprefix network_interface_,$(addsuffix .cc, ${USE_NETWORK_INTERFACES}))
endif

NET_REQUIRES=	event io

Allow building a version that will just fail.

VPATH+=	${TOPDIR}/network

ifndef USE_PCAP
ifeq "${OSNAME}" "Darwin"
USE_PCAP=	yes
endif

ifeq "${OSNAME}" "FreeBSD"
USE_PCAP=	yes
endif

ifndef USE_PCAP
USE_PCAP=	no
endif
endif

ifeq "${USE_PCAP}" "yes"
LDADD+=	-lpcap
USE_NETWORK_INTERFACES=	pcap
endif

SRCS+=	network_interface.cc
ifdef USE_NETWORK_INTERFACES
SRCS+=	$(addprefix network_interface_,$(addsuffix .cc, ${USE_NETWORK_INTERFACES}))
endif

NET_REQUIRES=	event io


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

include $(DIR)/path.mk

NIXD_VERSION := 7bafe5c3a49c784a5b2e6a999d1f28d719843b94
NIXD_SHA1SUM := 22981df71e81f2780ded6874a0dbec78ad18710d

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

export VENDOR

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

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

Use latest nixd, update on version spec change.

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

include $(DIR)/path.mk

NIXD_VERSION := fa4fc39e7fd8c9a9183684e349c81931326d7523
NIXD_SHA1SUM := b30e0e2927fef8b492223c1daf35e9f818584065

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

export VENDOR

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

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


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

# Here is the final static library that apps can link against.
# Applications that use this library must specify
#
#   LOCAL_STATIC_ANDROID_LIBRARIES := \
#       android-support-v4
#
# in their makefiles to include the resources and their dependencies in their package.
include $(CLEAR_VARS)
LOCAL_USE_AAPT2 := true
LOCAL_MODULE := android-support-v4
LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
LOCAL_STATIC_JAVA_LIBRARIES := \
    android-support-compat \
    android-support-media-compat \
    android-support-core-utils \
    android-support-core-ui \
    android-support-fragment
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_JAR_EXCLUDE_FILES := none
LOCAL_JAVA_LANGUAGE_VERSION := 1.7
include $(BUILD_STATIC_JAVA_LIBRARY)

Make SDK build happy for the combined v4 binary

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

# Here is the final static library that apps can link against.
# Applications that use this library must specify
#
#   LOCAL_STATIC_ANDROID_LIBRARIES := \
#       android-support-v4
#
# in their makefiles to include the resources and their dependencies in their package.
include $(CLEAR_VARS)
LOCAL_USE_AAPT2 := true
LOCAL_MODULE := android-support-v4
LOCAL_SDK_VERSION := 9
LOCAL_STATIC_JAVA_LIBRARIES := \
    android-support-compat \
    android-support-media-compat \
    android-support-core-utils \
    android-support-core-ui \
    android-support-fragment
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_JAR_EXCLUDE_FILES := none
LOCAL_JAVA_LANGUAGE_VERSION := 1.7
include $(BUILD_STATIC_JAVA_LIBRARY)


APP_ABI := armeabi armeabi-v7a mips x86
APP_PLATFORM := android-16

Add support for 64-bit architectures (arm64-v8a, mips64, x86_64)

APP_ABI := armeabi armeabi-v7a arm64-v8a mips mips64 x86 x86_64
APP_PLATFORM := android-16