*** empty log message ***
[make.git] / compatMakefile
blobb82db344f18e7e7c6fbc97d56ebbfb327d0ca2fd
1 # NOTE: If you have no `make' program at all to process this makefile, run
2 # `build.sh' instead.
4 # Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
5 # This file is part of GNU Make.
6
7 # GNU Make is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
12 # GNU Make is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Make; see the file COPYING.  If not, write to
19 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 #       Makefile for GNU Make
25 # Ultrix 2.2 make doesn't expand the value of VPATH.
26 VPATH = @srcdir@
27 srcdir = $(VPATH)
29 CC = @CC@
31 CFLAGS = @CFLAGS@
32 LDFLAGS = @LDFLAGS@
34 # Define these for your system as follows:
35 #       -DNO_ARCHIVES           To disable `ar' archive support.
36 #       -DNO_FLOAT              To avoid using floating-point numbers.
37 #       -DENUM_BITFIELDS        If the compiler isn't GCC but groks enum foo:2.
38 #                               Some compilers apparently accept this
39 #                               without complaint but produce losing code,
40 #                               so beware.
41 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
42 # See also `config.h'.
43 defines = @DEFS@ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
45 # Which flavor of remote job execution support to use.
46 # The code is found in `remote-$(REMOTE).c'.
47 REMOTE = @REMOTE@
49 # If you are using the GNU C library, or have the GNU getopt functions in
50 # your C library, you can comment these out.
51 GETOPT = getopt.o getopt1.o
52 GETOPT_SRC = $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h
54 # If you are using the GNU C library, or have the GNU glob functions in
55 # your C library, you can comment this out.  GNU make uses special hooks
56 # into the glob functions to be more efficient (by using make's directory
57 # cache for globbing), so you must use the GNU functions even if your
58 # system's C library has the 1003.2 glob functions already.  Also, the glob
59 # functions in the AIX and HPUX C libraries are said to be buggy.
60 GLOB = glob/libglob.a
62 # If your system doesn't have alloca, or the one provided is bad, define this.
63 ALLOCA = @ALLOCA@
64 ALLOCA_SRC = $(srcdir)/alloca.c
66 # If your system needs extra libraries loaded in, define them here.
67 # System V probably need -lPW for alloca.  HP-UX 7.0's alloca in
68 # libPW.a is broken on HP9000s300 and HP9000s400 machines.  Use
69 # alloca.c instead on those machines.
70 LOADLIBES = @LIBS@
72 # Any extra object files your system needs.
73 extras = @LIBOBJS@
75 # Common prefix for machine-independent installed files.
76 prefix = /usr/local
77 # Common prefix for machine-dependent installed files.
78 exec_prefix = $(prefix)
80 # Name under which to install GNU make.
81 instname = make
82 # Directory to install `make' in.
83 bindir = $(exec_prefix)/bin
84 # Directory to find libraries in for `-lXXX'.
85 libdir = $(exec_prefix)/lib
86 # Directory to search by default for included makefiles.
87 includedir = $(prefix)/include
88 # Directory to install the Info files in.
89 infodir = $(prefix)/info
90 # Directory to install the man page in.
91 mandir = $(prefix)/man/man$(manext)
92 # Number to put on the man page filename.
93 manext = 1
95 # Whether or not make needs to be installed setgid.
96 # The value should be either `true' or `false'.
97 # On many systems, the getloadavg function (used to implement the `-l'
98 # switch) will not work unless make is installed setgid kmem.
99 install_setgid = @NEED_SETGID@
100 # Install make setgid to this group so it can read /dev/kmem.
101 group = @KMEM_GROUP@
103 # Program to install `make'.
104 INSTALL_PROGRAM = @INSTALL_PROGRAM@
105 # Program to install the man page.
106 INSTALL_DATA = @INSTALL_DATA@
107 # Generic install program.
108 INSTALL = @INSTALL@
110 # Program to format Texinfo source into Info files.
111 MAKEINFO = makeinfo
112 # Program to format Texinfo source into DVI files.
113 TEXI2DVI = texi2dvi
115 # Programs to make tags files.
116 ETAGS = etags -tw
117 CTAGS = ctags -tw
119 objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o      \
120        rule.o implicit.o default.o variable.o expand.o function.o       \
121        vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o     \
122        $(GLOB) $(GETOPT) $(ALLOCA) $(extras)
123 srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c             \
124        $(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c         \
125        $(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c             \
126        $(srcdir)/rule.c $(srcdir)/implicit.c $(srcdir)/default.c        \
127        $(srcdir)/variable.c $(srcdir)/expand.c $(srcdir)/function.c     \
128        $(srcdir)/vpath.c $(srcdir)/version.c                            \
129        $(srcdir)/remote-$(REMOTE).c                                     \
130        $(srcdir)/ar.c $(srcdir)/arscan.c                                \
131        $(srcdir)/signame.c $(srcdir)/signame.h $(GETOPT_SRC)            \
132        $(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/file.h            \
133        $(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h                \
134        $(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
137 .SUFFIXES:
138 .SUFFIXES: .o .c .h .ps .dvi .info .texinfo
140 all: make
141 check: # No tests.
142 info: make.info
143 dvi: make.dvi
144 # Some makes apparently use .PHONY as the default goal is it is before `all'.
145 .PHONY: all check info dvi
147 make.info: make.texinfo
148         $(MAKEINFO) -I$(srcdir) $(srcdir)/make.texinfo -o make.info
150 make.dvi: make.texinfo
151         $(TEXI2DVI) $(srcdir)/make.texinfo
153 make.ps: make.dvi
154         dvi2ps make.dvi > make.ps
156 make: $(objs)
157         $(CC) $(LDFLAGS) $(objs) $(LOADLIBES) -o make.new
158         mv -f make.new make
160 # -I. is needed to find config.h in the build directory.
161 .c.o:
162         $(CC) $(defines) -c -I. -I$(srcdir) -I$(srcdir)/glob \
163               $(CFLAGS) $< $(OUTPUT_OPTION)
165 # For some losing Unix makes.
166 SHELL = /bin/sh
167 MAKE = make
169 glob/libglob.a: FORCE config.h
170         cd glob; $(MAKE) CC='$(CC)' CFLAGS='$(CFLAGS) -I..' \
171                          CPPFLAGS='$(CPPFLAGS) -DHAVE_CONFIG_H' \
172                          libglob.a
173 FORCE:
175 tagsrcs = $(srcs) $(srcdir)/remote-*.c
176 TAGS: $(tagsrcs)
177         $(ETAGS) $(tagsrcs)
178 tags: $(tagsrcs)
179         $(CTAGS) $(tagsrcs)
181 .PHONY: install installdirs
182 install: installdirs \
183          $(bindir)/$(instname) $(infodir)/make.info \
184          $(mandir)/$(instname).$(manext)
186 installdirs:
187         $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
189 $(bindir)/$(instname): make
190         $(INSTALL_PROGRAM) make $@.new
191         @if $(install_setgid); then \
192            if chgrp $(group) $@.new && chmod g+s $@.new; then \
193              echo "chgrp $(group) $@.new && chmod g+s $@.new"; \
194            else \
195              echo "$@ needs to be owned by group $(group) and setgid;"; \
196              echo "otherwise the \`-l' option will probably not work."; \
197              echo "You may need special priveleges to install $@."; \
198            fi; \
199          else true; fi
200 # Some systems can't deal with renaming onto a running binary.
201         -rm -f $@.old
202         -mv $@ $@.old
203         mv $@.new $@
205 $(infodir)/make.info: make.info
206         if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
207         for file in $${dir}/make.info*; do \
208           name="`basename $$file`"; \
209           $(INSTALL_DATA) $$file \
210             `echo $@ | sed "s,make.info\$$,$$name,"`; \
211         done
212 # Run install-info only if it exists.
213 # Use `if' instead of just prepending `-' to the
214 # line so we notice real errors from install-info.
215 # We use `$(SHELL) -c' because some shells do not
216 # fail gracefully when there is an unknown command.
217         if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
218           install-info --infodir=$(infodir) $$d/foo.info; \
219         else true; fi
221 $(mandir)/$(instname).$(manext): make.man
222         $(INSTALL_DATA) $(srcdir)/make.man $@
225 loadavg: getloadavg.c config.h
226         $(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
227               $(srcdir)/getloadavg.c -o $@
228 check-loadavg: loadavg
229         @echo The system uptime program believes the load average to be:
230         -uptime
231         @echo The GNU load average checking code believes:
232         ./loadavg
233 check: check-loadavg
236 .PHONY: clean realclean distclean mostlyclean
237 clean: glob-clean
238         -rm -f make *.o core
239 distclean: clean glob-realclean
240         -rm -f Makefile config.h config.status build.sh stamp-config
241         -rm -f TAGS tags make.info* make.dvi
242         -rm -f make.?? make.??s make.log make.toc make.*aux
243 realclean: distclean
244 mostlyclean: clean
246 .PHONY: glob-clean glob-realclean
247 glob-clean glob-realclean:
248         cd glob; $(MAKE) $@
250 Makefile: config.status $(srcdir)/Makefile.in
251         $(SHELL) config.status
252 config.h: stamp-config ;
253 stamp-config: config.status $(srcdir)/config.h.in
254         $(SHELL) config.status
255         touch stamp-config
257 configure: configure.in
258         autoconf $(ACFLAGS)
259 config.h.in: configure.in
260         autoheader $(ACFLAGS)
262 # This tells versions [3.59,3.63) of GNU make not to export all variables.
263 .NOEXPORT:
265 # Automatically generated dependencies will be put at the end of the file.