## This file is part of ANTLR (http://www.antlr.org). Have a ## look into LICENSE.txt for license details. This file has ## been written by (C) Wolfgang Haefelinger, 2004. ## do not change this value subdir=examples/csharp/preserveWhiteSpace ## get configured (standard) variables - checkout or modify ## scripts/config.vars[.in] for details. ## --*- Makefile -*-- SUBDIRS := ## helper utilities .. INSTALL = /usr/bin/install -c MKDIR = /bin/mkdir RM = /bin/rm -r -f RMF = /bin/rm -r -f TAR = /bin/tar TOUCH = /bin/touch CHMOD = /bin/chmod SED = /bin/sed GREP = /bin/grep CAT = /bin/cat CHMOD = /bin/chmod CP = /bin/cp ECHO = /bin/echo # usual dribble exec_prefix = ${prefix} prefix = /usr/local program_transform_name = s,x,x, bindir = ${exec_prefix}/bin sbindir = ${exec_prefix}/sbin libexecdir = ${exec_prefix}/libexec datadir = ${prefix}/share sysconfdir = ${prefix}/etc sharedstatedir = ${prefix}/com localstatedir = ${prefix}/var libdir = ${exec_prefix}/lib includedir = ${prefix}/include oldincludedir = /usr/include infodir = ${prefix}/info mandir = ${prefix}/man build_alias = host_alias = target_alias = build = x86_64-unknown-linux-gnu build_cpu = x86_64 build_vendor = unknown build_os = linux-gnu host = x86_64-unknown-linux-gnu host_cpu = x86_64 host_vendor = unknown host_os = linux-gnu just_make = /usr/bin/make # Version stuff... VERSION = 2 SUBVERSION = 7 PATCHLEVEL = 7 PACKAGE_NAME = antlr PACKAGE_VERSION = 2.7.7 versioneddir = antlr-2.7.7 # navigation builddir = /usr/neuro/local/yao/yao9/share/antlr-2.7.7 buildtree = /usr/neuro/local/yao/yao9/share/antlr-2.7.7 sourcetree = /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/.. ## Two abbrevs to shorten things. $(thisdir) shall be the current ## working directory as absolute name and $(_srcdir) is it's ## source dir companion. That means that $(thisdir)/Makefile has ## been generated by $(_srcdir)/Makefile.in. _srcdir = /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../$(subdir) thisdir = /usr/neuro/local/yao/yao9/share/antlr-2.7.7/$(subdir) # variable 'srcdir' is deprecated - use sourcetree srcdir = /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/.. # variable 'objdir' is deprecated - use buildtree objdir = /usr/neuro/local/yao/yao9/share/antlr-2.7.7 # other verbose = 0 ## SUBDIRS you want to exclude (separate them by using "|"). SUBDIRS_NOT := . CLR = /usr/bin/mono ANTLR_JAR = /usr/neuro/local/yao/yao9/share/antlr-2.7.7/antlr/antlr.jar ANTLR_LIB = /usr/neuro/local/yao/yao9/share/antlr-2.7.7/lib/cpp/src/libantlr.a ANTLR_NET = /usr/neuro/local/yao/yao9/share/antlr-2.7.7/lib/antlr.runtime.dll ANTLR_PY = /usr/neuro/local/yao/yao9/share/antlr-2.7.7/lib/python/antlr/python.py ASTFRAME_NET = /usr/neuro/local/yao/yao9/share/antlr-2.7.7/lib/antlr.astframe.dll antlr_jar = antlr.jar antlr_lib = libantlr.a antlr_net = antlr.runtime.dll antlr_py = python.py astframe_net = antlr.astframe.dll ### how to get rid of damned dos line ending style and -- al- ### most equally worse -- stupid tab character. ### dos2unix = perl -p -i.tmp -e 's,\r,,g;s,\t, ,g' dos2unix = : ## get configured rules ##xxxxxxxxxxxxxxxxxxxxxx --*- Makefile -*-- xxxxxxxxxxxxxxxx>>> config.make ## By default, make will jump into any sub directory that contains a file ## named "Makefile". This is done in the order implied by "/bin/ls" which ## is in almost all cases correct (note that you should not design ## Makefiles which depend on a specific invocation order). You can override ## specific behaviour by using variable SUBDIRS. If given and not empty, ## "/bin/ls" is not used. Also, if you want to disable jumping subdirs you ## may use either ".", ".." as value for SUBDIRS. Note that SUBDIRS may ## contain any directory (except "." and "..). ## This is very much GNU specific, sigh. Variable SUBDIRS is used to tell ## make which subdirectory to jump. It's value is normally preset or just ## empty, in which case /bin/ls is used as discussed above. However, I also ## want that a user can say ## ## make SUBDIRS="d1 d2 .. dn" ## ## That means, ignore defaults and go ahead and make exactly this director- ## ies mentioned. Of course, this should only have an impact on Makefile ## being used by "make" but not for any makefils in d1 .. dn, right? For ## example, if di needs to make directories a,b and c, then they need to ## be made of course. So all burns down to the question how to prevent a ## variable from being passed to submakes. Below you can see the answer. If ## you believe that there's a simpler answer to the problem don't hesistate ## to try it out. If it works, send me an email: ora dot et dot labora at ## web dot de. But be warned - you need to try all variations. ## ## Here is in short what I found and how it works. Variables given on ## command line are saved in variable MAKEOVERRIDES. This variable is ## exported and passed down. On invocation of a submake file, make will ## have a look into MAKEOVERRIDES and unpack each variable found therein. ## Therefore I'm just going to remove every (?) occurance of SUBDIRS from ## this variable. MAKEOVERRIDES := $(patsubst SUBDIRS=%,,$(MAKEOVERRIDES)) ## The actuall rule on how to make a recursive target. all clean distclean test install force-target clean-target :: @dirs="$(SUBDIRS)" ; \ test -z "$${dirs}" && { \ dirs=`/bin/ls` ; \ } ; \ for d in . $${dirs} ; do \ case $${d} in \ . | .. ) ;; \ $(SUBDIRS_NOT) ) ;; \ *) \ if test -f "$${d}/Makefile" ; then \ echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" ; \ echo ">> /usr/bin/make -C $(subdir)/$${d} $@ " ; \ echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" ; \ /usr/bin/make -C "$$d" $@ || exit 1 ;\ fi ; \ ;; \ esac ; \ done ## For historical reasons only you can make local targets as "this-*" or ## "*-this" rules. The default is to do nothing. Although this targets ## exists, it is recommended to define further "all", "clean" etc. double ## colon rules. all :: this-all all-this clean :: this-clean clean-this distclean :: this-distclean distclean-this test :: this-test test-this install :: this-install install-this this-all :: this-clean :: this-distclean :: this-test :: this-install :: all-this :: clean-this :: distclean-this :: test-this :: install-this :: force-target :: clean-target all distclean :: clean distclean :: $(RM) Makefile ## xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<< config.make ## By default we compile class files so we are ready to carry ## out a test. Note that deps have been setup in such a way ## that you can do a 'make compile' whithout having made ## antlr.jar before. this : compile all :: compile compile : $(test1_exe) test :: bad : test1 ## My *.g files g_FILES = \ $(_srcdir)/instr.g \ $(eol) ## Java files generated by *.g g_src_FILES = \ $(thisdir)/InstrLexer.java \ $(thisdir)/InstrParser.java \ $(thisdir)/InstrParserTokenTypes.java \ $(thisdir)/InstrTreeWalker.java \ $(eol) ## Text files generated by *.g g_txt_FILES = \ $(thisdir)/DataParserTokenTypes.txt \ $(eol) ## All generated files by *.g g_gen_FILES = \ $(g_src_FILES) \ $(g_txt_FILES) \ $(eol) ## Dependencies of g_src_FILES g_src_DEPS = \ $(g_FILES) \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/antlr/antlr.jar \ $(buildtree)/scripts/antlr.sh \ $(eol) # All source files for test1 test1_exe_FILES = \ $(g_src_FILES) \ $(_srcdir)/InstrMain.cs \ $(eol) test1_exe = \ test1.exe \ $(eol) test1_exe_DEPS = \ $(test1_exe_FILES) \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/lib/antlr.runtime.dll \ $(buildtree)/scripts/csc.sh \ $(eol) ## Dependencies of test 1 test1_DEPS = \ antlr.runtime.dll \ test1.exe \ $(eol) ## Test 1 test1_CMD = \ @ $(CLR) ./test1.exe < $(_srcdir)/test.in \ $(eol) ## we need a local copy of ANTLR_NET in this directory to be ## able to execute tests! antlr.runtime.dll : /usr/neuro/local/yao/yao9/share/antlr-2.7.7/lib/antlr.runtime.dll /bin/cp $< $@ %.txt : $(_srcdir)/%.txt @ /bin/cp $< $@ ## *.g -> *.cs $(g_src_FILES) : $(g_src_DEPS) @ /bin/rm -r -f $(g_src_FILES) @ /bin/sh /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/antlr.sh $(g_FILES) @ $(dos2unix) $(g_src_FILES) ## How to create test1 $(test1_exe) : $(test1_exe_DEPS) @ -/bin/rm -r -f $@ @/bin/sh /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/csc.sh $@ $(test1_exe_FILES) ## Tests test1 : $(test1_DEPS) @ $(test1_CMD) ### cleanup astsupport clean :: @/bin/echo cleaning $(subdir) ... @ -/bin/rm -r -f .compile.st *.class $(g_gen_FILES) antlr.runtime.dll @ -/bin/rm -r -f *.pyc *.tmp *TokenTypes.txt *TokenTypes *.exe ### get configured dependencies - for example, just list ### autoconf variable ANTLR_JAR as reference and it will ### be done automatically as stddeps contains appropr. ### rule. For details, checkout scripts/config.vars[.in] ## --*- Makefile -*-- ## Make listed targets even in case a file with same name exists. .PHONY: \ this \ all clean install test distclean \ this-all this-clean this-install this-test this-distclean \ all-this clean-this install-this test-this distclean-this \ $(eof) ## delete suffix rules - shortens output when using -d and is not ## used anyway (and should not be used). .SUFFIXES: Makefile :: /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../$(subdir)/Makefile.in \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/config.deps \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/config.make \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/config.vars \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/config.status @echo "*** update $(subdir)/Makefile" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES="$(subdir)/Makefile" /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/config.deps : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/config.deps.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/config.deps /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/config.make : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/config.make.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/config.make /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/config.vars : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/config.vars.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/config.vars /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/config.status : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../configure @echo "*** reconfigure $@ - stay tuned .." @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && /bin/sh ./config.status -q --recheck @echo "*** update all configured files .." @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && /bin/sh ./config.status -q ### In a pure devel mode there should be also a dependency listed on how ### to make configure out of configure.in. This requires that usr has ### m4 and autoconf (proper version) installed. Appropriate checks are ### not done in configure. If so, then uncomment next lines: ### ### @rule_configure_configure_in@ ### /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/antlr.sh : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/antlr.sh.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/antlr.sh /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/cpp.sh : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/cpp.sh.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/cpp.sh /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/csc.sh : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/csc.sh.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/csc.sh /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/cxx.sh : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/cxx.sh.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/cxx.sh /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/jar.sh : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/jar.sh.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/jar.sh /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/javac.sh : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/javac.sh.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/javac.sh /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/java.sh : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/java.sh.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/java.sh /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/lib.sh : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/lib.sh.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/lib.sh /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/link.sh : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/link.sh.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/link.sh /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/pyinst.sh : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/pyinst.sh.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/pyinst.sh /bin/sh ./config.status -q /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/python.sh : \ /usr/neuro/local/yao/yao9/share/antlr-2.7.7/scripts/../scripts/python.sh.in @echo "*** update $@" @cd /usr/neuro/local/yao/yao9/share/antlr-2.7.7 && CONFIG_FILES=scripts/python.sh /bin/sh ./config.status -q ## This rule shall ensure that ANTLR_NET is up-to-date. The rule is a ## double colon rule, ie. further rules with the same target may be ## added. For unknown reasons, double colon rules are always phony,ie. ## getting executed even in case target exists. We break the infinite ## loop, we only jump into subdir "lib/csharp/src" if we are not ## already in. It is very important that each Makefile[.in] sets the ## variable $(subdir) proper. /usr/neuro/local/yao/yao9/share/antlr-2.7.7/lib/antlr.runtime.dll :: @ subdir="lib/csharp/antlr.runtime" ; \ case $(subdir) in \ $$subdir ) ;; \ * ) d="/usr/neuro/local/yao/yao9/share/antlr-2.7.7/$$subdir" ; \ test -f "$$d/Makefile" && { \ /usr/bin/make -C "$$d" $@ ; \ } \ ;; \ esac /usr/neuro/local/yao/yao9/share/antlr-2.7.7/lib/antlr.astframe.dll :: @ subdir="lib/csharp/antlr.astframe" ; \ case $(subdir) in \ $$subdir ) ;; \ * ) d="/usr/neuro/local/yao/yao9/share/antlr-2.7.7/$$subdir" ; \ test -f "$$d/Makefile" && { \ /usr/bin/make -C "$$d" $@ ; \ } \ ;; \ esac /usr/neuro/local/yao/yao9/share/antlr-2.7.7/antlr/antlr.jar :: @ subdir="antlr" ; \ case $(subdir) in \ $$subdir ) ;; \ * ) d="/usr/neuro/local/yao/yao9/share/antlr-2.7.7/$$subdir" ; \ test -f "$$d/Makefile" && { \ /usr/bin/make -C "$$d" $@ ; \ } \ ;; \ esac /usr/neuro/local/yao/yao9/share/antlr-2.7.7/lib/cpp/src/libantlr.a :: @ subdir="lib/cpp/src" ; \ case $(subdir) in \ $$subdir ) ;; \ * ) d="/usr/neuro/local/yao/yao9/share/antlr-2.7.7/$$subdir" ; \ test -f "$$d/Makefile" && { \ /usr/bin/make -C "$$d" $@ ; \ } \ ;; \ esac .PHONY: compile .PHONY: test1 .PHONY: test2