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.
42 lines
1.0 KiB
42 lines
1.0 KiB
CFLAGS=-O2 -g -std=gnu++11 -fvisibility=hidden -fpic |
|
LDFLAGS=-fvisibility=hidden -Wl,--export-dynamic -fpic |
|
|
|
CC=g++ |
|
|
|
SOURCE = $(wildcard *.cpp) parser/lexical.cpp parser/grammatical.cpp |
|
DEPENDS = $(subst .cpp,.d,$(SOURCE)) |
|
OBJECTS = $(subst .cpp,.o,$(SOURCE)) |
|
|
|
makemap: $(OBJECTS) |
|
$(CC) $(LDFLAGS) -o $@ $(OBJECTS) |
|
|
|
include $(DEPENDS) |
|
|
|
%.o: %.cpp |
|
$(CC) -c $(CFLAGS) -o $@ $< |
|
|
|
%.d: %.cpp |
|
$(CC) $(CFLAGS) -MM -MT $(subst .cpp,.o,$<) $< | sed 's%\(^.*\):%\1 $@ :%g' >$@ |
|
|
|
$(DEPENDS): parser/grammatical.h parser/lexical.h |
|
|
|
|
|
parser/grammatical.d: parser/lexical.h |
|
|
|
parser/lexical.cpp: parser/lexical.l |
|
cd parser && flex lexical.l |
|
[ -f parser/lexical.h ] && touch parser/lexical.h |
|
|
|
parser/grammatical.cpp: parser/grammatical.y |
|
cd parser && bison grammatical.y |
|
[ -f parser/grammatical.h ] && touch parser/grammatical.h |
|
|
|
parser/grammatical.h: parser/grammatical.y parser/grammatical.cpp |
|
parser/lexical.h: parser/lexical.l parser/lexical.cpp |
|
|
|
|
|
clean: |
|
rm -f *.o *.d parser/*.{o,d} parser/{lexical,grammatical}.{cpp,h} |
|
|
|
distclean: clean |
|
rm -f makemap
|