1 # -*-Makefile-*- for GNU make on Amiga
3 # NOTE: If you have no `make' program at all to process this makefile, run
6 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
7 # 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
8 # This file is part of GNU Make.
10 # GNU Make is free software; you can redistribute it and/or modify it under
11 # the terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 3 of the License, or (at your option) any later
15 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
20 # You should have received a copy of the GNU General Public License along with
21 # this program. If not, see <http://www.gnu.org/licenses/>.
24 # Makefile for GNU Make
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,
41 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
42 # See also `config.h'.
45 # Which flavor of remote job execution support to use.
46 # The code is found in `remote-$(REMOTE).c'.
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.
62 # If your system doesn't have alloca, or the one provided is bad, define this.
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.
72 # Any extra object files your system needs.
75 # Common prefix for machine-independent installed files.
77 # Common prefix for machine-dependent installed files.
80 # Directory to install `make' in.
82 # Directory to find libraries in for `-lXXX'.
84 # Directory to search by default for included makefiles.
86 # Directory to install the Info files in.
88 # Directory to install the man page in.
90 # Number to put on the man page filename.
92 # Prefix to put on installed `make' binary file name.
94 # Prefix to put on installed `make' man page file name.
95 manprefix = $(binprefix)
97 # Whether or not make needs to be installed setgid.
98 # The value should be either `true' or `false'.
99 # On many systems, the getloadavg function (used to implement the `-l'
100 # switch) will not work unless make is installed setgid kmem.
101 install_setgid = false
102 # Install make setgid to this group so it can read /dev/kmem.
105 # Program to install `make'.
106 INSTALL_PROGRAM = copy
107 # Program to install the man page.
109 # Generic install program.
112 # Program to format Texinfo source into Info files.
114 # Program to format Texinfo source into DVI files.
117 # Programs to make tags files.
123 objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
124 rule.o implicit.o default.o variable.o expand.o function.o \
125 vpath.o version.o ar.o arscan.o signame.o strcache.o hash.o \
126 remote-$(REMOTE).o $(GETOPT) $(ALLOCA) $(extras) $(guile)
128 srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
129 $(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
130 $(srcdir)main.c $(srcdir)read.c $(srcdir)remake.c \
131 $(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
132 $(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.c \
133 $(srcdir)vpath.c $(srcdir)version.c $(srcdir)hash.c \
134 $(srcdir)guile.c $(srcdir)remote-$(REMOTE).c \
135 $(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \
136 $(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
137 $(srcdir)commands.h $(srcdir)dep.h $(srcdir)filedep.h \
138 $(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \
139 $(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
143 .SUFFIXES: .o .c .h .ps .dvi .info .texinfo
148 # Some makes apparently use .PHONY as the default goal if it is before `all'.
149 .PHONY: all check info dvi
151 make.info: make.texinfo
152 $(MAKEINFO) -I$(srcdir) $(srcdir)make.texinfo -o make.info
154 make.dvi: make.texinfo
155 $(TEXI2DVI) $(srcdir)make.texinfo
158 dvi2ps make.dvi > make.ps
160 make: $(objs) $(GLOB)
161 $(CC) Link $(LDFLAGS) $(objs) Lib $(GLOB) $(LOADLIBES) To make.new
169 $(MAKE) -$(MAKEFLAGS) -f Makefile
171 # -I. is needed to find config.h in the build directory.
174 $(CC) $(defines) IDir "" IDir glob \
175 $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
177 # For some losing Unix makes.
181 glob/libglob.a: FORCE config.h
182 cd glob; $(MAKE) libglob.a
185 .PHONY: install installdirs
186 install: installdirs \
187 $(bindir)$(binprefix)make $(infodir)make.info \
188 $(mandir)$(manprefix)make.$(manext)
191 $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
193 $(bindir)$(binprefix)make: make
194 $(INSTALL_PROGRAM) make $@.new
195 @if $(install_setgid); then \
196 if chgrp $(group) $@.new && chmod g+s $@.new; then \
197 echo "chgrp $(group) $@.new && chmod g+s $@.new"; \
199 echo "$@ needs to be owned by group $(group) and setgid;"; \
200 echo "otherwise the \`-l' option will probably not work."; \
201 echo "You may need special privileges to install $@."; \
204 # Some systems can't deal with renaming onto a running binary.
209 $(infodir)make.info: make.info
210 if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
211 for file in $${dir}/make.info*; do \
212 name="`basename $$file`"; \
213 $(INSTALL_DATA) $$file \
214 `echo $@ | sed "s,make.info\$$,$$name,"`; \
216 # Run install-info only if it exists.
217 # Use `if' instead of just prepending `-' to the
218 # line so we notice real errors from install-info.
219 # We use `$(SHELL) -c' because some shells do not
220 # fail gracefully when there is an unknown command.
221 if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
222 if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
223 install-info --infodir=$(infodir) $$dir/make.info; \
226 $(mandir)$(manprefix)make.$(manext): make.man
227 $(INSTALL_DATA) $(srcdir)make.man $@
230 loadavg: loadavg.c config.h
231 $(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
232 loadavg.c $(LOADLIBES) -o $@
233 # We copy getloadavg.c into a different file rather than compiling it
234 # directly because some compilers clobber getloadavg.o in the process.
235 loadavg.c: getloadavg.c
236 ln $(srcdir)getloadavg.c loadavg.c || \
237 cp $(srcdir)getloadavg.c loadavg.c
238 check-loadavg: loadavg
239 @echo The system uptime program believes the load average to be:
241 @echo The GNU load average checking code believes:
246 .PHONY: clean realclean distclean mostlyclean
248 -$(RM) make loadavg "#?.o" core make.dvi
250 distclean: clean glob-realclean
251 -$(RM) Makefile config.h config.status build.sh
252 -$(RM) config.log config.cache
254 -$(RM) make.?? make.??s make.log make.toc make.*aux
261 .PHONY: glob-clean glob-realclean
262 glob-clean glob-realclean:
266 # This tells versions [3.59,3.63) of GNU make not to export all variables.
269 # The automatically generated dependencies below may omit config.h
270 # because it is included with ``#include <config.h>'' rather than
271 # ``#include "config.h"''. So we add the explicit dependency to make sure.
274 # Automatically generated dependencies will be put at the end of the file.
276 # Automatically generated dependencies.
277 commands.o: commands.c make.h dep.h filedef.h variable.h job.h \
279 job.o: job.c make.h job.h filedef.h commands.h variable.h
281 file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
282 misc.o: misc.c make.h dep.h
283 main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
285 guile.o: guile.c make.h dep.h debug.h variable.h gmk-default.h
286 read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
288 remake.o: remake.c make.h filedef.h job.h commands.h dep.h
289 rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
291 implicit.o: implicit.c make.h rule.h dep.h filedef.h
292 default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
294 variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
296 expand.o: expand.c make.h filedef.h job.h commands.h variable.h
297 function.o: function.c make.h filedef.h variable.h dep.h job.h \
299 vpath.o: vpath.c make.h filedef.h variable.h
300 strcache.o: strcache.c make.h hash.h
302 ar.o: ar.c make.h filedef.h dep.h
303 arscan.o: arscan.c make.h
304 signame.o: signame.c signame.h
305 remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
307 getopt1.o : getopt1.c getopt.h
308 getloadavg.o: getloadavg.c
309 amiga.o: amiga.c make.h variable.h amiga.h