X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=Makefile;h=272bbee43ecd52f847a3b80280eb3548f95df9ac;hb=9fc7bb03d5232142420b4bff0d82f1a05bd64aba;hp=aeec9ab80f5985f233e3a9b672611116bba1aa4e;hpb=2efeabdc4a9d6cdac10ea4ed0cd35874fbc68185;p=cparser diff --git a/Makefile b/Makefile index aeec9ab..272bbee 100644 --- a/Makefile +++ b/Makefile @@ -7,15 +7,14 @@ BUILDDIR ?= build FIRM_CFLAGS ?= `pkg-config --cflags libfirm` FIRM_LIBS ?= `pkg-config --libs libfirm` -CPPFLAGS = -DHAVE_CONFIG_H -DFIRM_BACKEND -CPPFLAGS += -I. +CPPFLAGS = -I. CPPFLAGS += $(FIRM_CFLAGS) -CFLAGS += -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Werror -std=c99 -pedantic -CFLAGS += -O0 -g3 +CFLAGS += -Wall -W -Wstrict-prototypes -Wmissing-prototypes -std=c99 -pedantic +CFLAGS += -O2 -g #CFLAGS += -O3 -march=pentium4 -fomit-frame-pointer -DNDEBUG #CFLAGS += -pg -O3 -fno-inline -ICC_CFLAGS = -O0 -g3 -std=c99 -Wall -Werror +ICC_CFLAGS = -O0 -g3 -std=c99 -Wall #LFLAGS += -pg ICC ?= true GCCO1 ?= true @@ -24,17 +23,14 @@ LFLAGS += $(FIRM_LIBS) SOURCES := \ adt/hashset.c \ - adt/obstack.c \ - adt/obstack_printf.c \ adt/strset.c \ - adt/xmalloc.c \ attribute.c \ parser.c \ ast.c \ ast2firm.c \ + builtins.c \ diagnostic.c \ - driver/firm_cmdline.c \ - driver/firm_codegen.c \ + driver/firm_machine.c \ driver/firm_opt.c \ driver/firm_timing.c \ entity.c \ @@ -44,6 +40,7 @@ SOURCES := \ main.c \ mangle.c \ preprocessor.c \ + printer.c \ symbol_table.c \ token.c \ type.c \ @@ -51,7 +48,6 @@ SOURCES := \ types.c \ walk_statements.c \ warning.c \ - wrappergen/write_caml.c \ wrappergen/write_fluffy.c \ wrappergen/write_jna.c @@ -65,9 +61,9 @@ CPARSEROS2 = $(SOURCES:%.c=build/cpb2/%.o) Q = @ -all: $(DIRS) $(GOAL) +all: $(GOAL) -.PHONY: all clean dirs bootstrap bootstrap2 +.PHONY: all clean bootstrap bootstrap2 ifeq ($(findstring $(MAKECMDGOALS), clean depend),) -include .depend @@ -81,7 +77,8 @@ config.h: REVISION ?= $(shell svnversion -n .) -.depend: config.h $(SOURCES) +revision.h: + @echo "===> GEN $@" @echo "#define cparser_REVISION \"$(REVISION)\"" > .revision.h $(Q)if diff -Nq .revision.h revision.h > /dev/null; then \ rm .revision.h; \ @@ -89,6 +86,8 @@ REVISION ?= $(shell svnversion -n .) echo "===> UPDATING revision.h"; \ mv .revision.h revision.h; \ fi + +.depend: config.h revision.h $(SOURCES) @echo "===> DEPEND" @rm -f $@ && touch $@ && makedepend -p "$@ build/" -Y -f $@ -- $(CPPFLAGS) -- $(SOURCES) 2> /dev/null && rm $@.bak @@ -117,15 +116,11 @@ bootstrap2: build/cpb2 build/cpb2/adt build/cpb2/driver $(CPARSEROS2) cparser.bo @echo '===> CPARSER $<' $(Q)./cparser $(CPPFLAGS) -fsyntax-only $< -$(DIRS): - @echo "===> MKDIR $@" - $(Q)mkdir -p $@ - -builtins.h: builtins/builtins.c create_builtins_h.sh +gen_builtins.h: builtins/builtins.c create_builtins_h.sh @echo '===> CREATE_BUILTINS $<' - $(Q)./create_builtins_h.sh > $@ + $(Q)./create_builtins_h.sh "$<" > $@ -main.c: builtins.h +main.c: gen_builtins.h build/cpb/%.o: %.c build/cparser @echo '===> CPARSER $<' @@ -159,4 +154,4 @@ build/%.o: %.c clean: @echo '===> CLEAN' - $(Q)rm -rf builtins.h build/* $(GOAL) .depend + $(Q)rm -rf gen_builtins.h build/* $(GOAL) .depend