This repository has been archived on 2026-09-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
golem-v1-tinycbor/Makefile.configure
T
Fabrice Fontaine 8ba8e2030e Update cjson include path
Since cjson-v1.0.0 (https://github.com/DaveGamble/cJSON/releases),
cJSON.h is installed into cjson/cJSON.h and library has been renamed
from cJSON to cjson

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-18 15:47:32 -08:00

31 lines
1.1 KiB
Makefile

ALLTESTS = open_memstream funopen fopencookie gc_sections \
system-cjson cjson
MAKEFILE := $(lastword $(MAKEFILE_LIST))
OUT :=
PROGRAM-open_memstream = extern int open_memstream(); int main() { return open_memstream(); }
PROGRAM-funopen = extern int funopen(); int main() { return funopen(); }
PROGRAM-fopencookie = extern int fopencookie(); int main() { return fopencookie(); }
PROGRAM-gc_sections = int main() {}
CCFLAGS-gc_sections = -Wl,--gc-sections
PROGRAM-cjson = \#include <stdlib.h>\n
PROGRAM-cjson += \#include <cjson/cJSON.h>\n
PROGRAM-cjson += int main() { return cJSON_False; }
CCFLAGS-cjson = -I$(dir $(MAKEFILE))src/cjson
PROGRAM-system-cjson = $(PROGRAM-cjson)
CCFLAGS-system-cjson = -lcjson
sink:
@echo >&2 Please run from the top-level Makefile.
configure: $(foreach it,$(ALLTESTS),check-$(it))
check-%:
@echo $(subst check-,,$@)-tested := 1 $(OUT)
$(if $(V),,@)if printf "$($(subst check-,PROGRAM-,$@))" | \
$(CC) -xc $($(subst check-,CCFLAGS-,$@)) -o /dev/null - $(if $(V),,>/dev/null 2>&1); \
then \
echo $(subst check-,,$@)-pass := 1 $(OUT); \
fi