Parse C++ bool, false and true.
[cparser] / Makefile
index 1f8c7b1..f7f50ca 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,31 +29,35 @@ SOURCES := \
        adt/obstack_printf.c \
        adt/xmalloc.c \
        ast.c \
-       ast2firm.c \
        diagnostic.c \
        entitymap.c \
        format_check.c \
        lexer.c \
        main.c \
-       parser.c \
+       walk_statements.c \
        symbol_table.c \
        token.c \
        type.c \
        types.c \
        type_hash.c \
        warning.c \
+       parser.c \
+       ast2firm.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 \
+       preprocessor.c
 
 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 = @
@@ -66,11 +70,16 @@ 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                                                 \
@@ -80,10 +89,10 @@ endif
        @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
+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): $(OBJECTS)
+$(GOAL): $(OBJECTS) $(LIBFIRM_FILE)
        @echo "===> LD $@"
        $(Q)$(CC) $(OBJECTS) $(LFLAGS) -o $(GOAL)
 
@@ -93,6 +102,8 @@ 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
@@ -107,9 +118,19 @@ $(DIRS):
        @echo "===> MKDIR $@"
        $(Q)mkdir -p $@
 
+builtins.h: builtins/builtins.c create_builtins_h.sh
+       @echo '===> CREATE_BUILTINS $<'
+       $(Q)./create_builtins_h.sh > $@
+
+main.c: builtins.h
+
 build/cpb/%.o: %.c build/cparser
        @echo '===> CPARSER $<'
-       $(Q)./build/cparser $(CPPFLAGS) -Wall -g3 -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 $<'
@@ -119,14 +140,18 @@ cparser.bootstrap: $(CPARSEROS)
        @echo "===> LD $@"
        $(Q)./build/cparser $(CPARSEROS) $(LFLAGS) -o $@
 
+cparser.bootstrape: $(CPARSEROS_E)
+       @echo "===> LD $@"
+       $(Q)gcc $(CPARSEROS_E) $(LFLAGS) -o $@
+
 cparser.bootstrap2: $(CPARSEROS2)
        @echo "===> LD $@"
        $(Q)./cparser.bootstrap $(CPARSEROS2) $(LFLAGS) -o $@
 
 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: