# Rules for creating static libraries
#
# Arguments to TOOL.STATIC_LIB.CMD
# $1 = input
# $2 = output
# TOOL.STATIC_LIB.CMD - command-line invocation of archiver
#
# TOOL.STATIC_LIB.PREFIX - libraries have this prefix prepended to name
# TOOL.STATIC_LIB.SUFFIX - libraries have this suffix appended to name
# MOSS.STATIC_LIB.PATH - path for placing completed library products

define MOSS.STATIC_LIB.RULES
ifneq ($(filter $($1.products),static_lib),)

$1.static_lib.product = \
	$(MOSS.STATIC_LIB.PATH)$(TOOL.STATIC_LIB.PREFIX)$$($1.name)$(TOOL.STATIC_LIB.SUFFIX)

$1.targets += $$($1.static_lib.product)

$$($1.spore): $$($1.static_lib.product)

$$($1.static_lib.product): $$($1.objs) | $(MOSS.STATIC_LIB.PATH)
	$(call TOOL.STATIC_LIB.CMD, $$<, $$@)

endif
endef

ifdef TOOL.STATIC_LIB.CMD
$(foreach s, $(MOSS.SPORES), $(eval $(call MOSS.STATIC_LIB.RULES,$s)))
endif

Fix library generation for multiple source files

# Rules for creating static libraries
#
# Arguments to TOOL.STATIC_LIB.CMD
# $1 = input
# $2 = output
# TOOL.STATIC_LIB.CMD - command-line invocation of archiver
#
# TOOL.STATIC_LIB.PREFIX - libraries have this prefix prepended to name
# TOOL.STATIC_LIB.SUFFIX - libraries have this suffix appended to name
# MOSS.STATIC_LIB.PATH - path for placing completed library products

define MOSS.STATIC_LIB.RULES
ifneq ($(filter $($1.products),static_lib),)

$1.static_lib.product = \
	$(MOSS.STATIC_LIB.PATH)$(TOOL.STATIC_LIB.PREFIX)$$($1.name)$(TOOL.STATIC_LIB.SUFFIX)

$1.targets += $$($1.static_lib.product)

$$($1.spore): $$($1.static_lib.product)

$$($1.static_lib.product): $$($1.objs) | $(MOSS.STATIC_LIB.PATH)
	$(call TOOL.STATIC_LIB.CMD, $$($1.objs), $$@)

endif
endef

ifdef TOOL.STATIC_LIB.CMD
$(foreach s, $(MOSS.SPORES), $(eval $(call MOSS.STATIC_LIB.RULES,$s)))
endif


# Create the file $(1) from $(1).in by running config.status (which
# substitutes all ‘@var@’ variables set by the configure script).
define instantiate-template =

  clean_files += $(1)

endef

%: %.in
	$(QUIET) ./config.status --quiet --file $@

Declare template_files as a simply expanded variable

template_files :=

# Create the file $(1) from $(1).in by running config.status (which
# substitutes all ‘@var@’ variables set by the configure script).
define instantiate-template =

  clean_files += $(1)

endef

%: %.in
	$(QUIET) ./config.status --quiet --file $@


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

Remove -brtllib option for Mac

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


include .Makefile.d/path.mk

# See Makefile.d project README to compute SHA256.
MAKEFILE_D_VERSION := e2949bc
MAKEFILE_D_SHA256 := \
	6c75a7f055b49e2a53d8f44811a928351dbd1446ac4ae1d5bf828598a097dfd3
MAKEFILE_D_URL := \
	https://github.com/rduplain/Makefile.d/tarball/$(MAKEFILE_D_VERSION)

.Makefile.d/%.mk:
	@mkdir -p .Makefile.d
	cd .Makefile.d; curl -sSL qwerty.sh |\
		sh -s - \
		--sha256=$(MAKEFILE_D_SHA256) \
		$(MAKEFILE_D_URL) |\
			tar -xvzf - --strip-components=1

prove-Makefile.d:
	@echo $(PROJECT_ROOT)

Define full qwerty.sh command up front.

include .Makefile.d/path.mk

define qwerty-Makefile.d
curl -sSL qwerty.sh |\
	sh -s - \
	--sha256=6c75a7f055b49e2a53d8f44811a928351dbd1446ac4ae1d5bf828598a097dfd3 \
	https://github.com/rduplain/Makefile.d/tarball/e2949bc |\
			tar -xvzf - --strip-components=1
endef

.Makefile.d/%.mk:
	@mkdir -p .Makefile.d
	cd .Makefile.d; $(qwerty-Makefile.d)

prove-Makefile.d:
	@echo $(PROJECT_ROOT)


ICE_ROOT=$(PWD)/../../

GLOBAL_LIBNAME = libICE.a

include $(PWD)/../generic/rules.mk
include $(PWD)/../generic/dirs.mk
include $(PWD)/../generic/test-dirs.mk
-include $(PWD)/*.d

GLOBAL_CFLAGS += -g -Werror -Wall -Wno-parentheses -DHAVE_STRDUP
GLOBAL_CFLAGS += -D__UNUSED__="__attribute__((unused))" -Drestrict=__restrict__
GLOBAL_CFLAGS += -I$(NRAPPKIT_BUILD_DIR)
GLOBAL_CFLAGS += -I$(NRAPPKIT_SRCDIR)/src/util
GLOBAL_CFLAGS += -I$(NRAPPKIT_SRCDIR)/src/util/libekr
GLOBAL_CFLAGS += -I$(NRAPPKIT_SRCDIR)/src/port/$(PLATFORM)/include
GLOBAL_CFLAGS += -DOPENSSL -I$(OPENSSL_SRC_DIR)include

GLOBAL_BUILD += $(GLOBAL_LIBNAME)

GLOBAL_LDFLAGS += $(GLOBAL_LIBNAME)
GLOBAL_LDFLAGS += -L$(NRAPPKIT_BUILD_DIR) -lnrappkit
GLOBAL_LDFLAGS += -L$(OPENSSL_SRC_DIR) -lssl -lcrypto

Add extra include paths required for building nICEr (backport r9319)

ICE_ROOT=$(PWD)/../../

GLOBAL_LIBNAME = libICE.a

include $(PWD)/../generic/rules.mk
include $(PWD)/../generic/dirs.mk
include $(PWD)/../generic/test-dirs.mk
-include $(PWD)/*.d

GLOBAL_CFLAGS += -g -Werror -Wall -Wno-parentheses -DHAVE_STRDUP
GLOBAL_CFLAGS += -D__UNUSED__="__attribute__((unused))" -Drestrict=__restrict__
GLOBAL_CFLAGS += -I$(NRAPPKIT_BUILD_DIR)
GLOBAL_CFLAGS += -I$(NRAPPKIT_SRCDIR)/src/util
GLOBAL_CFLAGS += -I$(NRAPPKIT_SRCDIR)/src/util/libekr
GLOBAL_CFLAGS += -I$(NRAPPKIT_SRCDIR)/src/port/$(PLATFORM)/include
GLOBAL_CFLAGS += -I$(NRAPPKIT_SRCDIR)/src/share
GLOBAL_CFLAGS += -I$(NRAPPKIT_SRCDIR)/src/registry
GLOBAL_CFLAGS += -I$(NRAPPKIT_SRCDIR)/src/stats
GLOBAL_CFLAGS += -DOPENSSL -I$(OPENSSL_SRC_DIR)include

GLOBAL_BUILD += $(GLOBAL_LIBNAME)

GLOBAL_LDFLAGS += $(GLOBAL_LIBNAME)
GLOBAL_LDFLAGS += -L$(NRAPPKIT_BUILD_DIR) -lnrappkit
GLOBAL_LDFLAGS += -L$(OPENSSL_SRC_DIR) -lssl -lcrypto


# Common environment for makefile

# Standard programs.

SHELL = /bin/bash
ANT = ant
RSYNC = rsync
FLEX = flex
CC = gcc
CXX = g++

ifdef JAVA_HOME
JAVA = $(JAVA_HOME)/jre/bin/java
else
JAVA = java
endif

UNAME_S=$(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CCFLAGS+=-Wno-gnu-variable-sized-type-not-at-end -Wbitwise-op-parentheses -std=c99
endif

# Compilation setup.

ifndef ICU4CDIR
ICU4CDIR=
ifeq ($(UNAME_S),Darwin)
ICU4CDIR=/usr/local/opt/icu4c/lib
endif
endif

CCFLAGS=-g -Wall
INCLUDES = /usr/include

# CRSX setup.

BUILD = $(CRSXHOME)/build
RUNCRSXRC = $(JAVA) -Dfile.encoding=UTF-8 -Xss20000K -Xmx2000m -cp $(BUILD) net.sf.crsx.run.Crsx allow-unnamed-rules allow-missing-cases
COMPILERSRC = src/net/sf/crsx/compiler

Fix makefile discarding previously set CCFLAGS

# Common environment for makefile

# Standard programs.

SHELL = /bin/bash
ANT = ant
RSYNC = rsync
FLEX = flex
CC = gcc
CXX = g++

ifdef JAVA_HOME
JAVA = $(JAVA_HOME)/jre/bin/java
else
JAVA = java
endif

UNAME_S=$(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CCFLAGS+=-Wno-gnu-variable-sized-type-not-at-end -Wbitwise-op-parentheses -std=c99
endif

# Compilation setup.

ifndef ICU4CDIR
ICU4CDIR=
ifeq ($(UNAME_S),Darwin)
ICU4CDIR=/usr/local/opt/icu4c/lib
endif
endif

CCFLAGS+=-g -Wall
INCLUDES = /usr/include

# CRSX setup.

BUILD = $(CRSXHOME)/build
RUNCRSXRC = $(JAVA) -Dfile.encoding=UTF-8 -Xss20000K -Xmx2000m -cp $(BUILD) net.sf.crsx.run.Crsx allow-unnamed-rules allow-missing-cases
COMPILERSRC = src/net/sf/crsx/compiler


# -*- makefile -*-
#
# Makefile for BSD systems
#

INCFLAGS += -I${LIBFFI_BUILD_DIR}/include
LOCAL_LIBS += ${LIBFFI} -lpthread

LIBFFI_CFLAGS = ${FFI_MMAP_EXEC} -pthread
LIBFFI_BUILD_DIR = ${.CURDIR}/libffi

.if "${srcdir}" == "."
  LIBFFI_SRC_DIR := ${.CURDIR}/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):
	@mkdir -p ${LIBFFI_BUILD_DIR}
	@if [ ! -f ${LIBFFI_BUILD_DIR}/Makefile ]; then \
	    echo "Configuring libffi"; \
	    cd ${LIBFFI_BUILD_DIR} && \
		/usr/bin/env CC="${CC}" LD="${LD}" CFLAGS="${LIBFFI_CFLAGS}" \
		/bin/sh ${LIBFFI_CONFIGURE} ${LIBFFI_HOST} > /dev/null; \
	fi
	@cd ${LIBFFI_BUILD_DIR} && ${MAKE}

Remove quotes around ${srcdir} for FreeBSD

# -*- makefile -*-
#
# Makefile for BSD systems
#

INCFLAGS += -I${LIBFFI_BUILD_DIR}/include
LOCAL_LIBS += ${LIBFFI} -lpthread

LIBFFI_CFLAGS = ${FFI_MMAP_EXEC} -pthread
LIBFFI_BUILD_DIR = ${.CURDIR}/libffi

.if ${srcdir} == "."
  LIBFFI_SRC_DIR := ${.CURDIR}/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):
	@mkdir -p ${LIBFFI_BUILD_DIR}
	@if [ ! -f ${LIBFFI_BUILD_DIR}/Makefile ]; then \
	    echo "Configuring libffi"; \
	    cd ${LIBFFI_BUILD_DIR} && \
		/usr/bin/env CC="${CC}" LD="${LD}" CFLAGS="${LIBFFI_CFLAGS}" \
		/bin/sh ${LIBFFI_CONFIGURE} ${LIBFFI_HOST} > /dev/null; \
	fi
	@cd ${LIBFFI_BUILD_DIR} && ${MAKE}


# src/interfaces/ecpg/ecpglib/nls.mk
CATALOG_NAME     = ecpglib
AVAIL_LANGUAGES  = de es fr it ja pt_BR tr zh_CN
GETTEXT_FILES    = connect.c error.c execute.c misc.c
GETTEXT_TRIGGERS = ecpg_gettext
GETTEXT_FLAGS    = ecpg_gettext:1:pass-c-format

Add missing file to GETTEXT_FILES

# src/interfaces/ecpg/ecpglib/nls.mk
CATALOG_NAME     = ecpglib
AVAIL_LANGUAGES  = de es fr it ja pt_BR tr zh_CN
GETTEXT_FILES    = connect.c descriptor.c error.c execute.c misc.c
GETTEXT_TRIGGERS = ecpg_gettext
GETTEXT_FLAGS    = ecpg_gettext:1:pass-c-format


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

Remove -bexpall option for Mac

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


build_linux_SHA256SUM = sha256sum
build_linux_DOWNLOAD = wget --timeout=$(DOWNLOAD_CONNECT_TIMEOUT) --tries=$(DOWNLOAD_RETRIES) -nv -O

Use curl for fetching on Linux

build_linux_SHA256SUM = sha256sum
build_linux_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -o


# -*- mode:make; tab-width:2; -*-

include $(HEADER)

NAME     := simclock
VERSION  := 1.0.0
RELEASE  := 1
REQUIRES := # nothing
$(call setup_requires)

_CXXFLAGS := -std=c++11 -march=native

TARGETS := simclock

include $(FOOTER)

Use new bob command for setting up requires

# -*- mode:make; tab-width:2; -*-

include $(HEADER)

NAME     := simclock
VERSION  := 1.0.0
RELEASE  := 1
REQUIRES := # nothing
$(call setup)

_CXXFLAGS := -std=c++11 -march=native

TARGETS := simclock

include $(FOOTER)


${title}

        % for entry in entries:

${entry.title}

        % endfor

Remove the 'announce' class from our feed widget


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

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

Simplify getting the iOS SDK path

ARCH = armv7
include $(SRC_PATH)build/platform-darwin.mk
CXX = clang++
CC = clang
ifneq ($(filter %86 x86_64, $(ARCH)),)
SDKTYPE = iPhoneSimulator
else
SDKTYPE = iPhoneOS
endif
SDK_MIN = 5.1

SDKROOT = $(shell xcrun --sdk $(shell echo $(SDKTYPE) | tr A-Z a-z) --show-sdk-path)
CFLAGS += -arch $(ARCH) -isysroot $(SDKROOT) -miphoneos-version-min=$(SDK_MIN) -DAPPLE_IOS -fembed-bitcode
LDFLAGS += -arch $(ARCH) -isysroot $(SDKROOT) -miphoneos-version-min=$(SDK_MIN)


libraries += libutil

libutil_NAME = libnixutil

libutil_DIR := $(d)

libutil_SOURCES := $(wildcard $(d)/*.cc)

libutil_LDFLAGS += -pthread $(OPENSSL_LIBS) $(LIBBROTLI_LIBS) $(LIBARCHIVE_LIBS) $(BOOST_LDFLAGS) -lboost_context

ifeq ($(HAVE_LIBCPUID), 1)
	libutil_LDFLAGS += -lcpuid
endif

ifdef HOST_DARWIN
	libutil_LDFLAGS += -lc++fs
endif

Remove the explicit `c++fs` linkage on darwin


package=curl
$(package)_version=7.43.0
$(package)_download_path=https://curl.haxx.se/download
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_dependencies=openssl
$(package)_sha256_hash=1a084da1edbfc3bd632861358b26af45ba91aaadfb15d6482de55748b8dfc693

define $(package)_set_vars
$(package)_config_opts += --with-ssl=$(host_prefix) --without-librtmp --disable-shared
$(package)_config_opts_darwin = --with-darwinssl
$(package)_config_opts_mingw32 = --with-winssl
endef

define $(package)_preprocess_cmds
  sed -i.old "s|-lgdi32 \$$$$LIBS|\$$$$LIBS -lgdi32|" configure
endef

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

define $(package)_build_cmds
  $(MAKE)
endef

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

Fix build issue on travis

package=curl
$(package)_version=7.43.0
$(package)_download_path=https://curl.haxx.se/download
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_dependencies=openssl
$(package)_sha256_hash=1a084da1edbfc3bd632861358b26af45ba91aaadfb15d6482de55748b8dfc693

define $(package)_set_vars
$(package)_config_opts += --with-ssl=$(host_prefix) --without-librtmp --disable-shared
$(package)_config_opts_linux=--with-pic
$(package)_config_opts_darwin = --with-darwinssl
$(package)_config_opts_mingw32 = --with-winssl
endef

define $(package)_preprocess_cmds
  sed -i.old "s|-lgdi32 \$$$$LIBS|\$$$$LIBS -lgdi32|" configure
endef

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

define $(package)_build_cmds
  $(MAKE)
endef

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


include mk/header.mk

dist_root_$(d)=/ipfs/QmTazYLCem8B7pQGLsCj1Q4MxkqGMmD9XugvStLJSQ8uxA

$(d)/gx: $(d)/gx-v0.10.0
$(d)/gx-go: $(d)/gx-go-v1.4.0

TGTS_$(d) := $(d)/gx $(d)/gx-go
DISTCLEAN += $(wildcard $(d)/gx-v*) $(wildcard $(d)/gx-go-v*) $(d)/tmp

PATH := $(realpath $(d)):$(PATH)

$(TGTS_$(d)):
	rm -f $@
	ln -s $(notdir $^) $@

bin/gx-v%:
	@echo "installing gx $(@:bin/gx-%=%)"
	bin/dist_get $(dist_root_bin) gx $@ $(@:bin/gx-%=%)

bin/gx-go-v%:
	@echo "installing gx-go $(@:bin/gx-go-%=%)"
	@bin/dist_get $(dist_root_bin) gx-go $@ $(@:bin/gx-go-%=%)

CLEAN += $(TGTS_$(d))
include mk/footer.mk

Update gx to version 0.11

include mk/header.mk

dist_root_$(d)=/ipfs/QmNjXP6N98fYT1i7abgeBHmdR5WoeBeik4DtGiX9iFWK31

$(d)/gx: $(d)/gx-v0.11.0
$(d)/gx-go: $(d)/gx-go-v1.4.0

TGTS_$(d) := $(d)/gx $(d)/gx-go
DISTCLEAN += $(wildcard $(d)/gx-v*) $(wildcard $(d)/gx-go-v*) $(d)/tmp

PATH := $(realpath $(d)):$(PATH)

$(TGTS_$(d)):
	rm -f $@
	ln -s $(notdir $^) $@

bin/gx-v%:
	@echo "installing gx $(@:bin/gx-%=%)"
	bin/dist_get $(dist_root_bin) gx $@ $(@:bin/gx-%=%)

bin/gx-go-v%:
	@echo "installing gx-go $(@:bin/gx-go-%=%)"
	@bin/dist_get $(dist_root_bin) gx-go $@ $(@:bin/gx-go-%=%)

CLEAN += $(TGTS_$(d))
include mk/footer.mk


# NetBOX Linux rules
all: .iconv .intl .freetype .zlib \
	.mpeg2 .faad .ffmpeg .live .xml \
	.dvbpsi

Disable faad and libmpeg2, because it is not needed.

# NetBOX Linux rules
all: .iconv .intl .freetype .zlib \
	.ffmpeg .live .xml \
	.dvbpsi


CXXFLAGS_$(d) += \
    -I$(SOURCE_ROOT)/extern/boostorg/json/include \
    -DBOOST_JSON_STANDALONE \
    -Wno-cast-align \
    -Wno-float-equal \
    -Wno-newline-eof \
    -Wno-old-style-cast \
    -Wno-sign-conversion \
    -Wno-undef

Fix benchmarks compilation on macOS

CXXFLAGS_$(d) += \
    -isystem $(SOURCE_ROOT)/extern/boostorg/json/include \
    -DBOOST_JSON_STANDALONE

# On macOS, Boost warns (via #warning) that <memory_resource> does not exist. This is then promoted
# to an error due to -Werror; set -Wno-error for macOS only.
ifeq ($(SYSTEM), MACOS)
    CXXFLAGS_$(d) += -Wno-error
endif


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

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

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

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

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

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

Fix build with clang on Windows

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

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

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

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

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

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


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

LOCAL_RESOURCE_DIR := packages/apps/DeskClock/res
LOCAL_RESOURCE_DIR += frameworks/opt/datetimepicker/res
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/appcompat/res
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/gridlayout/res

LOCAL_MODULE_TAGS := optional
LOCAL_SDK_VERSION := current

LOCAL_PACKAGE_NAME := DeskClock
LOCAL_OVERRIDES_PACKAGES := AlarmClock

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

LOCAL_STATIC_JAVA_LIBRARIES := android-opt-datetimepicker
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-gridlayout

LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.gridlayout
LOCAL_AAPT_FLAGS += --extra-packages com.android.datetimepicker

include $(BUILD_PACKAGE)

Use support library resources latest source for full build

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

LOCAL_RESOURCE_DIR := packages/apps/DeskClock/res
LOCAL_RESOURCE_DIR += frameworks/opt/datetimepicker/res

ifeq ($(TARGET_BUILD_APPS),)
LOCAL_RESOURCE_DIR += frameworks/support/v7/appcompat/res
LOCAL_RESOURCE_DIR += frameworks/support/v7/gridlayout/res
else
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/appcompat/res
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/gridlayout/res
endif

LOCAL_MODULE_TAGS := optional
LOCAL_SDK_VERSION := current

LOCAL_PACKAGE_NAME := DeskClock
LOCAL_OVERRIDES_PACKAGES := AlarmClock

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

LOCAL_STATIC_JAVA_LIBRARIES := android-opt-datetimepicker
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-gridlayout

LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.gridlayout
LOCAL_AAPT_FLAGS += --extra-packages com.android.datetimepicker

include $(BUILD_PACKAGE)


# -*- makefile -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# RISC-V core OS files build
#

# Select RISC-V bare-metal toolchain
$(call set-option,CROSS_COMPILE,$(CROSS_COMPILE_riscv),\
	/opt/coreboot-sdk/bin/riscv64-elf-)

# CPU specific compilation flags
CFLAGS_CPU+=-march=rv32imafc -mabi=ilp32f -Os
LDFLAGS_EXTRA+=-mrelax
LDFLAGS_EXTRA+=-static-libgcc -lgcc

core-y=cpu.o init.o panic.o task.o switch.o __builtin.o math.o

Enable FPU extension only if CONFIG_FPU is enabled

# -*- makefile -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# RISC-V core OS files build
#

# Select RISC-V bare-metal toolchain
$(call set-option,CROSS_COMPILE,$(CROSS_COMPILE_riscv),\
	/opt/coreboot-sdk/bin/riscv64-elf-)

# Enable FPU extension if config option of FPU is enabled.
_FPU_EXTENSION=$(if $(CONFIG_FPU),f,)
# CPU specific compilation flags
CFLAGS_CPU+=-march=rv32ima$(_FPU_EXTENSION)c -mabi=ilp32$(_FPU_EXTENSION) -Os
LDFLAGS_EXTRA+=-mrelax
LDFLAGS_EXTRA+=-static-libgcc -lgcc

core-y=cpu.o init.o panic.o task.o switch.o __builtin.o math.o


ifneq ($(shell which $(host)-g++-posix),)
mingw32_CXX := $(host)-g++-posix
endif

mingw32_CFLAGS=-pipe
mingw32_CXXFLAGS=$(mingw32_CFLAGS)

mingw32_release_CFLAGS=-O2
mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS)

mingw32_debug_CFLAGS=-O1
mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS)

mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC

mingw_cmake_system=Windows

Replace `which` command with `command -v`

ifneq ($(shell $(SHELL) $(.SHELLFLAGS) "command -v $(host)-g++-posix"),)
mingw32_CXX := $(host)-g++-posix
endif

mingw32_CFLAGS=-pipe
mingw32_CXXFLAGS=$(mingw32_CFLAGS)

mingw32_release_CFLAGS=-O2
mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS)

mingw32_debug_CFLAGS=-O1
mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS)

mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC

mingw_cmake_system=Windows


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

CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

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

ifneq ($(TRANSLATION), en_US)
CIRCUITPY_SMALL_BUILD = 1
endif

Set as small build regardless of language

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

CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

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


# rules to make a distribution tarball from a svn repo
# Copyright 2008 Roy Marples <roy@marples.name>

GITREF?=	HEAD
DISTPREFIX?=	${PROG}-${VERSION}
DISTFILE?=	${DISTPREFIX}.tar.bz2

CLEANFILES+=	*.tar.bz2

_VERSION_SH=	sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' config.h
_VERSION!=	${_VERSION_SH}
VERSION=	${_VERSION}$(shell ${_VERSION_SH})

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

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

snapshot:
	mkdir /tmp/${SNAPDIR}
	cp -RPp * /tmp/${SNAPDIR}
	(cd /tmp/${SNAPDIR}; make clean)
	tar -cvjpf ${SNAPFILE} -C /tmp ${SNAPDIR}
	rm -rf /tmp/${SNAPDIR}
	ls -l ${SNAPFILE}

snap: snapshot

Remove .svn dirs from snapshots.

# rules to make a distribution tarball from a svn repo
# Copyright 2008 Roy Marples <roy@marples.name>

GITREF?=	HEAD
DISTPREFIX?=	${PROG}-${VERSION}
DISTFILE?=	${DISTPREFIX}.tar.bz2

CLEANFILES+=	*.tar.bz2

_VERSION_SH=	sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' config.h
_VERSION!=	${_VERSION_SH}
VERSION=	${_VERSION}$(shell ${_VERSION_SH})

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

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

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

snap: snapshot


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

Add install twine wheel to build

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


DIR_INSTALL_ROOT ?= usr/share/stadtgestalten
DIR_INSTALL_STATIC ?= $(DIR_INSTALL_ROOT)/static

PYTHON_INSTALL_ARGS = --root "$(DESTDIR)" \
	--install-lib="/$(DIR_INSTALL_ROOT)" \
	--install-scripts="/$(DIR_INSTALL_ROOT)" \
	--install-data="/$(DIR_INSTALL_ROOT)"

.PHONY: clean-grouprise
clean-grouprise:
	$(RM) -r node_modules
	$(RM) -r static
	$(RM) -r $(DIR_BUILD)

clean: clean-grouprise

.PHONY: build-grouprise
build-grouprise: assets app_migrate app_collect_static
build: build-grouprise

.PHONY: install-grouprise
install-grouprise: build-grouprise
	mkdir -p "$(DIR_INSTALL_STATIC)"
	cp -r --target-directory="$(DIR_INSTALL_STATIC)/" "$(DIR_STATIC)"/*

install: install-grouprise

Use DESTDIR as the default target for "make install"

DIR_INSTALL_ROOT_RELATIVE ?= usr/share/stadtgestalten
DIR_INSTALL_STATIC ?= $(DESTDIR)/$(DIR_INSTALL_ROOT_RELATIVE)/static

PYTHON_INSTALL_ARGS = --root "$(DESTDIR)" \
	--install-lib="/$(DIR_INSTALL_ROOT_RELATIVE)" \
	--install-scripts="/$(DIR_INSTALL_ROOT_RELATIVE)" \
	--install-data="/$(DIR_INSTALL_ROOT_RELATIVE)"

.PHONY: clean-grouprise
clean-grouprise:
	$(RM) -r node_modules
	$(RM) -r static
	$(RM) -r $(DIR_BUILD)

clean: clean-grouprise

.PHONY: build-grouprise
build-grouprise: assets app_migrate app_collect_static
build: build-grouprise

.PHONY: install-grouprise
install-grouprise: build-grouprise
	mkdir -p "$(DIR_INSTALL_STATIC)"
	cp -r --target-directory="$(DIR_INSTALL_STATIC)/" "$(DIR_STATIC)"/*

install: install-grouprise


LD_FILE = boards/samd21x18-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x8015

FLASH_IMPL = spi_flash.c

CHIP_VARIANT = SAMD21G18A

Use bootloader again on the Metro M0

LD_FILE = boards/samd21x18-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x8015

FLASH_IMPL = spi_flash.c

CHIP_VARIANT = SAMD21G18A


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

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

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

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

Enable DeskClock on all devices.

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

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

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

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


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/nest/p9_tod_init.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_tod_init
OBJS+=p9_tod_utils.o
$(call BUILD_PROCEDURE)

Resolve FW TOD Compiler Problems

# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/nest/p9_tod_init.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_tod_init
$(call BUILD_PROCEDURE)


LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld
USB_VID = 0x239A
USB_PID = 0x8015

FLASH_IMPL = spi_flash.c

CHIP_VARIANT = SAMD21G18A

Correct the USB PID of the CircuitPlayground Express.

LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld
USB_VID = 0x239A
USB_PID = 0x8019

FLASH_IMPL = spi_flash.c

CHIP_VARIANT = SAMD21G18A


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

Fix make (build should be phony)

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


LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := yoga

LOCAL_SRC_FILES := \
  jni/YGJNI.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/jni

LOCAL_CFLAGS += -Wall -Werror -fvisibility=hidden -fexceptions -frtti -O3
CXX11_FLAGS := -std=c++11
LOCAL_CFLAGS += $(CXX11_FLAGS)
LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)

LOCAL_LDLIBS += -landroid -llog
LOCAL_STATIC_LIBRARIES := yogacore
LOCAL_SHARED_LIBRARIES := libfb

include $(BUILD_SHARED_LIBRARY)

$(call import-module,CSSLayout)
$(call import-module,fb)

Fix library name of yogacore

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := yoga

LOCAL_SRC_FILES := \
  jni/YGJNI.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/jni

LOCAL_CFLAGS += -Wall -Werror -fvisibility=hidden -fexceptions -frtti -O3
CXX11_FLAGS := -std=c++11
LOCAL_CFLAGS += $(CXX11_FLAGS)
LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)

LOCAL_LDLIBS += -landroid -llog
LOCAL_STATIC_LIBRARIES := libyogacore
LOCAL_SHARED_LIBRARIES := libfb

include $(BUILD_SHARED_LIBRARY)

$(call import-module,CSSLayout)
$(call import-module,fb)


# Adafruit
USB_VID = 0x239A
# Allocated for Winterbloom Sol
# https://github.com/adafruit/circuitpython/issues/2217
USB_PID = 0x8062
USB_PRODUCT = "Sol"
USB_MANUFACTURER = "Winterbloom"
USB_INTERFACE_NAME = "Sol"
USB_DEVICES = "CDC,MSC,AUDIO"

CHIP_VARIANT = SAMD51J20A
CHIP_FAMILY = samd51

QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = W25Q32JV_IQ
LONGINT_IMPL = MPZ

# Disable modules that are unusable on this special-purpose board.
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_BLEIO = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_GAMEPAD = 0
CIRCUITPY_I2CSLAVE = 0
CIRCUITPY_NETWORK = 0
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_PS2IO = 0
CIRCUITPY_USB_HID = 0

# Enable micropython.native
CIRCUITPY_ENABLE_MPY_NATIVE = 1

Add GD25Q64C as a flash chip for Sol

# Adafruit
USB_VID = 0x239A
# Allocated for Winterbloom Sol
# https://github.com/adafruit/circuitpython/issues/2217
USB_PID = 0x8062
USB_PRODUCT = "Sol"
USB_MANUFACTURER = "Winterbloom"
USB_INTERFACE_NAME = "Sol"
USB_DEVICES = "CDC,MSC,AUDIO"

CHIP_VARIANT = SAMD51J20A
CHIP_FAMILY = samd51

QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "GD25Q64C, W25Q32JV_IQ"
LONGINT_IMPL = MPZ

# Disable modules that are unusable on this special-purpose board.
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_BLEIO = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_GAMEPAD = 0
CIRCUITPY_I2CSLAVE = 0
CIRCUITPY_NETWORK = 0
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_PS2IO = 0
CIRCUITPY_USB_HID = 0

# Enable micropython.native
CIRCUITPY_ENABLE_MPY_NATIVE = 1


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

CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51

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

CIRCUITPY_ONEWIREIO = 0
CIRCUITPY_PARALLELDISPLAY = 0
CIRCUITPY_SDCARDIO = 0
CIRCUITPY_SHARPDISPLAY = 0

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

Disable aesio and traceback on matrixportal to save space

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

CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51

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

CIRCUITPY_AESIO = 0
CIRCUITPY_ONEWIREIO = 0
CIRCUITPY_PARALLELDISPLAY = 0
CIRCUITPY_SDCARDIO = 0
CIRCUITPY_SHARPDISPLAY = 0
CIRCUITPY_TRACEBACK = 0

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


$(call assert-variable,iso.path)
# $(call assert-variable,centos.path)

LEVEL ?= INFO

NOFORWARD ?= 0
ifeq ($(NOFORWARD),1)
NOFORWARD_CLI_ARG=--no-forward-network
else
NOFORWARD_CLI_ARG=
endif

INSTALLATION_TIMEOUT ?= 1800
DEPLOYMENT_TIMEOUT ?= 1800

/:=$(BUILD_DIR)/test/

$/%: /:=$/

test: test-integration

clean: clean-integration-test

.PHONY: test-integration
test-integration: $/environment-id-integration
	python test/integration_test.py -l $(LEVEL) --installation-timeout=$(INSTALLATION_TIMEOUT) --deployment-timeout=$(DEPLOYMENT_TIMEOUT) --iso $(abspath $(iso.path)) test $(NOSEARGS)

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

.PHONY: clean-integration-test
clean-integration-test: /:=$/
clean-integration-test:
	python test/integration_test.py -l $(LEVEL) destroy

Disable test-environment cleaning on "make clean" command.

$(call assert-variable,iso.path)
# $(call assert-variable,centos.path)

LEVEL ?= INFO

NOFORWARD ?= 0
ifeq ($(NOFORWARD),1)
NOFORWARD_CLI_ARG=--no-forward-network
else
NOFORWARD_CLI_ARG=
endif

INSTALLATION_TIMEOUT ?= 1800
DEPLOYMENT_TIMEOUT ?= 1800

/:=$(BUILD_DIR)/test/

$/%: /:=$/

test: test-integration

.PHONY: test-integration
test-integration: $/environment-id-integration
	python test/integration_test.py -l $(LEVEL) --installation-timeout=$(INSTALLATION_TIMEOUT) --deployment-timeout=$(DEPLOYMENT_TIMEOUT) --iso $(abspath $(iso.path)) test $(NOSEARGS)

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

.PHONY: clean-integration-test
clean-integration-test: /:=$/
clean-integration-test:
	python test/integration_test.py -l $(LEVEL) destroy


CFLAGS += -DUNITY_FIXTURES
CFLAGS += -DUNITY_EXCLUDE_STDINT_H

UNITY_ROOT = $(ROOT_DIR)/Unity

INCLUDE_DIR += $(UNITY_ROOT)/src
INCLUDE_DIR += $(UNITY_ROOT)/extras/fixture/src

UNITY_SOURCES  =
UNITY_SOURCES += $(UNITY_ROOT)/src/unity.c
UNITY_SOURCES += $(UNITY_ROOT)/extras/fixture/src/unity_fixture.c

UNITY_OBJECTS  = $(BUILD_OBJ_DIR)/unity.o
UNITY_OBJECTS += $(BUILD_OBJ_DIR)/unity_fixture.o

Enable option that Unity displays a function name and line number at the time of test failure

# CFLAGS += -DUNITY_FIXTURES
CFLAGS += -DUNITY_EXCLUDE_STDINT_H

UNITY_ROOT = $(ROOT_DIR)/Unity

INCLUDE_DIR += $(UNITY_ROOT)/src
INCLUDE_DIR += $(UNITY_ROOT)/extras/fixture/src

UNITY_SOURCES  =
UNITY_SOURCES += $(UNITY_ROOT)/src/unity.c
UNITY_SOURCES += $(UNITY_ROOT)/extras/fixture/src/unity_fixture.c

UNITY_OBJECTS  = $(BUILD_OBJ_DIR)/unity.o
UNITY_OBJECTS += $(BUILD_OBJ_DIR)/unity_fixture.o


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

Replace bdist_wheel with build package

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


# $PostgreSQL $
CATALOG_NAME	= ecpg
AVAIL_LANGUAGES	=
GETTEXT_FILES	= \
	compatlib/informix.c \
	ecpglib/connect.c \
	ecpglib/data.c \
	ecpglib/descriptor.c \
	ecpglib/error.c \
	ecpglib/execute.c \
	ecpglib/misc.c \
	ecpglib/prepare.c \
	include/ecpglib.h \
	preproc/descriptor.c \
	preproc/ecpg.c \
	preproc/pgc.c \
	preproc/preproc.c \
	preproc/type.c \
	preproc/variable.c
GETTEXT_TRIGGERS = _ mmerror:3 ecpg_gettext ecpg_log:1

Add additional rules so that make init-po for ecpg gets up to date flex and bison output. Without these, make can sometimes be tempted to invoke its built-in rules using lex and yacc, which can fail if those commands are not available.

# $PostgreSQL $
CATALOG_NAME	= ecpg
AVAIL_LANGUAGES	=
GETTEXT_FILES	= \
	compatlib/informix.c \
	ecpglib/connect.c \
	ecpglib/data.c \
	ecpglib/descriptor.c \
	ecpglib/error.c \
	ecpglib/execute.c \
	ecpglib/misc.c \
	ecpglib/prepare.c \
	include/ecpglib.h \
	preproc/descriptor.c \
	preproc/ecpg.c \
	preproc/pgc.c \
	preproc/preproc.c \
	preproc/type.c \
	preproc/variable.c
GETTEXT_TRIGGERS = _ mmerror:3 ecpg_gettext ecpg_log:1

# Without these rules, make will invoke predefined implicit rules using "lex"
# and "yacc", which we don't want.  The prerequisites should be exactly the
# same as in preproc/Makefile.

$(srcdir)/preproc/preproc.c: preproc/preproc.y
	$(MAKE) -C preproc preproc.c

$(srcdir)/preproc/pgc.c: preproc/pgc.l
	$(MAKE) -C preproc pgc.c


# shout

SHOUT_VERSION := 2.2.2
SHOUT_URL := http://downloads.us.xiph.org/releases/libshout/libshout-$(SHOUT_VERSION).tar.gz

PKGS += shout
ifeq ($(call need_pkg,"shout >= 2.1"),)
PKGS_FOUND += shout
endif

$(TARBALLS)/libshout-$(SHOUT_VERSION).tar.gz:
	$(call download,$(SHOUT_URL))

.sum-shout: libshout-$(SHOUT_VERSION).tar.gz

# TODO: fix socket stuff on POSIX and Linux
libshout: libshout-$(SHOUT_VERSION).tar.gz .sum-shout
	$(UNPACK)
	$(APPLY) $(SRC)/shout/libshout-win32.patch
	$(MOVE)

DEPS_shout = ogg $(DEPS_ogg) theora $(DEPS_theora) speex $(DEPS_speex)
DEPS_shout += vorbis $(DEPS_vorbis)

.shout: libshout
	$(RECONF)
	cd $< && $(HOSTVARS) ./configure $(HOSTCONF)
	cd $< && $(MAKE) install
	touch $@

Revert "contrib: shout: run autoreconf for darwin"

# shout

SHOUT_VERSION := 2.2.2
SHOUT_URL := http://downloads.us.xiph.org/releases/libshout/libshout-$(SHOUT_VERSION).tar.gz

PKGS += shout
ifeq ($(call need_pkg,"shout >= 2.1"),)
PKGS_FOUND += shout
endif

$(TARBALLS)/libshout-$(SHOUT_VERSION).tar.gz:
	$(call download,$(SHOUT_URL))

.sum-shout: libshout-$(SHOUT_VERSION).tar.gz

# TODO: fix socket stuff on POSIX and Linux
libshout: libshout-$(SHOUT_VERSION).tar.gz .sum-shout
	$(UNPACK)
	$(APPLY) $(SRC)/shout/libshout-win32.patch
	$(MOVE)

DEPS_shout = ogg $(DEPS_ogg) theora $(DEPS_theora) speex $(DEPS_speex)
DEPS_shout += vorbis $(DEPS_vorbis)

.shout: libshout
	cd $< && $(HOSTVARS) ./configure $(HOSTCONF)
	cd $< && $(MAKE) install
	touch $@


VERSION = 0.25
EXTVER  = .0

SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 25

Update int28out and out8out and _in_ functions to handle trailing zeros properly.

VERSION = 0.26
EXTVER  = .0

SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 26


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

PROCEDURE=p9_throttle_sync
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/memory/)
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/generic/memory)
$(call BUILD_PROCEDURE)

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

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

PROCEDURE=p9_throttle_sync
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/memory/)
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH))
$(call BUILD_PROCEDURE)


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

Add L1 procedures for p9a and makefiles

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

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

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


.PHONY: dist-rpm

RPM_WORKSPACE=$(shell pwd)/build
RPM_DIR=$(RPM_WORKSPACE)/rpmbuild
RPM_VER=$(shell echo $(VERSION) | awk -F_ '{ print $$1 }')
RPM_REL=$(shell echo $(VERSION) | awk -F_ '{ sub(/g/, "", $$3); print $$2"_"$$3 }')

dist-rpm: dist
	rm -rf $(RPM_WORKSPACE)
	mkdir -p $(RPM_DIR)
	mkdir $(RPM_DIR)/SOURCES
	mkdir $(RPM_DIR)/BUILD
	mkdir $(RPM_DIR)/RPMS
	mkdir $(RPM_DIR)/SRPMS
	cp $(PACKAGE)-$(VERSION).tar.gz $(RPM_DIR)/SOURCES
	sed 's/@VERSION@/$(RPM_VER)/g;s/@RELEASE@/$(RPM_REL)/g' < packaging/rpm/$(PACKAGE).spec.in > $(RPM_WORKSPACE)/$(PACKAGE).spec
	(cd $(RPM_WORKSPACE); rpmbuild -ba $(PACKAGE).spec)
	mv $(RPM_DIR)/RPMS/*/*.rpm `pwd`
	mv $(RPM_DIR)/SRPMS/*.rpm `pwd`
	rm -rf $(RPM_WORKSPACE)

Revert "Remove 'g' prefix from the version". CCBC-50

.PHONY: dist-rpm

RPM_WORKSPACE=$(shell pwd)/build
RPM_DIR=$(RPM_WORKSPACE)/rpmbuild
RPM_VER=$(shell echo $(VERSION) | awk -F_ '{ print $$1 }')
RPM_REL=$(shell echo $(VERSION) | awk -F_ '{ print $$2"_"$$3 }')

dist-rpm: dist
	rm -rf $(RPM_WORKSPACE)
	mkdir -p $(RPM_DIR)
	mkdir $(RPM_DIR)/SOURCES
	mkdir $(RPM_DIR)/BUILD
	mkdir $(RPM_DIR)/RPMS
	mkdir $(RPM_DIR)/SRPMS
	cp $(PACKAGE)-$(VERSION).tar.gz $(RPM_DIR)/SOURCES
	sed 's/@VERSION@/$(RPM_VER)/g;s/@RELEASE@/$(RPM_REL)/g' < packaging/rpm/$(PACKAGE).spec.in > $(RPM_WORKSPACE)/$(PACKAGE).spec
	(cd $(RPM_WORKSPACE); rpmbuild -ba $(PACKAGE).spec)
	mv $(RPM_DIR)/RPMS/*/*.rpm `pwd`
	mv $(RPM_DIR)/SRPMS/*.rpm `pwd`
	rm -rf $(RPM_WORKSPACE)


TOPDIR = ..\..

TARGET                  = libp11.dll

OBJECTS                 = p11_attr.obj p11_cert.obj p11_err.obj \
	p11_key.obj p11_load.obj p11_misc.obj p11_rsa.obj p11_slot.obj

all: $(TARGET)

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

$(TARGET): $(OBJECTS) ..\scdl\scdl.lib
	perl $(TOPDIR)\win32\makedef.pl $*.def $* $(OBJECTS)
	link $(LINKFLAGS) /dll /def:$*.def /implib:$*.lib /out:$(TARGET) $(OBJECTS) ..\scdl\scdl.lib $(OPENSSL_LIB)

Install libp11.h + small fixes

TOPDIR = ..\..

TARGET                  = libp11.dll

HEADERS = libp11.h
HEADERSDIR = $(TOPDIR)\src\include

OBJECTS                 = p11_attr.obj p11_cert.obj p11_err.obj \
	p11_key.obj p11_load.obj p11_misc.obj p11_rsa.obj p11_slot.obj p11_ops.obj

all: install-headers $(TARGET)

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

$(TARGET): $(OBJECTS) ..\scdl\scdl.lib
	perl $(TOPDIR)\win32\makedef.pl $*.def $* $(OBJECTS)
	link $(LINKFLAGS) /dll /def:$*.def /implib:$*.lib /out:$(TARGET) $(OBJECTS) ..\pkcs11\libpkcs11.lib ..\scdl\scdl.lib $(OPENSSL_LIB)


LOCAL_PATH := $(my-dir)/code/src/LibUSBDroid/jni/
include $(CLEAR_VARS)

LOCAL_SRC_FILES := libusb_jni.c core.c descriptor.c io.c sync.c os/linux_usbfs.c
LOCAL_CFLAGS := -fPIC -DPIC
LOCAL_MODULE := libusbdroid

include $(BUILD_STATIC_LIBRARY)

Remove unnecessary slash from build file

LOCAL_PATH := $(my-dir)/code/src/LibUSBDroid/jni
include $(CLEAR_VARS)

LOCAL_SRC_FILES := libusb_jni.c core.c descriptor.c io.c sync.c os/linux_usbfs.c
LOCAL_CFLAGS := -fPIC -DPIC
LOCAL_MODULE := libusbdroid

include $(BUILD_STATIC_LIBRARY)


# -*- mode:make; tab-width:2; -*-

include $(HEADER)

NAME     := vincenty
VERSION  := 1.0.0
RELEASE  := 1
REQUIRES := # Nothing
$(call setup)

_CXXFLAGS := -march=native

TARGETS := libvincenty.so

include $(FOOTER)

Use global CXXFLAGS to incorporate test submodule

# -*- mode:make; tab-width:2; -*-

include $(HEADER)

NAME     := vincenty
VERSION  := 1.0.0
RELEASE  := 1
REQUIRES := # Nothing
$(call setup)

CXXFLAGS += -march=native -fsanitize=address

TARGETS := libvincenty.so

include $(FOOTER)


ifndef FENCEAGENTSLIB
SBINDIRT=$(TARGET)
endif

all: $(TARGET)

include $(OBJDIR)/make/clean.mk
include $(OBJDIR)/make/install.mk
include $(OBJDIR)/make/uninstall.mk

$(TARGET):
	${FENCEPARSE} \
		${SRCDIR}/config/copyright.cf REDHAT_COPYRIGHT \
		${RELEASE_VERSION} \
		$(S) $@ | \
	sed \
		-e 's#@FENCEAGENTSLIBDIR@#${fenceagentslibdir}#g' \
		-e 's#@MIBDIR@#${mibdir}#g' \
		-e 's#@SNMPBIN@#${snmpbin}#g' \
	> $@

	chmod +x $@

clean: generalclean

Fix fence lib install target

ifndef FENCEAGENTSLIB
ifdef TARGET
SBINDIRT=$(TARGET)
endif
endif

all: $(TARGET)

include $(OBJDIR)/make/clean.mk
include $(OBJDIR)/make/install.mk
include $(OBJDIR)/make/uninstall.mk

$(TARGET):
	${FENCEPARSE} \
		${SRCDIR}/config/copyright.cf REDHAT_COPYRIGHT \
		${RELEASE_VERSION} \
		$(S) $@ | \
	sed \
		-e 's#@FENCEAGENTSLIBDIR@#${fenceagentslibdir}#g' \
		-e 's#@MIBDIR@#${mibdir}#g' \
		-e 's#@SNMPBIN@#${snmpbin}#g' \
	> $@

	chmod +x $@

clean: generalclean


LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x239A
USB_PID = 0x801b
USB_PRODUCT = "Feather M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"

#SPI_FLASH_FILESYSTEM = 1
INTERNAL_FLASH_FILESYSTEM = 1

CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21

Update Feather M0 Express USB PID

LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x239A
USB_PID = 0x8023
USB_PRODUCT = "Feather M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"

#SPI_FLASH_FILESYSTEM = 1
INTERNAL_FLASH_FILESYSTEM = 1

CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21


LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_C_INCLUDES := \
    ../source/
LOCAL_SRC_FILES:= \
    ../../apps/synthmark.cpp \
    ../../source/tools/HostTools.cpp \
    ../../source/tools/SynthMarkCommand.cpp \
    ../../source/aaudio/AAudioHostThread.cpp
LOCAL_CFLAGS += -g -std=c++14 -Ofast -Wall -Werror
LOCAL_LDLIBS := -laaudio
LOCAL_MODULE := synthmark
include $(BUILD_EXECUTABLE)

Remove make_unique so we can use C++11

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_C_INCLUDES := \
    ../source/
LOCAL_SRC_FILES:= \
    ../../apps/synthmark.cpp \
    ../../source/tools/HostTools.cpp \
    ../../source/tools/SynthMarkCommand.cpp \
    ../../source/aaudio/AAudioHostThread.cpp
LOCAL_CFLAGS += -g -std=c++11 -Ofast -Wall -Werror
LOCAL_LDLIBS := -laaudio
LOCAL_MODULE := synthmark
include $(BUILD_EXECUTABLE)


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

Remove the now unused -Wno-deprecated-declarations on OS X

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


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

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

export LD_DASH_T

# vim:ft=make

Add -T workaround for GNU ld 2.36

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

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

export LD_DASH_T

# vim:ft=make


packages:=boost openssl libevent zeromq
native_packages := native_ccache

qt_native_packages = native_protobuf
qt_packages = qrencode protobuf zlib

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

qt_darwin_packages=qt
qt_mingw32_packages=qt

wallet_packages=bdb

upnp_packages=miniupnpc

darwin_native_packages = native_biplist native_ds_store native_mac_alias

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

Add qt to all linux builds

packages:=boost openssl libevent zeromq
native_packages := native_ccache

qt_native_packages = native_protobuf
qt_packages = qrencode protobuf zlib

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

qt_darwin_packages=qt
qt_mingw32_packages=qt

wallet_packages=bdb

upnp_packages=miniupnpc

darwin_native_packages = native_biplist native_ds_store native_mac_alias

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


# TARGETS #

# Run Fortran benchmarks.
#
# This target runs a list of Fortran benchmarks in sequential order.

benchmark-fortran:
	$(QUIET) $(FIND_FORTRAN_BENCHMARKS_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
		echo ""; \
		echo "Running benchmark: $$file"; \
		cd `dirname $$file` && \
		$(MAKE) clean && \
		$(MAKE) && \
		$(MAKE) run || exit 1; \
	done

.PHONY: benchmark-fortran

# Run Fortran benchmarks.
#
# This target runs a specified list of Fortran benchmarks in sequential order.

benchmark-fortran-files:
	$(QUIET) for file in $(FILES); do \
		echo ""; \
		echo "Running benchmark: $$file"; \
		cd `dirname $$file` && \
		$(MAKE) clean && \
		$(MAKE) && \
		$(MAKE) run || exit 1; \
	done

.PHONY: benchmark-fortran-files

Set Fortran compiler environment variable

# TARGETS #

# Run Fortran benchmarks.
#
# This target runs a list of Fortran benchmarks in sequential order.

benchmark-fortran:
	$(QUIET) $(FIND_FORTRAN_BENCHMARKS_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
		echo ""; \
		echo "Running benchmark: $$file"; \
		cd `dirname $$file` && \
		$(MAKE) clean && \
		$(MAKE) && \
		FORTRAN_COMPILER="$(FC)" \
		$(MAKE) run || exit 1; \
	done

.PHONY: benchmark-fortran

# Run Fortran benchmarks.
#
# This target runs a specified list of Fortran benchmarks in sequential order.

benchmark-fortran-files:
	$(QUIET) for file in $(FILES); do \
		echo ""; \
		echo "Running benchmark: $$file"; \
		cd `dirname $$file` && \
		$(MAKE) clean && \
		$(MAKE) && \
		FORTRAN_COMPILER="$(FC)" \
		$(MAKE) run || exit 1; \
	done

.PHONY: benchmark-fortran-files


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

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

int plugin_is_GPL_compatible;

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

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

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

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

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

-load ./fibonacci.so

%:
	@echo $(fibonacci $@)

Use gcc to build fibonacci.so and fix cygwin support

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

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

int plugin_is_GPL_compatible;

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

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

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

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

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

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

-load ./fibonacci.so

%:
	@echo $(fibonacci $@)


NAME = dwmstatus
VERSION = 1.1

# Customize below to fit your system

DEBUGFLAGS=
#DEBUGFLAGS=-g

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

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

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

# compiler and linker
CC = cc

Allow specifying conditional compilation stuff on make command line

NAME = dwmstatus
VERSION = 1.1

# Customize below to fit your system

DEBUGFLAGS=
#DEBUGFLAGS=-g

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

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

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

# compiler and linker
CC = cc

# Conditional stuff

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

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

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


FLASHER = avrdude
DIST_PATH = $(RIOTBOARD)/$(BOARD)/dist
DEBUGSERVER_PORT = 4242
DEBUGSERVER = $(DIST_PATH)/debug_srv.sh
DEBUGSERVER_INTERFACE ?=
DEBUGSERVER_FLAGS = "-g -j usb $(DEBUGSERVER_INTERFACE) :$(DEBUGSERVER_PORT)"
DEBUGGER_FLAGS = "-x $(RIOTBOARD)/$(BOARD)/dist/gdb.conf $(ELFFILE)"
DEBUGGER = $(DIST_PATH)/debug.sh $(DEBUGSERVER_FLAGS) $(DIST_PATH) $(DEBUGSERVER_PORT)

PROGRAMMER_FLAGS = -p $(subst atmega,m,$(CPU))

# Set flasher port only for programmers that require it
ifneq (,$(filter $(PROGRAMMER),arduino avr109 buspirate stk500v1 stk500v2 wiring))
  # make the flasher port configurable (e.g. with atmelice the port is usb)
  # defaults to terminal's serial port if not configured
  PROGRAMMER_FLAGS += -P $(PROG_DEV)
endif
PROGRAMMER_FLAGS += $(FFLAGS_EXTRA)

# don't force to flash HEXFILE, but set it as default
FLASHFILE ?= $(HEXFILE)
FFLAGS += -c $(PROGRAMMER) $(PROGRAMMER_FLAGS) -U flash:w:$(FLASHFILE)

Allow make reset via avrdude

FLASHER = avrdude
DIST_PATH = $(RIOTBOARD)/$(BOARD)/dist
DEBUGSERVER_PORT = 4242
DEBUGSERVER = $(DIST_PATH)/debug_srv.sh
DEBUGSERVER_INTERFACE ?=
DEBUGSERVER_FLAGS = "-g -j usb $(DEBUGSERVER_INTERFACE) :$(DEBUGSERVER_PORT)"
DEBUGGER_FLAGS = "-x $(RIOTBOARD)/$(BOARD)/dist/gdb.conf $(ELFFILE)"
DEBUGGER = $(DIST_PATH)/debug.sh $(DEBUGSERVER_FLAGS) $(DIST_PATH) $(DEBUGSERVER_PORT)

PROGRAMMER_FLAGS = -p $(subst atmega,m,$(CPU))

# Set flasher port only for programmers that require it
ifneq (,$(filter $(PROGRAMMER),arduino avr109 buspirate stk500v1 stk500v2 wiring))
  # make the flasher port configurable (e.g. with atmelice the port is usb)
  # defaults to terminal's serial port if not configured
  PROGRAMMER_FLAGS += -P $(PROG_DEV)
endif
PROGRAMMER_FLAGS += $(FFLAGS_EXTRA)

# don't force to flash HEXFILE, but set it as default
FLASHFILE ?= $(HEXFILE)
FFLAGS += -c $(PROGRAMMER) $(PROGRAMMER_FLAGS) -U flash:w:$(FLASHFILE)
RESET ?= $(FLASHER) -c $(PROGRAMMER) $(PROGRAMMER_FLAGS)


# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/io/p9_io_xbus_clear_firs.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_io_xbus_clear_firs
$(call BUILD_PROCEDURE)

Move Xbus Erepair FIR Clearing

# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/import/chips/p9/procedures/hwp/io/p9_io_xbus_clear_firs.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_io_xbus_clear_firs
OBJS+=p9_io_xbus_read_erepair.o
$(call BUILD_PROCEDURE)


APP_STL := gnustl_static
APP_ABI := armeabi-v7a x86 mips # arm64-v8a x86_64 mips64
APP_OPTIM := release
APP_PLATFORM := android-8
APP_CPPFLAGS += -fexceptions -frtti
NDK_TOOLCHAIN_VERSION := 4.8

Change list of ABIs built by default

APP_STL := gnustl_static
APP_ABI := armeabi-v7a x86 mips arm64-v8a x86_64 mips64
APP_OPTIM := release
APP_PLATFORM := android-8
APP_CPPFLAGS += -fexceptions -frtti
NDK_TOOLCHAIN_VERSION := 4.8


NAME = cii
VERSION = 0.0

# Customize below to fit your system

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

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

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

# flags
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE
#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 = clang

Use default compiler instead of clang

NAME = cii
VERSION = 0.0

# Customize below to fit your system

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

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

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

# flags
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE
#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


CC = gcc
CXX = g++
LD = gcc
OBJCOPY = objcopy
SIZE = size
NM = nm

topdir := $(shell pwd)/

src-to-obj = $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(1)))

LIB_OBJS = $(call src-to-obj,$(LIB_SRCS))
S7GET_OBJS = $(call src-to-obj,$(S7GET_SRCS))
TEST_OBJS = $(call src-to-obj,$(TEST_SRCS))
ANALYSIS_OBJS = $(call src-to-obj,$(ANALYSIS_SRCS))

module = $(<D)
module_includes = $(addprefix -I, $($(_module)_includes))
module_cflags = $($(module)_cflags)
module_ldflags = $($(module)_ldflags)

COMMON_FLAGS = -g -Wall -Werror $(module_includes)

CFLAGS = $(COMMON_FLAGS) -std=gnu99 $(module_cflags)
CPPFLAGS = $(COMMON_FLAGS)
LDFLAGS = $(module_ldflags)

Build system: Actually include the generated dependency files

CC = gcc
CXX = g++
LD = gcc
OBJCOPY = objcopy
SIZE = size
NM = nm

topdir := $(shell pwd)/

src-to-obj = $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(1)))

LIB_OBJS = $(call src-to-obj,$(LIB_SRCS))
S7GET_OBJS = $(call src-to-obj,$(S7GET_SRCS))
TEST_OBJS = $(call src-to-obj,$(TEST_SRCS))
ANALYSIS_OBJS = $(call src-to-obj,$(ANALYSIS_SRCS))
OBJS = $(LIB_OBJS) $(S7GET_OBJS) $(TEST_OBJS) $(ANALYSIS_OBJS)

module = $(<D)
module_includes = $(addprefix -I, $($(_module)_includes))
module_cflags = $($(module)_cflags)
module_ldflags = $($(module)_ldflags)

COMMON_FLAGS = -g -Wall -Werror $(module_includes)

CFLAGS = $(COMMON_FLAGS) -std=gnu99 $(module_cflags)
CPPFLAGS = $(COMMON_FLAGS)
LDFLAGS = $(module_ldflags)


SHELL := /usr/bin/env bash
JAVA_SOURCE_FILES = $(shell find . -name "*.java")

default: .tested
.PHONY: default

.tested: pom.xml $(JAVA_SOURCE_FILES) .deps
	mvn install
	touch $@

.deps:
	touch $@

update-dependencies:
	mvn versions:force-releases
	mvn versions:use-latest-versions

update-version:
ifdef NEW_VERSION
	mvn versions:set -DnewVersion=$(NEW_VERSION) -DgenerateBackupPoms=false
else
	@echo -e "\033[0;NEW_VERSION is not defined. Can't update version :-(\033[0m"
	exit 1
endif

publish: .deps
	mvn deploy -Psign-source-javadoc --settings scripts/ci-settings.xml -DskipTests=true
.PHONY: publish

clean: clean-java
.PHONY: clean

clean-java:
	rm -rf target .deps .tested
.PHONY: clean-java

Remove Makefile duplication. Fix some target dependencies.

SHELL := /usr/bin/env bash
JAVA_SOURCE_FILES = $(shell find . -name "*.java")

default: .tested
.PHONY: default

.tested: pom.xml $(JAVA_SOURCE_FILES) .deps
	mvn install
	touch $@

.deps:
	touch $@

update-dependencies:
	mvn versions:force-releases
	mvn versions:use-latest-versions
.PHONY: update-dependencies

update-version:
ifdef NEW_VERSION
	mvn versions:set -DnewVersion=$(NEW_VERSION) -DgenerateBackupPoms=false
else
	@echo -e "\033[0;NEW_VERSION is not defined. Can't update version :-(\033[0m"
	exit 1
endif
.PHONY: update-version

publish: .deps
	mvn deploy -Psign-source-javadoc --settings scripts/ci-settings.xml -DskipTests=true
.PHONY: publish

clean: clean-java
.PHONY: clean

clean-java:
	rm -rf target .deps .tested
.PHONY: clean-java


$(BUILD_DIR)/libdrivers.rlib: $(call rwildcard,src/drivers/,*.rs) $(BUILD_DIR)/libcore.rlib $(BUILD_DIR)/libhil.rlib
	@echo "Building $@"
	@$(RUSTC) $(RUSTC_FLAGS) -F unsafe-code --out-dir $(BUILD_DIR) src/drivers/lib.rs

Add libcommon as dependency of libdrivers

$(BUILD_DIR)/libdrivers.rlib: $(call rwildcard,src/drivers/,*.rs) $(BUILD_DIR)/libcore.rlib $(BUILD_DIR)/libhil.rlib $(BUILD_DIR)/libcommon.rlib
	@echo "Building $@"
	@$(RUSTC) $(RUSTC_FLAGS) -F unsafe-code --out-dir $(BUILD_DIR) src/drivers/lib.rs


# Setup OS specific variables
# Copyright 2008 Roy Marples <roy@marples.name>

SRC_PF=		lpf.c
SRC_IF=		if-linux.c

CPPFLAGS+=	-D_BSD_SOURCE -D_XOPEN_SOURCE=600
LIBRT=		-lrt

# Work out if our fork() works or not.
# If cross-compiling, you'll need to set HAVE_FORK to yes or no depending
# on your target arch.
_HAVE_FORK_SH= if test "${HAVE_FORK}" = "yes"; then \
		echo ""; \
	elif test -n "${HAVE_FORK}"; then \
		echo "-DTHERE_IS_NO_FORK"; \
	else \
		printf '\#include <stdlib.h>\n\#include <unistd.h>\nint main (void) { pid_t pid = fork(); if (pid == -1) exit (EXIT_FAILURE); exit (EXIT_SUCCESS); }\n' > .fork.c; \
		${CC} .fork.c -o .fork >/dev/null 2>&1; \
		if ./.fork; then \
			echo ""; \
		else \
			echo "-DTHERE_IS_NO_FORK"; \
		fi; \
		rm -f .fork.c .fork; \
	fi;
_HAVE_FORK!=	${_HAVE_FORK_SH}
CPPFLAGS+=	${_HAVE_FORK}$(shell ${_HAVE_FORK_SH})

Remove the fork() test as compile hosts will normally have it, making it redundant.


<%inherit file="master.mak"/>

Hello, world!

This is a wonderful experiment using Twitter Boostrap, Flask, and Mako to make awesome.

Learn more »

One

one

View details »

Two

two

View details »

Three

three

View details »

Remove giant ugly buttons, make welcome message obvious

<%inherit file="master.mak"/>

HFOSS

The RIT Humanitarian Free/Open Source Software Development Course


LD_FILE = boards/samd21x18-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x8023
USB_PRODUCT = "snekboard"
USB_MANUFACTURER = "keithp.com"

CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21

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

CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0

Update snekboard PID to official value

LD_FILE = boards/samd21x18-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x804E
USB_PRODUCT = "snekboard"
USB_MANUFACTURER = "keithp.com"

CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21

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

CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0


## Run openfisca-core.
test-code: test-core
	@##	Usage:
	@##
	@##		make test [pytest_args="--ARG"] [openfisca_args="--ARG"]
	@##
	@##	Examples:
	@##
	@##		make test
	@##		make test pytest_args="--exitfirst"
	@##		make test openfisca_args="--performance"
	@##		make test pytest_args="--exitfirst" openfisca_args="--performance"
	@$(call print_pass,$@:)

## Run openfisca-core tests.
test-core: $(shell git ls-files "tests/*.py")
	@$(call print_help,$@:)
	@PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov=openfisca_core ${pytest_args}" \
		openfisca test $? \
		${openfisca_args}
	@$(call print_pass,$@:)

Add task to run country/extension

python_packages = $(shell python -c "import sysconfig; print(sysconfig.get_paths()[\"purelib\"])")

## Run openfisca-core & country/extension template tests.
test-code: test-core test-country test-extension
	@##	Usage:
	@##
	@##		make test [pytest_args="--ARG"] [openfisca_args="--ARG"]
	@##
	@##	Examples:
	@##
	@##		make test
	@##		make test pytest_args="--exitfirst"
	@##		make test openfisca_args="--performance"
	@##		make test pytest_args="--exitfirst" openfisca_args="--performance"
	@##
	@$(call print_pass,$@:)

## Run openfisca-core tests.
test-core: $(shell git ls-files "tests/*.py")
	@$(call print_help,$@:)
	@PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov=openfisca_core ${pytest_args}" \
		openfisca test $? \
		${openfisca_args}
	@$(call print_pass,$@:)

## Run country-template tests.
test-country:
	@$(call print_help,$@:)
	@PYTEST_ADDOPTS="${PYTEST_ADDOPTS} ${pytest_args}" \
		openfisca test ${python_packages}/openfisca_country_template/tests \
		--country-package openfisca_country_template \
		${openfisca_args}
	@$(call print_pass,$@:)

## Run extension-template tests.
test-extension:
	@$(call print_help,$@:)
	@PYTEST_ADDOPTS="${PYTEST_ADDOPTS} ${pytest_args}" \
		openfisca test ${python_packages}/openfisca_extension_template/tests \
		--country-package openfisca_country_template \
		--extensions openfisca_extension_template \
		${openfisca_args}
	@$(call print_pass,$@:)


all: setup expat expatw expat_static expatw_static elements outline xmlwf

setup:
 setup

expat:
 make -l -fexpat.mak

expatw:
 make -l -fexpatw.mak

expat_static:
 make -l -fexpat_static.mak

expatw_static:
 make -l -fexpatw_static.mak

elements:
 make -l -felements.mak

outline:
 make -l -foutline.mak

xmlwf:
 make -l -fxmlwf.mak

clean:
# works on Win98/ME
 deltree /y release\obj
# works on WinNT/2000
# del /s/f/q release\obj

distclean:
# works on Win98/ME
 deltree /y release\*.*
# works on WinNT/2000
# del /s/f/q release\*

Change to support Windows 2000 behaviour by default

all: setup expat expatw expat_static expatw_static elements outline xmlwf

setup:
 setup

expat:
 make -l -fexpat.mak

expatw:
 make -l -fexpatw.mak

expat_static:
 make -l -fexpat_static.mak

expatw_static:
 make -l -fexpatw_static.mak

elements:
 make -l -felements.mak

outline:
 make -l -foutline.mak

xmlwf:
 make -l -fxmlwf.mak

clean:
# works on Win98/ME
# deltree /y release\obj
# works on WinNT/2000
 del /s/f/q release\obj

distclean:
# works on Win98/ME
# deltree /y release\*.*
# works on WinNT/2000
 del /s/f/q release\*


GO_BINS := $(GO_BINS) cmd/buf cmd/protoc-gen-buf-check-breaking cmd/protoc-gen-buf-check-lint
GO_GET_PKGS := $(GO_GET_PKGS) github.com/jhump/protoreflect@master
DOCKER_BINS := $(DOCKER_BINS) buf
PROTO_PATH := proto
PROTOC_GEN_GO_OUT := internal/gen/proto
FILE_IGNORES := $(FILE_IGNORES) .build/ internal/buf/bufbuild/cache/

include make/go/bootstrap.mk
include make/go/go.mk
include make/go/codecov.mk
include make/go/docker.mk
include make/go/protoc_gen_go.mk

.PHONY: buflint
buflint: installbuf
	buf check lint

.PHONY: bufbreaking
bufbreaking: installbuf
	@ if [ -d .git ]; then \
			$(MAKE) bufbreakinginternal; \
		else \
			echo "skipping make bufbreaking due to no .git repository" >&2; \
		fi

.PHONY: bufbreakinginternal
bufbreakinginternal:
	-buf check breaking --against-input '.git#branch=master'

postlint:: buflint bufbreaking

.PHONY: installbufdev
installbufdev:
	go install -ldflags "-X github.com/bufbuild/buf/internal/buf/cmd/buf.develMode=1" ./cmd/buf

.PHONY: bufrelease
bufrelease: all
	DOCKER_IMAGE=golang:1.13.4-buster bash make/buf/scripts/release.bash

Delete develMode flag target for buf

GO_BINS := $(GO_BINS) cmd/buf cmd/protoc-gen-buf-check-breaking cmd/protoc-gen-buf-check-lint
GO_GET_PKGS := $(GO_GET_PKGS) github.com/jhump/protoreflect@master
DOCKER_BINS := $(DOCKER_BINS) buf
PROTO_PATH := proto
PROTOC_GEN_GO_OUT := internal/gen/proto
FILE_IGNORES := $(FILE_IGNORES) .build/ internal/buf/bufbuild/cache/

include make/go/bootstrap.mk
include make/go/go.mk
include make/go/codecov.mk
include make/go/docker.mk
include make/go/protoc_gen_go.mk

.PHONY: buflint
buflint: installbuf
	buf check lint

.PHONY: bufbreaking
bufbreaking: installbuf
	@ if [ -d .git ]; then \
			$(MAKE) bufbreakinginternal; \
		else \
			echo "skipping make bufbreaking due to no .git repository" >&2; \
		fi

.PHONY: bufbreakinginternal
bufbreakinginternal:
	-buf check breaking --against-input '.git#branch=master'

postlint:: buflint bufbreaking

.PHONY: bufrelease
bufrelease: all
	DOCKER_IMAGE=golang:1.13.4-buster bash make/buf/scripts/release.bash


.PHONY: dist-rpm

RPM_WORKSPACE=$(shell pwd)/build
RPM_DIR=$(RPM_WORKSPACE)/rpmbuild
RPM_VER=$(shell echo $(VERSION) | awk -F_ '{ print $$1 }')
RPM_REL=$(shell echo $(VERSION) | awk -F_ '{ print $$2"_"$$3 }')

dist-rpm: dist
	rm -rf $(RPM_WORKSPACE)
	mkdir -p $(RPM_DIR)
	mkdir $(RPM_DIR)/SOURCES
	mkdir $(RPM_DIR)/BUILD
	mkdir $(RPM_DIR)/RPMS
	mkdir $(RPM_DIR)/SRPMS
	cp $(PACKAGE)-$(VERSION).tar.gz $(RPM_DIR)/SOURCES
	sed 's/@VERSION@/$(RPM_VER)/g;s/@RELEASE@/$(RPM_REL)/g' < packaging/rpm/$(PACKAGE).spec.in > $(RPM_WORKSPACE)/$(PACKAGE).spec
	(cd $(RPM_WORKSPACE); rpmbuild -ba $(PACKAGE).spec)
	mv $(RPM_DIR)/RPMS/*/*.rpm `pwd`
	mv $(RPM_DIR)/SRPMS/*.rpm `pwd`
	rm -rf $(RPM_WORKSPACE)

Remove 'g' prefix from the version

.PHONY: dist-rpm

RPM_WORKSPACE=$(shell pwd)/build
RPM_DIR=$(RPM_WORKSPACE)/rpmbuild
RPM_VER=$(shell echo $(VERSION) | awk -F_ '{ print $$1 }')
RPM_REL=$(shell echo $(VERSION) | awk -F_ '{ sub(/g/, "", $$3); print $$2"_"$$3 }')

dist-rpm: dist
	rm -rf $(RPM_WORKSPACE)
	mkdir -p $(RPM_DIR)
	mkdir $(RPM_DIR)/SOURCES
	mkdir $(RPM_DIR)/BUILD
	mkdir $(RPM_DIR)/RPMS
	mkdir $(RPM_DIR)/SRPMS
	cp $(PACKAGE)-$(VERSION).tar.gz $(RPM_DIR)/SOURCES
	sed 's/@VERSION@/$(RPM_VER)/g;s/@RELEASE@/$(RPM_REL)/g' < packaging/rpm/$(PACKAGE).spec.in > $(RPM_WORKSPACE)/$(PACKAGE).spec
	(cd $(RPM_WORKSPACE); rpmbuild -ba $(PACKAGE).spec)
	mv $(RPM_DIR)/RPMS/*/*.rpm `pwd`
	mv $(RPM_DIR)/SRPMS/*.rpm `pwd`
	rm -rf $(RPM_WORKSPACE)


# I know nothing about scons, waf, or autoconf. Sorry.
NODE_PREFIX := $(shell node --vars | egrep ^NODE_PREFIX: | cut -c14-)
NODE_PLATFORM := $(shell node --vars | egrep -o 'DPLATFORM="[^"]+' | cut -c12-)
NODE_BITS := $(shell file `which node` | egrep -o '[0-9]{2}-bit' | cut -c-2)

CPPFLAGS = -Wall -I$(NODE_PREFIX)/include -I$(NODE_PREFIX)/include/node
ifdef DEBUG
	CPPFLAGS += -ggdb -O0
else
	CPPFLAGS += -g -O3 -minline-all-stringops
endif

ifeq ($(NODE_BITS), )
	CPPFLAGS += -m32
endif
ifeq ($(NODE_BITS), 32)
	CPPFLAGS += -m32
endif
ifeq ($(NODE_BITS), 64)
	CPPFLAGS += -m64
endif

ifeq ($(NODE_PLATFORM), linux)
	COROUTINE_SO = coroutine.so
endif
ifeq ($(NODE_PLATFORM), darwin)
	COROUTINE_SO = coroutine.dylib
endif

Fix building when node is a symlink

# I know nothing about scons, waf, or autoconf. Sorry.
NODE_PREFIX := $(shell node --vars | egrep ^NODE_PREFIX: | cut -c14-)
NODE_PLATFORM := $(shell node --vars | egrep -o 'DPLATFORM="[^"]+' | cut -c12-)
NODE_BITS := $(shell file --dereference `which node` | egrep -o '[0-9]{2}-bit' | cut -c-2)

CPPFLAGS = -Wall -I$(NODE_PREFIX)/include -I$(NODE_PREFIX)/include/node
ifdef DEBUG
	CPPFLAGS += -ggdb -O0
else
	CPPFLAGS += -g -O3 -minline-all-stringops
endif

ifeq ($(NODE_BITS), )
	CPPFLAGS += -m32
endif
ifeq ($(NODE_BITS), 32)
	CPPFLAGS += -m32
endif
ifeq ($(NODE_BITS), 64)
	CPPFLAGS += -m64
endif

ifeq ($(NODE_PLATFORM), linux)
	COROUTINE_SO = coroutine.so
endif
ifeq ($(NODE_PLATFORM), darwin)
	COROUTINE_SO = coroutine.dylib
endif


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

python_1: $(RCPTS)/python_1.rcpt

$(RCPTS)/python_1.rcpt: $(python_1-archdeps)
	@touch $@

$(RCPTS)/python_1.a.rcpt: $(patsubst %,$(RCPTS)/%.rcpt,gcc_4 expat_1 openssl_1-64.b ldconfig_2 rsync_python)
	@touch $@


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

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

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

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

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

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

Fix download link for gitian builds

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

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

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

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

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

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


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

LOCAL_MODULE_TAGS := samples tests

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

LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4

LOCAL_PACKAGE_NAME := Support4Demos

LOCAL_SDK_VERSION := current

include $(BUILD_PACKAGE)

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

Fix up the makefiles and some samples.

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

LOCAL_MODULE_TAGS := samples tests

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

LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4

LOCAL_PACKAGE_NAME := Support4Demos

LOCAL_SDK_VERSION := current

LOCAL_DEX_PREOPT := false

include $(BUILD_PACKAGE)

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


mutate: test ## Run mutation tests
	@echo "DATABASE_URL: $(DATABASE_URL)"
	@echo "Running mutation tests"
	@MUTATING=true DATABASE_URL=$(DATABASE_URL) bundle exec mutant --include lib \
		$(addprefix --require ,$(REQUIRE)) \
		$(addprefix --ignore-subject ,$(IGNORE)) \
		--use rspec "$(SUBJECT)"

mutate-fast: ## Run mutation tests with --fail-fast
	@echo "Running mutation tests"
	@MUTATING=true DATABASE_URL=$(DATABASE_URL) bundle exec mutant --include lib \
		$(addprefix --require ,$(REQUIRE)) \
		$(addprefix --ignore-subject ,$(IGNORE)) \
		--fail-fast \
		--use rspec "$(SUBJECT)"

mutate-changes: ## Run mutation tests for all changes since origin/HEAD
	@echo "Running mutation tests"
	@MUTATING=true DATABASE_URL=$(DATABASE_URL) bundle exec mutant --include lib \
		$(addprefix --require ,$(REQUIRE)) \
		$(addprefix --ignore-subject ,$(IGNORE)) \
		--since origin/HEAD \
		--use rspec "$(SUBJECT)"

Revert "Little help debugging failing Circle builds."

mutate: test ## Run mutation tests
	@echo "Running mutation tests"
	@MUTATING=true DATABASE_URL=$(DATABASE_URL) bundle exec mutant --include lib \
		$(addprefix --require ,$(REQUIRE)) \
		$(addprefix --ignore-subject ,$(IGNORE)) \
		--use rspec "$(SUBJECT)"

mutate-fast: ## Run mutation tests with --fail-fast
	@echo "Running mutation tests"
	@MUTATING=true DATABASE_URL=$(DATABASE_URL) bundle exec mutant --include lib \
		$(addprefix --require ,$(REQUIRE)) \
		$(addprefix --ignore-subject ,$(IGNORE)) \
		--fail-fast \
		--use rspec "$(SUBJECT)"

mutate-changes: ## Run mutation tests for all changes since origin/HEAD
	@echo "Running mutation tests"
	@MUTATING=true DATABASE_URL=$(DATABASE_URL) bundle exec mutant --include lib \
		$(addprefix --require ,$(REQUIRE)) \
		$(addprefix --ignore-subject ,$(IGNORE)) \
		--since origin/HEAD \
		--use rspec "$(SUBJECT)"


# $FreeBSD$

# Search for kernel source tree in standard places.
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/)
SYSDIR=	${_dir}
.endif
.endfor
.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || !exists(${SYSDIR}/conf/)
.error "can't find kernel source tree"
.endif

.include "${SYSDIR}/conf/kmod.mk"

Add ${.CURDIR}/../../../.. to the list of places we look for the kernel. The new moudles/sound/drivers/foo pushes us down one more level.

# $FreeBSD$

# Search for kernel source tree in standard places.
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. /sys /usr/src/sys
.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/)
SYSDIR=	${_dir}
.endif
.endfor
.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || !exists(${SYSDIR}/conf/)
.error "can't find kernel source tree"
.endif

.include "${SYSDIR}/conf/kmod.mk"


# Copyright 2008 Roy Marples

CFLAGS+=	-D_BSD_SOURCE -D_XOPEN_SOURCE=600
LIBDL=		-Wl,-Bdynamic -ldl

Add license blurb to a few files and append my email to my name.

# Copyright 2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

CFLAGS+=	-D_BSD_SOURCE -D_XOPEN_SOURCE=600
LIBDL=		-Wl,-Bdynamic -ldl


LOCAL_PATH := $(call my-dir)

GST_OPENMAX_TOP := $(LOCAL_PATH)

include $(CLEAR_VARS)

include $(GST_OPENMAX_TOP)/util/Android.mk
include $(GST_OPENMAX_TOP)/omx/Android.mk

Build gst-openmax only if BUILD_WITH_GST option provided.

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

LOCAL_PATH := $(call my-dir)

GST_OPENMAX_TOP := $(LOCAL_PATH)

include $(CLEAR_VARS)

include $(GST_OPENMAX_TOP)/util/Android.mk
include $(GST_OPENMAX_TOP)/omx/Android.mk

endif


LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES:= 			\
	framing.c	\
	bitwise.c

# LOCAL_SHARED_LIBRARIES := 	\
#     libglib-2.0             	\
#     libgthread-2.0          	\
#     libgmodule-2.0          	\
#     libgobject-2.0

LOCAL_MODULE:= libogg

LOCAL_C_INCLUDES := 				\
	$(LOCAL_PATH)	\
	$(LIBOGG_TOP)/include

include $(BUILD_SHARED_LIBRARY)

Build libogg as a static library since it'll only be used through the gst plugin

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES:= 			\
	framing.c	\
	bitwise.c

# LOCAL_SHARED_LIBRARIES := 	\
#     libglib-2.0             	\
#     libgthread-2.0          	\
#     libgmodule-2.0          	\
#     libgobject-2.0

LOCAL_MODULE:= libogg

LOCAL_C_INCLUDES := 				\
	$(LOCAL_PATH)	\
	$(LIBOGG_TOP)/include

include $(BUILD_STATIC_LIBRARY)


.PHONY: image tag show-tag
default: push

ORG?=linuxkit
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
BASE_DEPS=Dockerfile Makefile

DIRTY=$(shell git diff-index --quiet HEAD -- ../$(notdir $(CURDIR)) || echo "-dirty")
TAG=$(HASH)$(DIRTY)

# Get a release tag, if present
RELEASE=$(shell git tag -l --points-at HEAD)

ifdef NETWORK
NET_OPT=
else
NET_OPT=--network=none
endif

show-tag:
	@echo $(ORG)/$(IMAGE):$(TAG)

tag: $(BASE_DEPS) $(DEPS)
	DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(TAG) || \
	docker build $(NET_OPT) -t $(ORG)/$(IMAGE):$(TAG) .

push: tag
ifneq ($(DIRTY),)
	$(error Your repository is not clean. Will not push package image.)
endif
	DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(TAG) || \
	DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(TAG)
ifneq ($(RELEASE),)
	docker tag $(ORG)/$(IMAGE):$(TAG) $(ORG)/$(IMAGE):$(RELEASE)
	DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(RELEASE)
endif

Consolidate $(TAG) to be the full tag

.PHONY: image tag show-tag
default: push

ORG?=linuxkit
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
BASE_DEPS=Dockerfile Makefile

DIRTY=$(shell git diff-index --quiet HEAD -- ../$(notdir $(CURDIR)) || echo "-dirty")
TAG=$(ORG)/$(IMAGE):$(HASH)$(DIRTY)

# Get a release tag, if present
RELEASE=$(shell git tag -l --points-at HEAD)

ifdef NETWORK
NET_OPT=
else
NET_OPT=--network=none
endif

show-tag:
	@echo $(TAG)

tag: $(BASE_DEPS) $(DEPS)
	DOCKER_CONTENT_TRUST=1 docker pull $(TAG) || \
	docker build $(NET_OPT) -t $(TAG) .

push: tag
ifneq ($(DIRTY),)
	$(error Your repository is not clean. Will not push package image.)
endif
	DOCKER_CONTENT_TRUST=1 docker pull $(TAG) || \
	DOCKER_CONTENT_TRUST=1 docker push $(TAG)
ifneq ($(RELEASE),)
	docker tag $(TAG) $(ORG)/$(IMAGE):$(RELEASE)
	DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(RELEASE)
endif


# $PostgreSQL: pgsql/src/pl/plpgsql/src/nls.mk,v 1.4 2009/02/17 12:51:59 petere Exp $
CATALOG_NAME	:= plpgsql
AVAIL_LANGUAGES	:= es
GETTEXT_FILES	:= pl_comp.c pl_exec.c pl_gram.c pl_funcs.c pl_handler.c pl_scan.c
GETTEXT_TRIGGERS:= _ errmsg errdetail errdetail_log errhint errcontext validate_tupdesc_compat:3 yyerror

.PHONY: gettext-files
gettext-files: distprep

Add plpgsql_yyerror to gettext triggers

# $PostgreSQL: pgsql/src/pl/plpgsql/src/nls.mk,v 1.5 2009/02/17 12:59:35 petere Exp $
CATALOG_NAME	:= plpgsql
AVAIL_LANGUAGES	:= es
GETTEXT_FILES	:= pl_comp.c pl_exec.c pl_gram.c pl_funcs.c pl_handler.c pl_scan.c
GETTEXT_TRIGGERS:= _ errmsg errdetail errdetail_log errhint errcontext validate_tupdesc_compat:3 yyerror plpgsql_yyerror

.PHONY: gettext-files
gettext-files: distprep


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

# Customize below to fit your system

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

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

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

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

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

# compiler and linker
CC = cc

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

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

# Customize below to fit your system

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

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

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

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

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

# compiler and linker
CC = cc


# $Id$
#

include build2/generated_lists

PHP_AUTOCONF ?= 'autoconf'
PHP_AUTOHEADER ?= 'autoheader'

all: configure config.h.in

aclocal.m4: configure.in acinclude.m4
	@echo rebuilding $@
	@if [ -f /usr/share/aclocal/ltsugar.m4 ]; then cat /usr/share/aclocal/lt~obsolete.m4 /usr/share/aclocal/ltoptions.m4 /usr/share/aclocal/ltsugar.m4 /usr/share/aclocal/ltversion.m4 >> ./build/libtool.m4; fi
	cat acinclude.m4 ./build/libtool.m4 php_gtk.m4 > $@

configure: aclocal.m4 php_gtk.m4 config.m4 $(config_m4_files)
	@echo rebuilding $@
	$(PHP_AUTOCONF)
	@chmod 755 $@

config.h.in: configure
# explicitly remove target since autoheader does not seem to work
# correctly otherwise (timestamps are not updated)
	@echo rebuilding $@
	@rm -f $@
	$(PHP_AUTOHEADER)

Remove broken "fix" for build issues with newer libtool

# $Id$
#

include build2/generated_lists

PHP_AUTOCONF ?= 'autoconf'
PHP_AUTOHEADER ?= 'autoheader'

all: configure config.h.in

aclocal.m4: configure.in acinclude.m4
	@echo rebuilding $@
	cat acinclude.m4 ./build/libtool.m4 php_gtk.m4 > $@

configure: aclocal.m4 php_gtk.m4 config.m4 $(config_m4_files)
	@echo rebuilding $@
	$(PHP_AUTOCONF)
	@chmod 755 $@

config.h.in: configure
# explicitly remove target since autoheader does not seem to work
# correctly otherwise (timestamps are not updated)
	@echo rebuilding $@
	@rm -f $@
	$(PHP_AUTOHEADER)


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

Fix coding style checks in out-of-tree builds.

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


#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org.  If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************

# mk file for Android Linux ARM using GCC, please make generic modifications to unxlng.mk

CDEFAULTOPT=-Os
.INCLUDE : unxlng.mk
CDEFS+=-DARM32
CFLAGS+=-fno-omit-frame-pointer
DLLPOSTFIX=lr

Include unxgcc and not unxlng, use unique DLLPOSTFIX

#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org.  If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************

# mk file for Android Linux ARM using GCC, please make generic modifications to unxgcc.mk

CDEFAULTOPT=-Os
.INCLUDE : unxgcc.mk
CDEFS+=-DARM32
CFLAGS+=-fno-omit-frame-pointer
DLLPOSTFIX=ar


APP_MODULES := WebGL2OpenGL4OculusMobileSDK
APP_ABI := armeabi-v7a
APP_PLATFORM := android-19
APP_STL := gnustl_static
NDK_TOOLCHAIN_VERSION=4.8
APP_LDFLAGS := -Wl,--build-id
NDK_APP_DST_DIR := build

Use toolchain 4.9. At least in Ubuntu it works.

APP_MODULES := WebGL2OpenGL4OculusMobileSDK
APP_ABI := armeabi-v7a
APP_PLATFORM := android-19
APP_STL := gnustl_static
NDK_TOOLCHAIN_VERSION=4.9
APP_LDFLAGS := -Wl,--build-id
NDK_APP_DST_DIR := build