1 | ## do not change this value |
---|
2 | subdir=. |
---|
3 | |
---|
4 | ## get standard variables from autoconf - autoconf will replace |
---|
5 | ## this variable with content of "scripts/config.vars". |
---|
6 | @stdvars@ |
---|
7 | |
---|
8 | ## By default, make will jump into any sub directory containing |
---|
9 | ## a file named "Makefile". This is done in the order implied by |
---|
10 | ## /bin/ls. You can override this by using variable SUBDIRS. For |
---|
11 | ## example, if not set, then make behaves as if |
---|
12 | ## SUBDIRS = antlr doc examples lib |
---|
13 | ## has been set. |
---|
14 | |
---|
15 | SUBDIRS = antlr lib doc |
---|
16 | |
---|
17 | ## When using stdmake before any other rule, then the default |
---|
18 | ## rule is "all" and behaviour of make is first to make all |
---|
19 | ## subdirectories and then all "local" targets with name all, |
---|
20 | ## clean, install, test etc. |
---|
21 | ## Sometimes it's usefull to make the local target first and then |
---|
22 | ## subdirs. To enforce this, just listen target in question be- |
---|
23 | ## fore "stdmake". By doing so, your target will become the |
---|
24 | ## default. This is usually not what you want. Therefore introduce |
---|
25 | ## a pseude rule (like this) to tell make about the default target. |
---|
26 | this : all |
---|
27 | |
---|
28 | |
---|
29 | ## get standard make rules from autoconf |
---|
30 | @stdmake@ |
---|
31 | |
---|
32 | test clean distclean install :: |
---|
33 | @ if test -f examples/Makefile ; then \ |
---|
34 | @MAKE@ -C examples $@ ; \ |
---|
35 | fi |
---|
36 | |
---|
37 | # Rule to remove all objects, cores, ANTLR generated, |
---|
38 | # configure generated, etc. This is not a recursive rule |
---|
39 | # because distclean removes files unconditionally |
---|
40 | # included by subdirectory Makefiles. |
---|
41 | # |
---|
42 | maintainer-clean: distclean |
---|
43 | -@RMF@ -f configure |
---|
44 | |
---|
45 | # |
---|
46 | # Rule to make a tarball exclusive all kinds of fluff |
---|
47 | # |
---|
48 | |
---|
49 | TIMESTAMP = $(shell date +%Y%m%d) |
---|
50 | TAR_DIR = $(versioneddir) |
---|
51 | TAR_FILE = $(versioneddir).tar |
---|
52 | |
---|
53 | _tar: |
---|
54 | -@RMF@ $(TAR_DIR) |
---|
55 | ln -s $(srcdir) $(TAR_DIR) |
---|
56 | $(TAR) cfh $(TAR_FILE) \ |
---|
57 | --exclude CVS \ |
---|
58 | --exclude *.pyc \ |
---|
59 | --exclude *.o \ |
---|
60 | --exclude *.d \ |
---|
61 | --exclude *.lo \ |
---|
62 | --exclude *.a \ |
---|
63 | --exclude *.la \ |
---|
64 | --exclude *.lai \ |
---|
65 | --exclude *.so \ |
---|
66 | --exclude *.class \ |
---|
67 | --exclude .deps \ |
---|
68 | --exclude .depend \ |
---|
69 | --exclude config.cache \ |
---|
70 | --exclude config.status \ |
---|
71 | --exclude Config.make \ |
---|
72 | --exclude antlr-config \ |
---|
73 | --exclude run-antlr \ |
---|
74 | --exclude *~ \ |
---|
75 | --exclude core \ |
---|
76 | --exclude dmalloc.log \ |
---|
77 | --exclude .gdb_history \ |
---|
78 | --exclude ".nfs*" \ |
---|
79 | --exclude "$(TAR_DIR)/gen_doc/html" \ |
---|
80 | --exclude "$(TAR_DIR)/gen_doc/html/*" \ |
---|
81 | --exclude Makefile \ |
---|
82 | $(TAR_DIR) |
---|
83 | @CHMOD@ 660 $(TAR_FILE) |
---|
84 | @RMF@ $(TAR_DIR) |
---|
85 | |
---|
86 | tar backup : _tar |
---|
87 | gzip -f --best $(TAR_FILE) |
---|
88 | |
---|
89 | ## When building a release, it's crucial that time stamps are up-to-date and that |
---|
90 | ## files have proper permission bit set. Since $(srcdir) might be under the |
---|
91 | ## control of Perforce (or an other versioning system), I'm going to unpack the |
---|
92 | ## tar file again in a local directory and update time stamps as well as |
---|
93 | ## permission. |
---|
94 | release : @ANTLR_JAR@ _tar |
---|
95 | @TAR@ xpf $(TAR_FILE) |
---|
96 | @CP@ @ANTLR_JAR@ $(TAR_DIR) |
---|
97 | find $(TAR_DIR) -type f | xargs @CHMOD@ 644 |
---|
98 | find $(TAR_DIR) -type d | xargs @CHMOD@ 755 |
---|
99 | @CHMOD@ 777 $(TAR_DIR)/configure |
---|
100 | find $(TAR_DIR) | xargs @TOUCH@ |
---|
101 | find $(TAR_DIR)/antlr -name \*.java | xargs @TOUCH@ |
---|
102 | @TAR@ cf $(TAR_FILE) $(TAR_DIR) |
---|
103 | gzip -f --best $(TAR_FILE) |
---|
104 | gzip -t -v $(TAR_FILE).gz |
---|
105 | @RMF@ $(TAR_DIR) |
---|
106 | |
---|
107 | ## This one for RK: |
---|
108 | new_version antlr/Version.java: |
---|
109 | @@ECHO@ "Rebuilding Version.java" |
---|
110 | @@ECHO@ "package antlr;" > antlr/Version.java |
---|
111 | @@ECHO@ "public class Version {" >> antlr/Version.java |
---|
112 | @@ECHO@ " public static final String version = \"$(VERSION)\";" >> antlr/Version.java |
---|
113 | @@ECHO@ " public static final String subversion = \"$(SUBVERSION)\";" >> antlr/Version.java |
---|
114 | @@ECHO@ " public static final String patchlevel = \"$(PATCHLEVEL)\";" >> antlr/Version.java |
---|
115 | @@ECHO@ " public static final String datestamp = \"$(TIMESTAMP)\";" >> antlr/Version.java |
---|
116 | @@ECHO@ " public static final String project_version = \"$(VERSION).$(SUBVERSION).$(PATCHLEVEL) ($(TIMESTAMP))\";" >> antlr/Version.java |
---|
117 | @@ECHO@ "}" >> antlr/Version.java |
---|
118 | |
---|
119 | ## Installation is delegated to sub directories - as configured. |
---|
120 | ## Here we just create a bin directory that should contain |
---|
121 | ## scripts to mess up with ANTLR. Other things to do? |
---|
122 | |
---|
123 | docdir = $(datadir)/doc/$(versioneddir) |
---|
124 | extradir = $(datadir)/$(versioneddir) |
---|
125 | |
---|
126 | install :: |
---|
127 | $(MKDIR) -p "$(bindir)" |
---|
128 | $(MKDIR) -p "$(extradir)" |
---|
129 | $(MKDIR) -p "$(docdir)" |
---|
130 | $(INSTALL) -m 755 scripts/run-antlr "$(bindir)/antlr" |
---|
131 | $(INSTALL) -m 755 scripts/antlr-config "$(bindir)/antlr-config" |
---|
132 | $(INSTALL) -m 444 @abs_top_srcdir@/extras/antlr-mode.el "$(extradir)" |
---|
133 | $(INSTALL) -m 444 @abs_top_srcdir@/extras/antlr-jedit.xml "$(extradir)" |
---|
134 | $(INSTALL) -m 444 @abs_top_srcdir@/LICENSE.txt "$(docdir)" |
---|
135 | $(INSTALL) -m 444 @abs_top_srcdir@/README.txt "$(docdir)" |
---|
136 | $(INSTALL) -m 444 @abs_top_srcdir@/INSTALL.txt "$(docdir)" |
---|
137 | |
---|
138 | install :: |
---|
139 | @ECHO@ "installation done" |
---|
140 | |
---|
141 | # Make sure that all generated files are removed |
---|
142 | distclean_obj = \ |
---|
143 | config.* \ |
---|
144 | Makefile \ |
---|
145 | scripts/antlr-config \ |
---|
146 | scripts/antlr.sh \ |
---|
147 | scripts/antlr.spec \ |
---|
148 | scripts/config.deps \ |
---|
149 | scripts/config.make \ |
---|
150 | scripts/config.vars \ |
---|
151 | scripts/cpp.sh \ |
---|
152 | scripts/csc.sh \ |
---|
153 | scripts/c.sh \ |
---|
154 | scripts/cxx.sh \ |
---|
155 | scripts/jar.sh \ |
---|
156 | scripts/javac.sh \ |
---|
157 | scripts/java.sh \ |
---|
158 | scripts/lib.sh \ |
---|
159 | scripts/link.sh \ |
---|
160 | scripts/pyantlr.sh \ |
---|
161 | scripts/python.sh \ |
---|
162 | scripts/run-antlr \ |
---|
163 | $(eof) |
---|
164 | |
---|
165 | distclean :: clean |
---|
166 | @RMF@ $(distclean_obj) |
---|
167 | Q=`find . -name Makefile` && test -n "$$Q" && @RMF@ $${Q} |
---|
168 | |
---|
169 | ### phony targets - make this targets even if file with same name exists. |
---|
170 | .PHONY: bootstrap backup maintainer-clean |
---|
171 | ##xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
---|
172 | @stddeps@ |
---|
173 | ##xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
---|