1 ALLTESTS = open_memstream funopen gc_sections \
3 MAKEFILE := $(lastword $(MAKEFILE_LIST))
6 PROGRAM-open_memstream = extern int open_memstream(); int main() { return open_memstream(); }
7 PROGRAM-funopen = extern int funopen(); int main() { return funopen(); }
8 PROGRAM-gc_sections = int main() {}
9 CCFLAGS-gc_sections = -Wl,--gc-sections
11 PROGRAM-cjson = \#include <stdlib.h>\n
12 PROGRAM-cjson += \#include <cJSON.h>\n
13 PROGRAM-cjson += int main() { return cJSON_False; }
14 CCFLAGS-cjson = -I$(dir $(MAKEFILE))src/cjson
15 PROGRAM-system-cjson = $(PROGRAM-cjson)
16 CCLFAGS-system-cjson = -lcJSON
19 @echo >&2 Please run from the top-level Makefile.
21 configure: $(foreach it,$(ALLTESTS),check-$(it))
24 @echo $(subst check-,,$@)-tested := 1 $(OUT)
25 $(if $(V),,@)if echo -e "$($(subst check-,PROGRAM-,$@))" | \
26 $(CC) -xc $($(subst check-,CCFLAGS-,$@)) -o /dev/null - $(if $(V),,>/dev/null 2>&1); \
28 echo $(subst check-,,$@)-pass := 1 $(OUT); \