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-v2-tinycbor/Makefile.configure
T
Thiago Macieira 481ec6e8a9 Use printf instead of echo -e in Makefile.configure
echo -e is not POSIX-compliant, but printf is supposed to interpret
escaped sequences like \n.

Fixes: #34
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2016-07-22 08:51:40 -07:00

30 lines
991 B
Makefile

ALLTESTS = open_memstream funopen 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-gc_sections = int main() {}
CCFLAGS-gc_sections = -Wl,--gc-sections
PROGRAM-cjson = \#include <stdlib.h>\n
PROGRAM-cjson += \#include <cJSON.h>\n
PROGRAM-cjson += int main() { return cJSON_False; }
CCFLAGS-cjson = -I$(dir $(MAKEFILE))src/cjson
PROGRAM-system-cjson = $(PROGRAM-cjson)
CCLFAGS-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