2 # Copyright (C) 1988, 1989, 1991, 1993 Bob Corbett and Free Software Foundation, Inc.
4 # This file is part of Bison, the GNU Compiler Compiler.
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)
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.
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.
20 #### Start of system configuration section. ####
27 INSTALL_PROGRAM = @INSTALL_PROGRAM@
28 INSTALL_DATA = @INSTALL_DATA@
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.
43 # Some System V machines do not come with libPW. If this is true, use
44 # the GNU alloca.o here.
48 exec_prefix = $(prefix)
50 # where the installed binary goes
51 bindir = $(exec_prefix)/bin
53 # where the parsers go
54 datadir = $(prefix)/lib
56 # where the info files go
57 infodir = $(prefix)/info
59 # where manual pages go and what their extensions should be
60 mandir = $(prefix)/man/man$(manext)
63 #### End of system configuration section. ####
67 # This rule allows us to supply the necessary -D options
68 # in addition to whatever the user asks for.
70 $(CC) -c $(DEFS) -I$(srcdir)/../include $(CPPFLAGS) $(CFLAGS) $<
72 # names of parser files
76 PFILES = -DXPFILE=\"$(datadir)/$(PFILE)\" \
77 -DXPFILE1=\"$(datadir)/$(PFILE1)\"
79 OBJECTS = LR0.o allocate.o closure.o conflicts.o derives.o files.o \
80 getargs.o gram.o lalr.o lex.o \
81 main.o nullable.o output.o print.o reader.o reduce.o symtab.o \
82 warshall.o version.o \
83 getopt.o getopt1.o $(ALLOCA)
85 all: bison bison.info bison.s1
87 Makefile: Makefile.in config.status
90 config.status: configure
91 $(srcdir)/configure --srcdir=$(srcdir) --no-create
93 configure: configure.in
94 cd $(srcdir); autoconf
96 # Copy bison.simple, inserting directory name into the #line commands.
97 bison.s1: bison.simple
99 sed -e "/^#line/ s|bison|$(datadir)/bison|" < $(srcdir)/$(PFILE) > bison.s1
102 rm -f *.o core bison bison.s1
107 rm -f Makefile config.status
112 # Most of these deps are in case using RCS.
113 install: all bison.1 $(srcdir)/$(PFILE) $(srcdir)/$(PFILE1) installdirs uninstall
114 $(INSTALL_PROGRAM) bison $(bindir)/bison
115 $(INSTALL_DATA) ./bison.s1 $(datadir)/$(PFILE)
116 $(INSTALL_DATA) $(srcdir)/$(PFILE1) $(datadir)/$(PFILE1)
117 -chmod a+r $(datadir)/$(PFILE) $(datadir)/$(PFILE1)
118 -$(INSTALL_DATA) $(srcdir)/bison.1 $(mandir)/bison.$(manext)
119 -chmod a+r $(mandir)/bison.$(manext)
120 cd $(srcdir); for f in bison.info*; \
121 do $(INSTALL_DATA) $$f $(infodir)/$$f; done
123 # Make sure all installation directories, e.g. $(bindir) actually exist by
124 # making them if necessary.
126 for file in $(bindir) $(datadir) $(libdir) $(infodir) $(mandir) ; do \
127 oIFS="$${IFS}"; IFS='/'; set - $${file}; IFS="$${oIFS}"; \
128 pathcomp=''; test ".$${1}" = "." && shift; \
129 while test $$# -ne 0 ; do \
130 pathcomp="$${pathcomp}/$${1}"; shift; \
131 if test ! -d "$${pathcomp}"; then \
132 echo "making directory $$pathcomp" 1>&2 ; \
133 mkdir "$${pathcomp}"; \
139 rm -f $(bindir)/bison
140 -cd $(datadir); rm -f $(PFILE) $(PFILE1)
141 rm -f $(mandir)/bison.$(manext) $(infodir)/bison.info*
144 $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
147 echo bison-`sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
150 ln COPYING ChangeLog Makefile.in configure configure.in \
151 REFERENCES bison.1 bison.rnh configure.bat \
152 bison.simple bison.hairy \
153 LR0.c allocate.c closure.c conflicts.c derives.c \
154 files.c getargs.c gram.c lalr.c lex.c main.c nullable.c \
155 output.c print.c reader.c reduce.c symtab.c version.c \
156 warshall.c files.h gram.h lex.h machine.h new.h state.h \
157 symtab.h system.h types.h bison.cld build.com vmsgetargs.c \
158 vmshlp.mar README INSTALL bison.texinfo bison.info* texinfo.tex \
160 cp -p getopt.[ch] getopt1.c alloca.c `cat .fname`
161 tar --gzip -chf `cat .fname`.tar.z `cat .fname`
162 -rm -rf `cat .fname` .fname
164 bison.info: bison.texinfo
165 $(MAKEINFO) $(srcdir)/bison.texinfo
170 # This file is different to pass the parser file names to the compiler.
172 $(CC) -c $(PFILES) $(DEFS) $(CPPFLAGS) $(CFLAGS) \
173 $(srcdir)/files.c $(OUTPUT_OPTION)
175 LR0.o: system.h machine.h new.h gram.h state.h
176 closure.o: system.h machine.h new.h gram.h
177 conflicts.o: system.h machine.h new.h files.h gram.h state.h
178 derives.o: system.h new.h types.h gram.h
179 files.o: system.h files.h new.h gram.h
180 getargs.o: system.h files.h
181 lalr.o: system.h machine.h types.h state.h new.h gram.h
182 lex.o: system.h files.h symtab.h lex.h
183 main.o: system.h machine.h
184 nullable.o: system.h types.h gram.h new.h
185 output.o: system.h machine.h new.h files.h gram.h state.h
186 print.o: system.h machine.h new.h files.h gram.h state.h
187 reader.o: system.h files.h new.h symtab.h lex.h gram.h
188 reduce.o: system.h machine.h files.h new.h gram.h
189 symtab.o: system.h new.h symtab.h gram.h
190 warshall.o: system.h machine.h
192 # Prevent GNU make v3 from overflowing arg limit on SysV.