]>
Commit | Line | Data |
---|---|---|
5ec13303 | 1 | # Makefile for bison |
516ef771 | 2 | # Copyright (C) 1988, 1989, 1991, 1993 Bob Corbett and Free Software Foundation, Inc. |
5ec13303 RS |
3 | # |
4 | # This file is part of Bison, the GNU Compiler Compiler. | |
5 | # | |
6 | # Bison is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; either version 2, or (at your option) | |
9 | # any later version. | |
10 | # | |
11 | # Bison is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with Bison; see the file COPYING. If not, write to | |
18 | # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | ||
20 | #### Start of system configuration section. #### | |
21 | ||
22 | srcdir = @srcdir@ | |
23 | VPATH = @srcdir@ | |
24 | ||
25 | CC = @CC@ | |
26 | INSTALL = @INSTALL@ | |
27 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
28 | INSTALL_DATA = @INSTALL_DATA@ | |
29 | MAKEINFO = makeinfo | |
30 | ||
31 | # Things you might add to DEFS: | |
32 | # -DSTDC_HEADERS If you have ANSI C headers and libraries. | |
33 | # -DHAVE_STRING_H If you don't have ANSI C headers but have string.h. | |
34 | # -DHAVE_MEMORY_H If you don't have ANSI C headers and have memory.h. | |
35 | # -DHAVE_STRERROR If you have strerror function. | |
36 | DEFS = @DEFS@ | |
37 | ||
ac89deb7 RS |
38 | CFLAGS = @CFLAGS@ |
39 | LDFLAGS = @LDFLAGS@ | |
5ec13303 RS |
40 | |
41 | LIBS = @LIBS@ | |
42 | ||
43 | # Some System V machines do not come with libPW. If this is true, use | |
44 | # the GNU alloca.o here. | |
45 | ALLOCA = @ALLOCA@ | |
46 | ||
f590489e | 47 | prefix = @prefix@ |
2bb7b13a | 48 | exec_prefix = @exec_prefix@ |
5ec13303 RS |
49 | |
50 | # where the installed binary goes | |
51 | bindir = $(exec_prefix)/bin | |
52 | ||
53 | # where the parsers go | |
22a1e99f | 54 | datadir = $(prefix)/share |
5ec13303 RS |
55 | |
56 | # where the info files go | |
57 | infodir = $(prefix)/info | |
58 | ||
59 | # where manual pages go and what their extensions should be | |
60 | mandir = $(prefix)/man/man$(manext) | |
61 | manext = 1 | |
62 | ||
1099cdc0 RS |
63 | # hope this works on non-gnu makes. |
64 | bison_version = `sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` | |
65 | ||
5ec13303 RS |
66 | #### End of system configuration section. #### |
67 | ||
a83994ff NF |
68 | DISTFILES = COPYING ChangeLog Makefile.in configure configure.in \ |
69 | REFERENCES bison.1 bison.rnh configure.bat \ | |
70 | bison.simple bison.hairy \ | |
71 | LR0.c allocate.c closure.c conflicts.c derives.c \ | |
72 | files.c getargs.c gram.c lalr.c lex.c main.c nullable.c \ | |
73 | output.c print.c reader.c reduce.c symtab.c version.c \ | |
7612000c | 74 | warshall.c files.h gram.h lex.h machine.h alloc.h state.h \ |
a83994ff | 75 | symtab.h system.h types.h bison.cld build.com vmsgetargs.c \ |
318476e1 | 76 | vmshlp.mar README INSTALL NEWS bison.texinfo bison.info* texinfo.tex \ |
ef3536eb | 77 | getopt.c getopt.h getopt1.c alloca.c mkinstalldirs install-sh |
a83994ff NF |
78 | |
79 | ||
5ec13303 RS |
80 | SHELL = /bin/sh |
81 | ||
82 | # This rule allows us to supply the necessary -D options | |
83 | # in addition to whatever the user asks for. | |
84 | .c.o: | |
85 | $(CC) -c $(DEFS) -I$(srcdir)/../include $(CPPFLAGS) $(CFLAGS) $< | |
86 | ||
87 | # names of parser files | |
88 | PFILE = bison.simple | |
89 | PFILE1 = bison.hairy | |
90 | ||
91 | PFILES = -DXPFILE=\"$(datadir)/$(PFILE)\" \ | |
92 | -DXPFILE1=\"$(datadir)/$(PFILE1)\" | |
93 | ||
94 | OBJECTS = LR0.o allocate.o closure.o conflicts.o derives.o files.o \ | |
95 | getargs.o gram.o lalr.o lex.o \ | |
96 | main.o nullable.o output.o print.o reader.o reduce.o symtab.o \ | |
97 | warshall.o version.o \ | |
98 | getopt.o getopt1.o $(ALLOCA) | |
99 | ||
100 | all: bison bison.info bison.s1 | |
101 | ||
ac89deb7 RS |
102 | Makefile: config.status Makefile.in |
103 | CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status | |
9df81dd3 NF |
104 | |
105 | config.status: configure | |
511f8050 | 106 | ./config.status --recheck |
9df81dd3 NF |
107 | |
108 | configure: configure.in | |
ac89deb7 | 109 | cd $(srcdir) && autoconf |
9df81dd3 | 110 | |
5ec13303 RS |
111 | # Copy bison.simple, inserting directory name into the #line commands. |
112 | bison.s1: bison.simple | |
4951b477 | 113 | -rm -f bison.s1 |
1099cdc0 | 114 | sed -e "/^#line/ s|bison|$(datadir)/bison|" -e "s/@bison_version@/$(bison_version)/" < $(srcdir)/$(PFILE) > $@-tmp |
ac89deb7 | 115 | mv $@-tmp $@ |
5ec13303 RS |
116 | |
117 | clean: | |
ac89deb7 | 118 | rm -f *.o core bison bison.s1 config.status config.log |
5ec13303 RS |
119 | |
120 | mostlyclean: clean | |
121 | ||
122 | distclean: clean | |
ac89deb7 | 123 | rm -f Makefile |
5ec13303 RS |
124 | |
125 | realclean: distclean | |
126 | rm -f TAGS *.info* | |
127 | ||
128 | # Most of these deps are in case using RCS. | |
6d215e11 | 129 | install: all bison.1 $(srcdir)/$(PFILE) $(srcdir)/$(PFILE1) installdirs uninstall |
5ec13303 | 130 | $(INSTALL_PROGRAM) bison $(bindir)/bison |
02826fb8 | 131 | $(INSTALL_DATA) bison.s1 $(datadir)/$(PFILE) |
5ec13303 | 132 | $(INSTALL_DATA) $(srcdir)/$(PFILE1) $(datadir)/$(PFILE1) |
5ec13303 RS |
133 | cd $(srcdir); for f in bison.info*; \ |
134 | do $(INSTALL_DATA) $$f $(infodir)/$$f; done | |
02826fb8 | 135 | -$(INSTALL_DATA) $(srcdir)/bison.1 $(mandir)/bison.$(manext) |
5ec13303 | 136 | |
5fc7e107 NF |
137 | # Make sure all installation directories, e.g. $(bindir) actually exist by |
138 | # making them if necessary. | |
139 | installdirs: | |
965f6134 | 140 | -sh $(srcdir)/mkinstalldirs $(bindir) $(datadir) $(libdir) $(infodir) $(mandir) |
5fc7e107 | 141 | |
5ec13303 RS |
142 | uninstall: |
143 | rm -f $(bindir)/bison | |
144 | -cd $(datadir); rm -f $(PFILE) $(PFILE1) | |
145 | rm -f $(mandir)/bison.$(manext) $(infodir)/bison.info* | |
146 | ||
d47a732a NF |
147 | check: |
148 | @echo "No checks implemented (yet)." | |
149 | ||
5ec13303 | 150 | bison: $(OBJECTS) |
57df1c86 | 151 | $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJECTS) $(LIBS) |
5ec13303 | 152 | |
687621a5 RS |
153 | # We don't use $(srcdir) in this rule |
154 | # because it is normally used in the master source dir | |
155 | # in which configure has not been run. | |
5ec13303 | 156 | dist: bison.info |
1099cdc0 | 157 | echo bison-$(bison_version) > .fname |
5ec13303 RS |
158 | -rm -rf `cat .fname` |
159 | mkdir `cat .fname` | |
a83994ff | 160 | dst=`cat .fname`; for f in $(DISTFILES); do \ |
01aed9a7 RS |
161 | if test -L $$f; then \ |
162 | cp $$f $$dst/$$f; chmod a-w $$dst/$$f; \ | |
163 | else \ | |
164 | ln $$f $$dst/$$f; \ | |
165 | fi \ | |
a83994ff | 166 | done |
ef650659 | 167 | tar --gzip -chf `cat .fname`.tar.gz `cat .fname` |
5ec13303 RS |
168 | -rm -rf `cat .fname` .fname |
169 | ||
170 | bison.info: bison.texinfo | |
171 | $(MAKEINFO) $(srcdir)/bison.texinfo | |
172 | ||
173 | TAGS: *.c *.h | |
174 | etags *.c *.h | |
175 | ||
176 | # This file is different to pass the parser file names to the compiler. | |
177 | files.o: files.c | |
178 | $(CC) -c $(PFILES) $(DEFS) $(CPPFLAGS) $(CFLAGS) \ | |
179 | $(srcdir)/files.c $(OUTPUT_OPTION) | |
180 | ||
7612000c | 181 | LR0.o: system.h machine.h alloc.h gram.h state.h |
55bcd09a | 182 | allocate.o: system.h |
7612000c RS |
183 | closure.o: system.h machine.h alloc.h gram.h |
184 | conflicts.o: system.h machine.h alloc.h files.h gram.h state.h | |
185 | derives.o: system.h alloc.h types.h gram.h | |
186 | files.o: system.h files.h alloc.h gram.h | |
5ec13303 | 187 | getargs.o: system.h files.h |
7612000c | 188 | lalr.o: system.h machine.h types.h state.h alloc.h gram.h |
5ec13303 RS |
189 | lex.o: system.h files.h symtab.h lex.h |
190 | main.o: system.h machine.h | |
7612000c RS |
191 | nullable.o: system.h types.h gram.h alloc.h |
192 | output.o: system.h machine.h alloc.h files.h gram.h state.h | |
193 | print.o: system.h machine.h alloc.h files.h gram.h state.h | |
194 | reader.o: system.h files.h alloc.h symtab.h lex.h gram.h | |
195 | reduce.o: system.h machine.h files.h alloc.h gram.h | |
196 | symtab.o: system.h alloc.h symtab.h gram.h | |
5ec13303 RS |
197 | warshall.o: system.h machine.h |
198 | ||
199 | # Prevent GNU make v3 from overflowing arg limit on SysV. | |
200 | .NOEXPORT: |