2 EXECUTABLES = install strip ln tar $(firstword $(CC)) $(firstword $(AR)) mkdir git echo cat
3 K := $(
foreach exec,$(EXECUTABLES),\
4 $(
if $(shell which $(exec)),some
string,$(error
"No $(exec) in PATH")))
7 INSTALL = $(shell which install)
8 STRIP = $(shell which strip)
10 TAR = $(shell which tar)
11 MKDIR = $(shell which mkdir)
12 GIT = $(shell which git)
13 ECHO = $(shell which echo)
14 CAT = $(shell which cat)
17 RAW_VERSION ?= $(
if $(shell git describe --tags 2> /dev/
null),$(shell git describe --tags),$(VERSION_PREFIX)v0.0.0)
18 VERSION = $(
if $(findstring .,$(RAW_VERSION)),$(subst $(VERSION_PREFIX)v,,$(strip $(RAW_VERSION))),$(strip $(RAW_VERSION)))
19 VERSION_PARTS = $(
if $(findstring .,$(RAW_VERSION)),$(subst ., ,$(VERSION)),0 0 0)
20 VMAJOR = $(word 1,$(VERSION_PARTS))
21 VMINOR = $(word 2,$(VERSION_PARTS))
22 VBUILD_FULL = $(word 3,$(VERSION_PARTS))
23 VBUILD = $(word 1,$(subst -, ,$(VBUILD_FULL)))
25 # the processor architecture
26 MACHINE ?= $(shell $(CC) -dumpmachine)
27 CC_PARTS = $(subst -, ,$(CC))
28 CC_NAME = $(word $(words $(CC_PARTS)),$(CC_PARTS))
32 ifeq ($(CONFIG_GATEWAY)$(CONFIG_ACCESSPOINT),)
38 LIBDIR ?= $(PREFIX)lib/$(MACHINE)
39 BINDIR ?= $(PREFIX)bin
40 INCLUDEDIR ?= $(PREFIX)include
41 INITDIR ?= /etc/init.d
43 DOCDIR ?= $(PREFIX)share/doc/libamxrt
44 PROCMONDIR ?= $(PREFIX)lib/processmonitor/scripts
46 # default config options
47 CONFIG_SAH_AMXRT_RWDATAPATH ?= /etc/
config