X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=Makefile;h=34b231fca858a3986b503553a7109885900f3658;hb=42fd8154a43a0c62c64f87b2d248fa73615071b9;hp=5283f9e5b890b4881feb232fcfb559fe1bfba12b;hpb=f77391ed28aebda884eb01455f34a2934208c5b7;p=cparser diff --git a/Makefile b/Makefile index 5283f9e..34b231f 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ CFLAGS += -O0 -g3 #CFLAGS += -O3 -march=pentium4 -fomit-frame-pointer -DNDEBUG #CFLAGS += -pg -O3 -fno-inline ICC_CFLAGS = -O0 -g3 -std=c99 -Wall -Werror -LFLAGS += -pg +#LFLAGS += -pg ICC ?= true GCCO1 ?= true @@ -31,6 +31,7 @@ SOURCES := \ ast.c \ ast2firm.c \ diagnostic.c \ + entitymap.c \ format_check.c \ lexer.c \ main.c \ @@ -42,6 +43,7 @@ SOURCES := \ type_hash.c \ warning.c \ write_fluffy.c \ + write_caml.c \ driver/firm_cmdline.c \ driver/firm_timing.c \ driver/firm_codegen.c \ @@ -53,23 +55,29 @@ OBJECTS = $(SOURCES:%.c=build/%.o) SPLINTS = $(addsuffix .splint, $(SOURCES)) CPARSERS = $(addsuffix .cparser, $(SOURCES)) CPARSEROS = $(SOURCES:%.c=build/cpb/%.o) +CPARSEROS_E = $(SOURCES:%.c=build/cpbe/%.o) CPARSEROS2 = $(SOURCES:%.c=build/cpb2/%.o) Q = @ -.PHONY : all clean dirs +all: $(DIRS) $(GOAL) -all: $(GOAL) +.PHONY: all clean dirs bootstrap bootstrap2 ifeq ($(findstring $(MAKECMDGOALS), clean depend),) -include .depend endif +config.h: + cp config.h.in $@ + %.h: @true -.depend: $(SOURCES) - @echo "#define cparser_REVISION \"`svnversion -n .`\"" > .revision.h +REVISION ?= $(shell svnversion -n .) + +.depend: config.h $(SOURCES) + @echo "#define cparser_REVISION \"$(REVISION)\"" > .revision.h $(Q)if diff -Nq .revision.h revision.h > /dev/null; then \ rm .revision.h; \ else \ @@ -79,19 +87,21 @@ endif @echo "===> DEPEND" @rm -f $@ && touch $@ && makedepend -p "$@ build/" -Y -f $@ -- $(CPPFLAGS) -- $(SOURCES) 2> /dev/null && rm $@.bak -DIRS = build/adt build/driver build/cpb build/cpb/adt build/cpb/driver build/cpb2 build/cpb2/adt build/cpb2/driver +DIRS = build build/adt build/driver build/cpb build/cpb/adt build/cpb/driver build/cpb2 build/cpb2/adt build/cpb2/driver build/cpbe build/cpbe/adt build/cpbe/driver +UNUSED := $(shell mkdir -p $(DIRS)) -$(GOAL): $(DIRS) $(OBJECTS) +$(GOAL): $(OBJECTS) @echo "===> LD $@" $(Q)$(CC) $(OBJECTS) $(LFLAGS) -o $(GOAL) - splint: $(SPLINTS) selfcheck: $(CPARSERS) bootstrap: build/cpb build/cpb/adt build/cpb/driver $(CPARSEROS) cparser.bootstrap +bootstrape: build/cpb build/cpb/adt build/cpb/driver $(CPARSEROS_E) cparser.bootstrape + bootstrap2: build/cpb2 build/cpb2/adt build/cpb2/driver $(CPARSEROS2) cparser.bootstrap2 %.c.splint: %.c @@ -106,9 +116,19 @@ $(DIRS): @echo "===> MKDIR $@" $(Q)mkdir -p $@ -build/cpb/%.o: %.c cparser +builtins.h: builtins/builtins.c + @echo '===> CREATE_BUILTINS $<' + $(Q)./create_builtins_h.sh > $@ + +main.c: builtins.h + +build/cpb/%.o: %.c build/cparser @echo '===> CPARSER $<' - $(Q)./cparser $(CPPFLAGS) -Wall -g -c $< -o $@ + $(Q)./build/cparser $(CPPFLAGS) -std=c99 -Wall -g3 -c $< -o $@ + +build/cpbe/%.o: %.c + @echo '===> ECCP $<' + $(Q)eccp $(CPPFLAGS) -std=c99 -Wall -c $< -o $@ build/cpb2/%.o: %.c cparser.bootstrap @echo '===> CPARSER.BOOTSTRAP $<' @@ -116,11 +136,15 @@ build/cpb2/%.o: %.c cparser.bootstrap cparser.bootstrap: $(CPARSEROS) @echo "===> LD $@" - $(Q)$(CC) $(CPARSEROS) $(LFLAGS) -o $@ + $(Q)./build/cparser $(CPARSEROS) $(LFLAGS) -o $@ + +cparser.bootstrape: $(CPARSEROS_E) + @echo "===> LD $@" + $(Q)gcc $(CPARSEROS_E) $(LFLAGS) -o $@ cparser.bootstrap2: $(CPARSEROS2) @echo "===> LD $@" - $(Q)$(CC) $(CPARSEROS2) $(LFLAGS) -o $@ + $(Q)./cparser.bootstrap $(CPARSEROS2) $(LFLAGS) -o $@ build/%.o: %.c @echo '===> CC $<'