--- a/GNUmakefile +++ b/GNUmakefile @@ -46,8 +46,10 @@ CFLAGS_OPT=-pipe $(WARN) $(DEFINE) $(OPT #CFLAGS=-pipe -Os -march=pentiumpro -mcpu=pentiumpro -fomit-frame-pointer -fschedule-insns2 -Wall +# build time generators, native when cross compiling +HOSTCC?=$(CC) ent: ent.c haveuint128.h headers - $(CC) -g -o ent ent.c -I. + $(HOSTCC) -g -o ent ent.c -I. # CFLAGS += -fstrict-aliasing -Wstrict-aliasing=2 @@ -1390,6 +1392,9 @@ Makefile: GNUmakefile dep libdep srcdirs=$(subst :, ,$(VPATH)) srcfiles=$(foreach dir,$(srcdirs),$(wildcard $(dir)/*.c)) +json: json.c + $(HOSTCC) -o json json.c + compile_commands.json.tmpl: json ./json $(srcfiles) > $@