#
-# Copyright 2001-2006 Adrian Thurston <thurston@cs.queensu.ca>
+# Copyright 2001-2007 Adrian Thurston <thurston@complang.org>
#
# This file is part of Ragel.
# along with Ragel; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-SUBDIRS = common ragel rlcodegen javagen test examples doc
+BUILD_COMMON = common redfsm rlgen-cd rlgen-java rlgen-ruby rlgen-csharp rlgen-dot
+BUILD_SUBDIRS = ragel
+ALL_SUBDIRS = $(BUILD_COMMON) $(BUILD_SUBDIRS) test examples doc
#*************************************
# Get the version info.
include version.mk
-# Rules.
-all:
- @cd common && $(MAKE) && cd ../ragel && $(MAKE) && \
- cd ../rlcodegen && $(MAKE) && cd ../javagen && $(MAKE)
+# build targets
+all: $(BUILD_SUBDIRS)
-new-version:
- sed 's/^\(Version:[[:space:]]*\)[0-9.]*$$/\1$(VERSION)/' ragel.spec > spec-new
- cat spec-new > ragel.spec && rm spec-new
+.PHONY: $(ALL_SUBDIRS)
-distclean: distclean-rec distclean-local
+$(BUILD_COMMON):
+ @cd $@ && $(MAKE)
-distclean-rec:
- for dir in $(SUBDIRS); do cd $$dir; $(MAKE) distclean; cd ..; done
+$(BUILD_SUBDIRS): $(BUILD_COMMON)
+ @cd $@ && $(MAKE)
-distclean-local: clean-local
- rm -f Makefile config.cache config.status config.log
+# clean targets.
+
+CLEAN_SUBDIRS = $(ALL_SUBDIRS:%=%-clean)
-clean: clean-rec clean-local
+.PHONY: $(CLEAN_SUBDIRS)
-clean-rec:
- for dir in $(SUBDIRS); do cd $$dir; $(MAKE) clean; cd ..; done
+$(CLEAN_SUBDIRS):
+ @cd $(@:%-clean=%) && $(MAKE) clean
-clean-local:
+clean: $(CLEAN_SUBDIRS)
rm -f tags
-install:
- @cd ragel && $(MAKE) install && cd ../rlcodegen && $(MAKE) install
+# distcleaan targets
+
+DISTCLEAN_SUBDIRS = $(ALL_SUBDIRS:%=%-distclean)
+
+.PHONY: $(DISTCLEAN_SUBDIRS)
+
+$(DISTCLEAN_SUBDIRS):
+ @cd $(@:%-distclean=%) && $(MAKE) distclean
+
+distclean: $(DISTCLEAN_SUBDIRS)
+ rm -f Makefile config.cache config.status config.log
+
+#install targets
+
+INSTALL_SUBDIRS = $(BUILD_SUBDIRS:%=%-install)
+
+.PHONY: $(INSTALL_SUBDIRS)
+
+$(INSTALL_SUBDIRS):
+ @cd $(@:%-install=%) && $(MAKE) install
+
+install: $(INSTALL_SUBDIRS)
+