diff options
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 144 |
1 files changed, 29 insertions, 115 deletions
diff --git a/Makefile.in b/Makefile.in index 9b247eae..c16f4e8d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -19,143 +19,57 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# Logging: -# colm: rt on/off -# rt_prd: off -# rt_db: on -# rt_clm: rt on/off - -INCS += -I../aapl - -DEFS_COLM += -DCOLM_LOG -DPREFIX='"$(prefix)"' -DEFS_RT_P += -DEFS_RT_D += -DCOLM_LOG - -CFLAGS += -g -Wall -Wwrite-strings -LDFLAGS += - -# Frequently changed ones first. -COLM_SRC = \ - compile.cpp \ - lmparse.cpp \ - lmscan.cpp \ - parsetree.cpp \ - parsedata.cpp \ - fsmstate.cpp \ - fsmbase.cpp \ - fsmattach.cpp \ - fsmmin.cpp \ - fsmgraph.cpp \ - pdagraph.cpp \ - pdabuild.cpp \ - pdacodegen.cpp \ - fsmcodegen.cpp \ - redfsm.cpp \ - fsmexec.cpp \ - main.cpp \ - redbuild.cpp \ - closure.cpp \ - fsmap.cpp \ - dotgen.cpp \ - pcheck.cpp - -RUNTIME_SRC = fsmrun.cpp pdarun.cpp bytecode.cpp list.cpp \ - map.cpp string.cpp input.cpp tree.cpp - -ALL_SRC = $(COLM_SRC) $(RUNTIME_SRC) - -# Files in ALL_SRC that are generated. -GEN_SRC = version.h lmscan.cpp lmparse.h lmparse.cpp - -RUNTIME_P = libcolmp.a -RUNTIME_D = libcolmd.a - -LIBS = +BUILD_SUBDIRS = colm +ALL_SUBDIRS = $(BUILD_SUBDIRS) test #************************************* -# Get the version info. -include ../version.mk - -prefix = @prefix@ - -BUILD_PARSERS = @BUILD_PARSERS@ - # Programs CXX = @CXX@ -# Get objects and dependencies from sources. -COLM_OBJ = $(COLM_SRC:%.cpp=%.o) -RUNTIME_OBJ_P = $(RUNTIME_SRC:%.cpp=%_p.o) -RUNTIME_OBJ_D = $(RUNTIME_SRC:%.cpp=%_d.o) - -DEPS = $(COLM_SRC:%.cpp=.%.d) $(RUNTIME_SRC:%.cpp=.%_p.d) $(RUNTIME_SRC:%.cpp=.%_d.d) - -# Rules. -all: colm $(RUNTIME_P) $(RUNTIME_D) +# Get the version info. +include version.mk -colm: $(GEN_SRC) $(COLM_OBJ) $(RUNTIME_OBJ_D) $(LIBS) - $(CXX) $(LDFLAGS) -o $@ $(COLM_OBJ) $(RUNTIME_OBJ_D) $(LIBS) +# build targets +all: $(BUILD_SUBDIRS) -$(RUNTIME_P): $(RUNTIME_OBJ_P) - ar -cr $@ $^ +.PHONY: $(BUILD_SUBDIRS) -$(RUNTIME_D): $(RUNTIME_OBJ_D) - ar -cr $@ $^ +$(BUILD_SUBDIRS): + @cd $@ && $(MAKE) -version.h: ../version.mk - echo '#define VERSION "$(VERSION)"' > version.h - echo '#define PUBDATE "$(PUBDATE)"' >> version.h +# clean targets. -ifeq ($(BUILD_PARSERS),true) +CLEAN_SUBDIRS = $(ALL_SUBDIRS:%=%-clean) -lmparse.h: lmparse.kh - kelbt -o $@ $< +.PHONY: $(CLEAN_SUBDIRS) -lmparse.cpp: lmparse.kl lmparse.kh - kelbt -o $@ $< +$(CLEAN_SUBDIRS): + @cd $(@:%-clean=%) && $(MAKE) clean -lmscan.cpp: lmparse.h +clean: $(CLEAN_SUBDIRS) + rm -f tags -lmscan.cpp: lmscan.rl - ragel -G2 -o $@ $< +# distcleaan targets -endif +DISTCLEAN_SUBDIRS = $(ALL_SUBDIRS:%=%-distclean) -$(COLM_OBJ): %.o: %.cpp - @$(CXX) -M $(DEFS_COLM) $(INCS) $< > .$*.d - $(CXX) -c $(CFLAGS) $(DEFS_COLM) $(INCS) -o $@ $< +.PHONY: $(DISTCLEAN_SUBDIRS) -$(RUNTIME_OBJ_P): %_p.o: %.cpp - @$(CXX) -M -MT $@ $(DEFS_RT_P) $(INCS) $< > .$*_p.d - $(CXX) -c $(CFLAGS) $(DEFS_RT_P) $(INCS) -o $@ $< +$(DISTCLEAN_SUBDIRS): + @cd $(@:%-distclean=%) && $(MAKE) clean -$(RUNTIME_OBJ_D): %_d.o: %.cpp - @$(CXX) -M -MT $@ $(DEFS_RT_D) $(INCS) $< > .$*_d.d - $(CXX) -c $(CFLAGS) $(DEFS_RT_D) $(INCS) -o $@ $< +distclean: $(DISTCLEAN_SUBDIRS) + rm -f Makefile config.cache config.status config.log +#install targets -distclean: clean - rm -f Makefile config.h +INSTALL_SUBDIRS = $(BUILD_SUBDIRS:%=%-install) -ifeq ($(BUILD_PARSERS),true) -EXTRA_CLEAN = $(GEN_SRC) -endif +.PHONY: $(INSTALL_SUBDIRS) -clean: - rm -f tags .*.d *.o colm $(EXTRA_CLEAN) $(RUNTIME_P) $(RUNTIME_D) +$(INSTALL_SUBDIRS): + @cd $(@:%-install=%) && $(MAKE) install -install: all - install -d $(prefix)/bin - install -d $(prefix)/include - install -d $(prefix)/include/colm - install -d $(prefix)/lib - install -s colm $(prefix)/bin/colm - install libcolmp.a libcolmd.a $(prefix)/lib - install ../aapl/astring.h ../aapl/avlcommon.h ../aapl/avlmap.h \ - ../aapl/compare.h ../aapl/dlcommon.h ../aapl/dlist.h \ - ../aapl/dlistval.h ../aapl/resize.h ../aapl/table.h \ - ../aapl/vector.h bytecode.h config.h fsmrun.h input.h \ - pdarun.h $(prefix)/include/colm +install: $(INSTALL_SUBDIRS) --include $(DEPS) |