diff options
Diffstat (limited to 'utils/Burg/Makefile')
-rw-r--r-- | utils/Burg/Makefile | 102 |
1 files changed, 17 insertions, 85 deletions
diff --git a/utils/Burg/Makefile b/utils/Burg/Makefile index c22bd55..a70f2ea 100644 --- a/utils/Burg/Makefile +++ b/utils/Burg/Makefile @@ -1,100 +1,32 @@ # $Id$ - LEVEL = ../.. +TOOLNAME = burg +EXTRASOURCES = gram.tab.c -UNAME := $(shell uname) -include $(LEVEL)/Makefile.config -include $(LEVEL)/Makefile.$(UNAME) - -TARGET = burg.$(UNAME) - -#CFLAGS = -#CFLAGS = -O -#CFLAGS = -O -DNOLEX -CFLAGS = -g -DDEBUG -#CFLAGS = -g -DNOLEX -DDEBUG - -SRCS = \ - be.c \ - burs.c \ - closure.c \ - delta.c \ - fe.c \ - item.c \ - lex.c \ - list.c \ - main.c \ - map.c \ - nonterminal.c \ - operator.c \ - pattern.c \ - plank.c \ - queue.c \ - rule.c \ - string.c \ - symtab.c \ - table.c \ - trim.c \ - zalloc.c - -BU_OBJS = \ - burs.o \ - closure.o \ - delta.o \ - item.o \ - list.o \ - map.o \ - nonterminal.o \ - operator.o \ - pattern.o \ - queue.o \ - rule.o \ - table.o \ - trim.o \ - zalloc.o - -BU_OBJS := $(addprefix $(UNAME)/,$(BU_OBJS)) - -FE_OBJS = \ - be.o \ - fe.o \ - lex.o \ - main.o \ - plank.o \ - string.o \ - symtab.o \ - y.tab.o - -FE_OBJS := $(addprefix $(UNAME)/,$(FE_OBJS)) - -all: $(TARGET) - - -$(TARGET): $(BU_OBJS) $(FE_OBJS) - $(CC) -o $(TARGET) $(CFLAGS) $(BU_OBJS) $(FE_OBJS) +include $(LEVEL)/Makefile.common -y.tab.c y.tab.h: gram.y - yacc -d gram.y +gram.tab.c gram.tab.h: gram.yc + $(VERB) $(BISON) -d $< + $(VERB) mv -f gram.tab.cc gram.tab.c + $(VERB) mv -f gram.tab.hc gram.tab.h -clean: - rm -rf $(UNAME) *.o y.tab.h y.tab.c core burg *.aux *.log *.dvi sample sample.c tmp +clean:: + rm -ff y.tab.h y.tab.c core *.aux *.log *.dvi sample sample.c tmp $(FE_OBJS): b.h $(BU_OBJS): b.h $(FE_OBJS): fe.h -lex.o: y.tab.h +$(BUILD_ROOT)/Release/lex.o $(BUILD_ROOT)/Profile/lex.o $(BUILD_ROOT)/Debug/lex.o: gram.tab.h doc.dvi: doc.tex latex doc; latex doc -$(UNAME)/%.o: %.c - $(VERB) $(CC) -c -g $< -o $@ -test: $(TARGET) sample.gr - ./$(TARGET) -I <sample.gr >sample.c && cc $(CFLAGS) -o sample sample.c && ./sample - ./$(TARGET) -I sample.gr >tmp && cmp tmp sample.c - ./$(TARGET) -I <sample.gr -o tmp && cmp tmp sample.c - ./$(TARGET) -I sample.gr -o tmp && cmp tmp sample.c - ./$(TARGET) -I -O0 <sample.gr >tmp && cmp tmp sample.c - ./$(TARGET) -I -= <sample.gr >tmp && cmp tmp sample.c +test: $(TOOLEXENAME_G) sample.gr + $(TOOLEXENAME_G) -I <sample.gr >sample.c && $(CC) $(CFLAGS) -o sample sample.c && ./sample + $(TOOLEXENAME_G) -I sample.gr >tmp && cmp tmp sample.c + $(TOOLEXENAME_G) -I <sample.gr -o tmp && cmp tmp sample.c + $(TOOLEXENAME_G) -I sample.gr -o tmp && cmp tmp sample.c + $(TOOLEXENAME_G) -I -O0 <sample.gr >tmp && cmp tmp sample.c + $(TOOLEXENAME_G) -I -= <sample.gr >tmp && cmp tmp sample.c |