|
|
@ -1,5 +1,11 @@ |
|
|
|
CFLAGS=-O2 -g -std=gnu++11 -fvisibility=hidden -fpic -flto -pthread -Wall
|
|
|
|
OPTFLAGS=-O2 -flto -g
|
|
|
|
LDFLAGS=-O2 -fvisibility=hidden -Wl,--export-dynamic -fpic -flto -pthread -Wall
|
|
|
|
EXPORTFLAGS=-fvisibility=hidden -fpic -Wl,--export-dynamic
|
|
|
|
|
|
|
|
CPPFLAGS=-std=gnu++11 -I../include
|
|
|
|
|
|
|
|
LIBSFLAGS=-lpthread
|
|
|
|
|
|
|
|
WARNFLAGS=-Wall
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CFLAGS=$(OPTFLAGS) $(EXPORTFLAGS) $(WARNFLAGS) $(CPPFLAGS)
|
|
|
|
|
|
|
|
LDFLAGS=$(OPTFLAGS) $(EXPORTFLAGS) $(WARNFLAGS) $(LIBSFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
CC=g++
|
|
|
|
CC=g++
|
|
|
|
|
|
|
|
|
|
|
@ -16,27 +22,27 @@ include $(DEPENDS) |
|
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
|
|
|
|
%.d: %.cpp |
|
|
|
%.d: %.cpp |
|
|
|
$(CC) $(CFLAGS) -MM -MT $(subst .cpp,.o,$<) $< | sed 's%\(^.*\):%\1 $@ :%g' >$@
|
|
|
|
$(CC) $(CPPFLAGS) -MM -MT $(subst .cpp,.o,$<) $< | sed 's%\(^.*\):%\1 $@ :%g' >$@
|
|
|
|
|
|
|
|
|
|
|
|
$(DEPENDS): parser/grammatical.h parser/lexical.h |
|
|
|
$(DEPENDS): ../include/grammatical.h ../include/lexical.h |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parser/grammatical.d: parser/lexical.h |
|
|
|
parser/grammatical.d: ../include/lexical.h |
|
|
|
|
|
|
|
|
|
|
|
parser/lexical.cpp: parser/lexical.l |
|
|
|
parser/lexical.cpp: parser/lexical.l |
|
|
|
cd parser && flex lexical.l
|
|
|
|
cd parser && flex lexical.l
|
|
|
|
[ -f parser/lexical.h ] && touch parser/lexical.h
|
|
|
|
[ -f ../include/lexical.h ] && touch ../include/lexical.h
|
|
|
|
|
|
|
|
|
|
|
|
parser/grammatical.cpp: parser/grammatical.y |
|
|
|
parser/grammatical.cpp: parser/grammatical.y |
|
|
|
cd parser && bison grammatical.y
|
|
|
|
cd parser && bison grammatical.y
|
|
|
|
[ -f parser/grammatical.h ] && touch parser/grammatical.h
|
|
|
|
[ -f ../include/grammatical.h ] && touch ../include/grammatical.h
|
|
|
|
|
|
|
|
|
|
|
|
parser/grammatical.h: parser/grammatical.y parser/grammatical.cpp |
|
|
|
../include/grammatical.h: parser/grammatical.y parser/grammatical.cpp |
|
|
|
parser/lexical.h: parser/lexical.l parser/lexical.cpp |
|
|
|
../include/lexical.h: parser/lexical.l parser/lexical.cpp |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clean: |
|
|
|
clean: |
|
|
|
rm -f *.o *.d parser/*.{o,d} parser/{lexical,grammatical}.{cpp,h}
|
|
|
|
rm -f *.o *.d parser/*.{o,d} parser/{lexical,grammatical}.cpp ../include/{lexical,grammatical}.h
|
|
|
|
|
|
|
|
|
|
|
|
distclean: clean |
|
|
|
distclean: clean |
|
|
|
rm -f makemap
|
|
|
|
rm -f makemap
|