1 # Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
2 # This file is part of GNU Make.
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)
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.
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.
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,
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'.
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.
58 # If your system doesn't have alloca, or the one provided is bad, define this.
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.
68 # Any extra object files your system needs.
71 # Common prefix for machine-independent installed files.
73 # Common prefix for machine-dependent installed files.
74 exec_prefix = $(prefix)
76 # Name under which to install GNU 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.
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.
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.
106 # Program to format Texinfo source into Info files.
108 # Program to format Texinfo source into DVI files.
111 # Programs to make tags files.
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
134 .SUFFIXES: .o .c .h .ps .dvi .texinfo
136 .PHONY: all check info 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
149 dvi2ps make.dvi > make.ps
152 $(CC) $(LDFLAGS) $(objs) $(LOADLIBES) -o make.new
155 # -I. is needed to find config.h in the build directory.
157 $(CC) $(defines) -c -I. -I$(srcdir) -I$(srcdir)/glob \
158 $(CFLAGS) $< $(OUTPUT_OPTION)
160 # For some losing Unix makes.
164 glob/libglob.a: force
165 cd glob; $(MAKE) CC='$(CC)' CFLAGS='$(CFLAGS) -I..' \
166 CPPFLAGS='$(CPPFLAGS) -DHAVE_CONFIG_H' \
170 tagsrcs = $(srcs) $(srcdir)/remote-*.c
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; \
186 # Some systems can't deal with renaming onto a running binary.
191 $(infodir)/$(instname).info: make.info
192 for file in make.info*; do \
193 $(INSTALL_DATA) $$file \
194 `echo $@ | sed "s,$(instname).info\$$,$$file,"`; \
197 $(mandir)/$(instname).$(manext): make.man
198 $(INSTALL_DATA) $(srcdir)/make.man $@
200 .PHONY: clean realclean distclean mostlyclean
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
210 .PHONY: glob-clean glob-realclean
211 glob-clean glob-realclean:
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
221 configure: configure.in
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.
229 # Automatically generated dependencies will be put at the end of the file.