give stray-semicolon warning a name
[cparser] / Makefile
index 52f5da7..25690dc 100644 (file)
--- 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
@@ -25,30 +24,32 @@ LFLAGS += $(FIRM_LIBS)
 SOURCES := \
        adt/hashset.c \
        adt/strset.c \
-       adt/obstack.c \
-       adt/obstack_printf.c \
-       adt/xmalloc.c \
+       attribute.c \
+       parser.c \
        ast.c \
        ast2firm.c \
+       builtins.c \
        diagnostic.c \
+       driver/firm_machine.c \
+       driver/firm_opt.c \
+       driver/firm_timing.c \
+       entity.c \
        entitymap.c \
        format_check.c \
        lexer.c \
        main.c \
-       parser.c \
+       mangle.c \
+       preprocessor.c \
+       printer.c \
        symbol_table.c \
        token.c \
        type.c \
-       types.c \
        type_hash.c \
+       types.c \
+       walk_statements.c \
        warning.c \
-       write_fluffy.c \
-       write_caml.c \
-       driver/firm_cmdline.c \
-       driver/firm_timing.c \
-       driver/firm_codegen.c \
-       driver/firm_opt.c \
-       driver/gen_firm_asm.c \
+       wrappergen/write_fluffy.c \
+       wrappergen/write_jna.c
 
 OBJECTS = $(SOURCES:%.c=build/%.o)
 
@@ -60,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
@@ -74,21 +75,26 @@ config.h:
 %.h:
        @true
 
-.depend: config.h $(SOURCES)
-       @echo "#define cparser_REVISION \"`svnversion -n .`\"" > .revision.h
+REVISION ?= $(shell svnversion -n .)
+
+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;                                    \
            else                                                 \
              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
 
-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
+DIRS = build build/adt build/driver build/wrappergen build/cpb build/cpb/adt build/cpb/driver build/cpb/wrappergen build/cpb2 build/cpb2/adt build/cpb2/driver build/cpb2/wrappergen build/cpbe build/cpbe/adt build/cpbe/driver build/cpbe2/wrappergen
 UNUSED := $(shell mkdir -p $(DIRS))
 
-$(GOAL): $(OBJECTS)
+$(GOAL): $(OBJECTS) $(LIBFIRM_FILE)
        @echo "===> LD $@"
        $(Q)$(CC) $(OBJECTS) $(LFLAGS) -o $(GOAL)
 
@@ -110,16 +116,6 @@ 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
-       @echo '===> CREATE_BUILTINS $<'
-       $(Q)./create_builtins_h.sh > $@
-
-main.c: builtins.h
-
 build/cpb/%.o: %.c build/cparser
        @echo '===> CPARSER $<'
        $(Q)./build/cparser $(CPPFLAGS) -std=c99 -Wall -g3 -c $< -o $@
@@ -146,8 +142,8 @@ cparser.bootstrap2: $(CPARSEROS2)
 
 build/%.o: %.c
        @echo '===> CC $<'
-       $(Q)$(ICC) $(CPPFLAGS) $(ICC_CFLAGS) -c $< -o $@
-       $(Q)$(GCCO1) $(CPPFLAGS) $(CFLAGS) -O1 -c $< -o $@
+#$(Q)$(ICC) $(CPPFLAGS) $(ICC_CFLAGS) -c $< -o $@
+#$(Q)$(GCCO1) $(CPPFLAGS) $(CFLAGS) -O1 -c $< -o $@
        $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
 
 clean: