jtlc/Makefile
josh ba841d3bcf build parser first so parser.tab.hh will exist
git-svn-id: svn://anubis/jtlc/trunk@19 f5bc74b8-7b62-4e90-9214-7121d538519f
2010-01-13 22:41:26 +00:00

32 lines
535 B
Makefile

SHELL := bash
TARGET := jtlc
ifdef WIN32
TOPLEVEL := $(shell cd)
else
TOPLEVEL := $(shell pwd)
endif
export CPPFLAGS += -I"$(TOPLEVEL)"
export CXXFLAGS := -Wall -O2
LDFLAGS := -lfl
SUBDIRS := parser main nodes
all: $(TARGET)
.PHONY: $(TARGET)
$(TARGET):
@for d in $(SUBDIRS); \
do $(MAKE) -C $$d; \
ret=$$?; \
if [[ $$ret != 0 ]]; then \
exit $$ret; \
fi; \
done
$(CXX) -o $@ $(patsubst %,%/*.o,$(SUBDIRS)) $(CXXFLAGS) $(LDFLAGS)
clean:
for d in $(SUBDIRS); do $(MAKE) -C $$d clean CLEAN=1; done
-rm -f $(TARGET)