Formerly default.c.~24~
[make.git] / compatMakefile
blob34a9cf5ce84c346d94672d107439dd50e13a7117
1 # Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
2 # This file is part of GNU Make.
3
4 # GNU Make is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # GNU Make is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Make; see the file COPYING.  If not, write to
16 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 #       Makefile for GNU Make
22 # Ultrix 2.2 make doesn't expand the value of VPATH.
23 VPATH = @srcdir@
24 srcdir = $(VPATH)
26 CC = @CC@
28 CFLAGS = @CFLAGS@
29 LDFLAGS = @LDFLAGS@
31 # Define these for your system as follows:
32 #       -DNO_ARCHIVES           To disable `ar' archive support.
33 #       -DNO_FLOAT              To avoid using floating-point numbers.
34 #       -DENUM_BITFIELDS        If the compiler isn't GCC but groks enum foo:2.
35 #                               Some compilers apparently accept this
36 #                               without complaint but produce losing code,
37 #                               so beware.
38 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
39 defines = @DEFS@ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
41 # Which flavor of remote job execution support to use.
42 # The code is found in `remote-$(REMOTE).c'.
43 REMOTE = @REMOTE@
45 # If you are using the GNU C library, or have the GNU getopt functions in
46 # your C library, you can comment these out.
47 GETOPT = getopt.o getopt1.o
48 GETOPT_SRC = $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h
50 # If you are using the GNU C library, or have the GNU glob functions in
51 # your C library, you can comment this out.  GNU make uses special hooks
52 # into the glob functions to be more efficient (by using make's directory
53 # cache for globbing), so you must use the GNU functions even if your
54 # system's C library has the 1003.2 glob functions already.  Also, the glob
55 # functions in the AIX and HPUX C libraries are said to be buggy.
56 GLOB = glob/libglob.a
58 # If your system doesn't have alloca, or the one provided is bad, define this.
59 ALLOCA = @ALLOCA@
60 ALLOCA_SRC = $(srcdir)/alloca.c
62 # If your system needs extra libraries loaded in, define them here.
63 # System V probably need -lPW for alloca.  HP-UX 7.0's alloca in
64 # libPW.a is broken on HP9000s300 and HP9000s400 machines.  Use
65 # alloca.c instead on those machines.
66 LOADLIBES = @LIBS@
68 # Any extra object files your system needs.
69 extras = @LIBOBJS@
71 # Common prefix for machine-independent installed files.
72 prefix = /usr/local
73 # Common prefix for machine-dependent installed files.
74 exec_prefix = $(prefix)
76 # Name under which to install GNU make.
77 instname = make
78 # Directory to install `make' in.
79 bindir = $(exec_prefix)/bin
80 # Directory to find libraries in for `-lXXX'.
81 libdir = $(exec_prefix)/lib
82 # Directory to search by default for included makefiles.
83 includedir = $(prefix)/include
84 # Directory to install the Info files in.
85 infodir = $(prefix)/info
86 # Directory to install the man page in.
87 mandir = $(prefix)/man/man$(manext)
88 # Number to put on the man page filename.
89 manext = 1
91 # Whether or not make needs to be installed setgid.
92 # The value should be either `true' or `false'.
93 # On many systems, the getloadavg function (used to implement the `-l'
94 # switch) will not work unless make is installed setgid kmem.
95 install_setgid = @NEED_SETGID@
96 # Install make setgid to this group so it can read /dev/kmem.
97 group = @KMEM_GROUP@
99 # Program to install `make'.
100 INSTALL_PROGRAM = @INSTALL_PROGRAM@
101 # Program to install the man page.
102 INSTALL_DATA = @INSTALL_DATA@
103 # Generic install program.
104 INSTALL = @INSTALL@
106 # Program to format Texinfo source into Info files.
107 MAKEINFO = makeinfo
108 # Program to format Texinfo source into DVI files.
109 TEXI2DVI = texi2dvi
111 # Programs to make tags files.
112 ETAGS = etags -tw
113 CTAGS = ctags -tw
115 objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o      \
116        rule.o implicit.o default.o variable.o expand.o function.o       \
117        vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o     \
118        $(GLOB) $(GETOPT) $(ALLOCA) $(extras)
119 srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c             \
120        $(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c         \
121        $(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c             \
122        $(srcdir)/rule.c $(srcdir)/implicit.c $(srcdir)/default.c        \
123        $(srcdir)/variable.c $(srcdir)/expand.c $(srcdir)/function.c     \
124        $(srcdir)/vpath.c $(srcdir)/version.c                            \
125        $(srcdir)/remote-$(REMOTE).c                                     \
126        $(srcdir)/ar.c $(srcdir)/arscan.c                                \
127        $(srcdir)/signame.c $(srcdir)/signame.h $(GETOPT_SRC)            \
128        $(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/file.h            \
129        $(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h                \
130        $(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
133 .SUFFIXES:
134 .SUFFIXES: .o .c .h .ps .dvi .texinfo
136 .PHONY: all check info dvi
137 all: make
138 check: # No tests.
139 info: make.info
140 dvi: make.dvi
142 make.info: make.texinfo
143         $(MAKEINFO) -I$(srcdir) $(srcdir)/make.texinfo -o make.info
145 make.dvi: make.texinfo
146         $(TEXI2DVI) $(srcdir)/make.texinfo
148 make.ps: make.dvi
149         dvi2ps make.dvi > make.ps
151 make: $(objs)
152         $(CC) $(LDFLAGS) $(objs) $(LOADLIBES) -o make.new
153         mv -f make.new make
155 # -I. is needed to find config.h in the build directory.
156 .c.o:
157         $(CC) $(defines) -c -I. -I$(srcdir) -I$(srcdir)/glob \
158               $(CFLAGS) $< $(OUTPUT_OPTION)
160 # For some losing Unix makes.
161 SHELL = /bin/sh
162 MAKE = make
164 glob/libglob.a: force
165         cd glob; $(MAKE) CC='$(CC)' CFLAGS='$(CFLAGS) -I..' \
166                          CPPFLAGS='$(CPPFLAGS) -DHAVE_CONFIG_H' \
167                          libglob.a
168 force:
170 tagsrcs = $(srcs) $(srcdir)/remote-*.c
171 TAGS: $(tagsrcs)
172         $(ETAGS) $(tagsrcs)
173 tags: $(tagsrcs)
174         $(CTAGS) $(tagsrcs)
176 .PHONY: install
177 install: $(bindir)/$(instname) $(infodir)/$(instname).info \
178          $(mandir)/$(instname).$(manext)
180 $(bindir)/$(instname): make
181         $(INSTALL_PROGRAM) make $@.new
182 # These are necessary for load-average checking to work on most Unix machines.
183         -if $(install_setgid); then \
184           chgrp $(group) $@.new && chmod g+s $@.new; \
185         else true; fi
186 # Some systems can't deal with renaming onto a running binary.
187         -rm -f $@.old
188         -mv $@ $@.old
189         mv $@.new $@
191 $(infodir)/$(instname).info: make.info
192         for file in make.info*; do \
193           $(INSTALL_DATA) $$file \
194             `echo $@ | sed "s,$(instname).info\$$,$$file,"`; \
195         done
197 $(mandir)/$(instname).$(manext): make.man
198         $(INSTALL_DATA) $(srcdir)/make.man $@
200 .PHONY: clean realclean distclean mostlyclean
201 clean: glob-clean
202         -rm -f make *.o core
203 distclean: clean glob-realclean
204         -rm -f Makefile config.h config.status build.sh
205         -rm -f TAGS tags make.info* make.dvi
206         -rm -f make.?? make.??s make.log make.toc make.*aux
207 realclean: distclean
208 mostlyclean: clean
210 .PHONY: glob-clean glob-realclean
211 glob-clean glob-realclean:
212         cd glob; $(MAKE) $@
214 Makefile: config.status $(srcdir)/Makefile.in
215         $(SHELL) config.status
216 config.h: stamp-config ;
217 stamp-config: config.status $(srcdir)/config.h.in
218         $(SHELL) config.status
219         touch stamp-config
221 configure: configure.in
222         autoconf $(ACFLAGS)
223 config.h.in: configure.in
224         autoheader $(ACFLAGS)
226 # This tells versions [3.59,3.63) of GNU make not to export all variables.
227 .NOEXPORT:
229 # Automatically generated dependencies will be put at the end of the file.