You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
738 B

CFLAGS=-O2 -g -std=gnu++11
LDFLAGS=
9 years ago
CC=g++
9 years ago
SOURCE = $(wildcard *.cpp) parser/lexical.cpp parser/grammatical.cpp
DEPENDS = $(subst .cpp,.d,$(SOURCE))
OBJECTS = $(subst .cpp,.o,$(SOURCE))
9 years ago
makemap: $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $(OBJECTS)
include $(DEPENDS)
%.o: %.cpp
$(CC) -c $(CFLAGS) -o $@ $<
9 years ago
%.d: %.cpp
$(CC) $(CFLAGS) -MM -MT $(subst .cpp,.o,$<) $< | sed 's%\(^.*\):%\1 $@ :%g' >$@
parser/grammatical.d: parser/lexical.h
9 years ago
parser/lexical.h parser/lexical.cpp: parser/lexical.l
cd parser && flex lexical.l
parser/grammatical.h parser/grammatical.cpp: parser/grammatical.y
cd parser && bison grammatical.y
9 years ago
clean:
rm -f *.o *.d parser/*.{o,d} parser/{lexical,grammatical}.{cpp,h}
9 years ago
distclean: clean
rm -f makemap