[501] | 1 | # -*-Makefile-*- for GNU make on Amiga
|
---|
| 2 | #
|
---|
[3138] | 3 | # NOTE: If you have no 'make' program at all to process this makefile, run
|
---|
| 4 | # 'build.sh' instead.
|
---|
[53] | 5 | #
|
---|
[3138] | 6 | # Copyright (C) 1995-2016 Free Software Foundation, Inc.
|
---|
[53] | 7 | # This file is part of GNU Make.
|
---|
| 8 | #
|
---|
[1989] | 9 | # GNU Make is free software; you can redistribute it and/or modify it under
|
---|
| 10 | # the terms of the GNU General Public License as published by the Free Software
|
---|
| 11 | # Foundation; either version 3 of the License, or (at your option) any later
|
---|
| 12 | # version.
|
---|
[53] | 13 | #
|
---|
[501] | 14 | # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
---|
[1989] | 15 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
| 16 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
---|
| 17 | # details.
|
---|
[53] | 18 | #
|
---|
[501] | 19 | # You should have received a copy of the GNU General Public License along with
|
---|
[1989] | 20 | # this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
[53] | 21 |
|
---|
| 22 | #
|
---|
| 23 | # Makefile for GNU Make
|
---|
| 24 | #
|
---|
| 25 |
|
---|
| 26 | CC = sc
|
---|
| 27 | RM = delete
|
---|
| 28 |
|
---|
| 29 | CFLAGS =
|
---|
| 30 | CPPFLAGS =
|
---|
| 31 | LDFLAGS =
|
---|
| 32 |
|
---|
| 33 | # Define these for your system as follows:
|
---|
[3138] | 34 | # -DNO_ARCHIVES To disable 'ar' archive support.
|
---|
[53] | 35 | # -DNO_FLOAT To avoid using floating-point numbers.
|
---|
| 36 | # -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
|
---|
| 37 | # Some compilers apparently accept this
|
---|
| 38 | # without complaint but produce losing code,
|
---|
| 39 | # so beware.
|
---|
| 40 | # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
---|
[3138] | 41 | # See also 'config.h'.
|
---|
[53] | 42 | defines =
|
---|
| 43 |
|
---|
| 44 | # Which flavor of remote job execution support to use.
|
---|
[3138] | 45 | # The code is found in 'remote-$(REMOTE).c'.
|
---|
[53] | 46 | REMOTE = stub
|
---|
| 47 |
|
---|
| 48 | # If you are using the GNU C library, or have the GNU getopt functions in
|
---|
| 49 | # your C library, you can comment these out.
|
---|
| 50 | GETOPT = getopt.o getopt1.o
|
---|
| 51 | GETOPT_SRC = $(srcdir)getopt.c $(srcdir)getopt1.c $(srcdir)getopt.h
|
---|
| 52 |
|
---|
| 53 | # If you are using the GNU C library, or have the GNU glob functions in
|
---|
| 54 | # your C library, you can comment this out. GNU make uses special hooks
|
---|
| 55 | # into the glob functions to be more efficient (by using make's directory
|
---|
| 56 | # cache for globbing), so you must use the GNU functions even if your
|
---|
| 57 | # system's C library has the 1003.2 glob functions already. Also, the glob
|
---|
| 58 | # functions in the AIX and HPUX C libraries are said to be buggy.
|
---|
| 59 | GLOB = glob/glob.lib
|
---|
| 60 |
|
---|
| 61 | # If your system doesn't have alloca, or the one provided is bad, define this.
|
---|
| 62 | ALLOCA = alloca.o
|
---|
| 63 | ALLOCA_SRC = $(srcdir)alloca.c
|
---|
| 64 |
|
---|
| 65 | # If your system needs extra libraries loaded in, define them here.
|
---|
| 66 | # System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
---|
| 67 | # libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
---|
| 68 | # alloca.c instead on those machines.
|
---|
| 69 | LOADLIBES =
|
---|
| 70 |
|
---|
| 71 | # Any extra object files your system needs.
|
---|
| 72 | extras = amiga.o
|
---|
| 73 |
|
---|
| 74 | # Common prefix for machine-independent installed files.
|
---|
| 75 | prefix =
|
---|
| 76 | # Common prefix for machine-dependent installed files.
|
---|
| 77 | exec_prefix =
|
---|
| 78 |
|
---|
[3138] | 79 | # Directory to install 'make' in.
|
---|
[53] | 80 | bindir = sc:c
|
---|
[3138] | 81 | # Directory to find libraries in for '-lXXX'.
|
---|
[53] | 82 | libdir = lib:
|
---|
| 83 | # Directory to search by default for included makefiles.
|
---|
| 84 | includedir = include:
|
---|
| 85 | # Directory to install the Info files in.
|
---|
| 86 | infodir = doc:
|
---|
| 87 | # Directory to install the man page in.
|
---|
| 88 | mandir = t:
|
---|
| 89 | # Number to put on the man page filename.
|
---|
| 90 | manext = 1
|
---|
[3138] | 91 | # Prefix to put on installed 'make' binary file name.
|
---|
[53] | 92 | binprefix =
|
---|
[3138] | 93 | # Prefix to put on installed 'make' man page file name.
|
---|
[53] | 94 | manprefix = $(binprefix)
|
---|
| 95 |
|
---|
| 96 | # Whether or not make needs to be installed setgid.
|
---|
[3138] | 97 | # The value should be either 'true' or 'false'.
|
---|
| 98 | # On many systems, the getloadavg function (used to implement the '-l'
|
---|
[53] | 99 | # switch) will not work unless make is installed setgid kmem.
|
---|
| 100 | install_setgid = false
|
---|
| 101 | # Install make setgid to this group so it can read /dev/kmem.
|
---|
| 102 | group = sys
|
---|
| 103 |
|
---|
[3138] | 104 | # Program to install 'make'.
|
---|
[53] | 105 | INSTALL_PROGRAM = copy
|
---|
| 106 | # Program to install the man page.
|
---|
| 107 | INSTALL_DATA = copy
|
---|
| 108 | # Generic install program.
|
---|
| 109 | INSTALL = copy
|
---|
| 110 |
|
---|
| 111 | # Program to format Texinfo source into Info files.
|
---|
| 112 | MAKEINFO = makeinfo
|
---|
| 113 | # Program to format Texinfo source into DVI files.
|
---|
| 114 | TEXI2DVI = texi2dvi
|
---|
| 115 |
|
---|
| 116 | # Programs to make tags files.
|
---|
| 117 | ETAGS = etags -w
|
---|
| 118 | CTAGS = ctags -w
|
---|
| 119 |
|
---|
[3138] | 120 | #guile = guile.o
|
---|
| 121 |
|
---|
| 122 | objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
---|
| 123 | rule.o implicit.o default.o variable.o expand.o function.o \
|
---|
| 124 | vpath.o version.o ar.o arscan.o signame.o strcache.o hash.o \
|
---|
| 125 | remote-$(REMOTE).o $(GETOPT) $(ALLOCA) $(extras) $(guile)
|
---|
| 126 |
|
---|
[53] | 127 | srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
|
---|
| 128 | $(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
|
---|
| 129 | $(srcdir)main.c $(srcdir)read.c $(srcdir)remake.c \
|
---|
| 130 | $(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
|
---|
| 131 | $(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.c \
|
---|
| 132 | $(srcdir)vpath.c $(srcdir)version.c $(srcdir)hash.c \
|
---|
[3138] | 133 | $(srcdir)guile.c $(srcdir)remote-$(REMOTE).c \
|
---|
| 134 | $(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \
|
---|
| 135 | $(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
|
---|
| 136 | $(srcdir)commands.h $(srcdir)dep.h $(srcdir)filedep.h \
|
---|
| 137 | $(srcdir)job.h $(srcdir)makeint.h $(srcdir)rule.h \
|
---|
[53] | 138 | $(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
|
---|
| 139 |
|
---|
| 140 |
|
---|
| 141 | .SUFFIXES:
|
---|
| 142 | .SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
---|
| 143 |
|
---|
| 144 | all: make
|
---|
| 145 | info: make.info
|
---|
| 146 | dvi: make.dvi
|
---|
[3138] | 147 | # Some makes apparently use .PHONY as the default goal if it is before 'all'.
|
---|
[53] | 148 | .PHONY: all check info dvi
|
---|
| 149 |
|
---|
| 150 | make.info: make.texinfo
|
---|
| 151 | $(MAKEINFO) -I$(srcdir) $(srcdir)make.texinfo -o make.info
|
---|
| 152 |
|
---|
| 153 | make.dvi: make.texinfo
|
---|
| 154 | $(TEXI2DVI) $(srcdir)make.texinfo
|
---|
| 155 |
|
---|
| 156 | make.ps: make.dvi
|
---|
| 157 | dvi2ps make.dvi > make.ps
|
---|
| 158 |
|
---|
| 159 | make: $(objs) $(GLOB)
|
---|
| 160 | $(CC) Link $(LDFLAGS) $(objs) Lib $(GLOB) $(LOADLIBES) To make.new
|
---|
| 161 | -delete make
|
---|
| 162 | rename make.new make
|
---|
| 163 |
|
---|
| 164 | TMPFILE = t:Make$$
|
---|
| 165 |
|
---|
| 166 | $(GLOB):
|
---|
| 167 | cd glob @@\
|
---|
| 168 | $(MAKE) -$(MAKEFLAGS) -f Makefile
|
---|
| 169 |
|
---|
| 170 | # -I. is needed to find config.h in the build directory.
|
---|
| 171 | OUTPUT_OPTION =
|
---|
| 172 | .c.o:
|
---|
| 173 | $(CC) $(defines) IDir "" IDir glob \
|
---|
| 174 | $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
---|
| 175 |
|
---|
| 176 | # For some losing Unix makes.
|
---|
| 177 | SHELL = /bin/sh
|
---|
| 178 | #@SET_MAKE@
|
---|
| 179 |
|
---|
| 180 | glob/libglob.a: FORCE config.h
|
---|
| 181 | cd glob; $(MAKE) libglob.a
|
---|
| 182 | FORCE:
|
---|
| 183 |
|
---|
| 184 | .PHONY: install installdirs
|
---|
| 185 | install: installdirs \
|
---|
| 186 | $(bindir)$(binprefix)make $(infodir)make.info \
|
---|
| 187 | $(mandir)$(manprefix)make.$(manext)
|
---|
| 188 |
|
---|
| 189 | installdirs:
|
---|
| 190 | $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
|
---|
| 191 |
|
---|
| 192 | $(bindir)$(binprefix)make: make
|
---|
| 193 | $(INSTALL_PROGRAM) make $@.new
|
---|
| 194 | @if $(install_setgid); then \
|
---|
| 195 | if chgrp $(group) $@.new && chmod g+s $@.new; then \
|
---|
| 196 | echo "chgrp $(group) $@.new && chmod g+s $@.new"; \
|
---|
| 197 | else \
|
---|
| 198 | echo "$@ needs to be owned by group $(group) and setgid;"; \
|
---|
[3138] | 199 | echo "otherwise the '-l' option will probably not work."; \
|
---|
[53] | 200 | echo "You may need special privileges to install $@."; \
|
---|
| 201 | fi; \
|
---|
| 202 | else true; fi
|
---|
| 203 | # Some systems can't deal with renaming onto a running binary.
|
---|
| 204 | -$(RM) $@.old
|
---|
| 205 | -mv $@ $@.old
|
---|
| 206 | mv $@.new $@
|
---|
| 207 |
|
---|
| 208 | $(infodir)make.info: make.info
|
---|
| 209 | if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
---|
| 210 | for file in $${dir}/make.info*; do \
|
---|
| 211 | name="`basename $$file`"; \
|
---|
| 212 | $(INSTALL_DATA) $$file \
|
---|
| 213 | `echo $@ | sed "s,make.info\$$,$$name,"`; \
|
---|
| 214 | done
|
---|
| 215 | # Run install-info only if it exists.
|
---|
[3138] | 216 | # Use 'if' instead of just prepending '-' to the
|
---|
[53] | 217 | # line so we notice real errors from install-info.
|
---|
[3138] | 218 | # We use '$(SHELL) -c' because some shells do not
|
---|
[53] | 219 | # fail gracefully when there is an unknown command.
|
---|
| 220 | if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
---|
| 221 | if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
---|
| 222 | install-info --infodir=$(infodir) $$dir/make.info; \
|
---|
| 223 | else true; fi
|
---|
| 224 |
|
---|
| 225 | $(mandir)$(manprefix)make.$(manext): make.man
|
---|
| 226 | $(INSTALL_DATA) $(srcdir)make.man $@
|
---|
| 227 |
|
---|
| 228 |
|
---|
| 229 | loadavg: loadavg.c config.h
|
---|
| 230 | $(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
|
---|
| 231 | loadavg.c $(LOADLIBES) -o $@
|
---|
| 232 | # We copy getloadavg.c into a different file rather than compiling it
|
---|
| 233 | # directly because some compilers clobber getloadavg.o in the process.
|
---|
| 234 | loadavg.c: getloadavg.c
|
---|
| 235 | ln $(srcdir)getloadavg.c loadavg.c || \
|
---|
| 236 | cp $(srcdir)getloadavg.c loadavg.c
|
---|
| 237 | check-loadavg: loadavg
|
---|
| 238 | @echo The system uptime program believes the load average to be:
|
---|
| 239 | -uptime
|
---|
| 240 | @echo The GNU load average checking code believes:
|
---|
| 241 | ./loadavg
|
---|
| 242 | check: check-loadavg
|
---|
| 243 |
|
---|
| 244 |
|
---|
| 245 | .PHONY: clean realclean distclean mostlyclean
|
---|
| 246 | clean: glob-clean
|
---|
| 247 | -$(RM) make loadavg "#?.o" core make.dvi
|
---|
| 248 |
|
---|
| 249 | distclean: clean glob-realclean
|
---|
| 250 | -$(RM) Makefile config.h config.status build.sh
|
---|
| 251 | -$(RM) config.log config.cache
|
---|
| 252 | -$(RM) TAGS tags
|
---|
| 253 | -$(RM) make.?? make.??s make.log make.toc make.*aux
|
---|
| 254 | -$(RM) loadavg.c
|
---|
| 255 |
|
---|
| 256 | realclean: distclean
|
---|
| 257 | -$(RM) make.info*
|
---|
| 258 | mostlyclean: clean
|
---|
| 259 |
|
---|
| 260 | .PHONY: glob-clean glob-realclean
|
---|
| 261 | glob-clean glob-realclean:
|
---|
| 262 | cd glob @@\
|
---|
| 263 | $(MAKE) $@
|
---|
| 264 |
|
---|
| 265 | # This tells versions [3.59,3.63) of GNU make not to export all variables.
|
---|
| 266 | .NOEXPORT:
|
---|
| 267 |
|
---|
| 268 | # The automatically generated dependencies below may omit config.h
|
---|
[3138] | 269 | # because it is included with '#include <config.h>' rather than
|
---|
| 270 | # '#include "config.h"'. So we add the explicit dependency to make sure.
|
---|
[53] | 271 | $(objs): config.h
|
---|
| 272 |
|
---|
| 273 | # Automatically generated dependencies will be put at the end of the file.
|
---|
| 274 |
|
---|
| 275 | # Automatically generated dependencies.
|
---|
[3138] | 276 | commands.o: commands.c makeint.h dep.h filedef.h variable.h job.h \
|
---|
[53] | 277 | commands.h
|
---|
[3138] | 278 | job.o: job.c makeint.h job.h filedef.h commands.h variable.h
|
---|
| 279 | dir.o: dir.c makeint.h
|
---|
| 280 | file.o: file.c makeint.h dep.h filedef.h job.h commands.h variable.h
|
---|
| 281 | misc.o: misc.c makeint.h dep.h
|
---|
| 282 | main.o: main.c makeint.h dep.h filedef.h variable.h job.h commands.h \
|
---|
[53] | 283 | getopt.h
|
---|
[3138] | 284 | guile.o: guile.c makeint.h dep.h debug.h variable.h gmk-default.h
|
---|
| 285 | read.o: read.c makeint.h dep.h filedef.h job.h commands.h variable.h \
|
---|
[53] | 286 | glob/glob.h
|
---|
[3138] | 287 | remake.o: remake.c makeint.h filedef.h job.h commands.h dep.h
|
---|
| 288 | rule.o: rule.c makeint.h dep.h filedef.h job.h commands.h variable.h \
|
---|
[53] | 289 | rule.h
|
---|
[3138] | 290 | implicit.o: implicit.c makeint.h rule.h dep.h filedef.h
|
---|
| 291 | default.o: default.c makeint.h rule.h dep.h filedef.h job.h commands.h \
|
---|
[53] | 292 | variable.h
|
---|
[3138] | 293 | variable.o: variable.c makeint.h dep.h filedef.h job.h commands.h \
|
---|
[53] | 294 | variable.h
|
---|
[3138] | 295 | expand.o: expand.c makeint.h filedef.h job.h commands.h variable.h
|
---|
| 296 | function.o: function.c makeint.h filedef.h variable.h dep.h job.h \
|
---|
[53] | 297 | commands.h amiga.h
|
---|
[3138] | 298 | vpath.o: vpath.c makeint.h filedef.h variable.h
|
---|
| 299 | strcache.o: strcache.c makeint.h hash.h
|
---|
[53] | 300 | version.o: version.c
|
---|
[3138] | 301 | ar.o: ar.c makeint.h filedef.h dep.h
|
---|
| 302 | arscan.o: arscan.c makeint.h
|
---|
[53] | 303 | signame.o: signame.c signame.h
|
---|
[3138] | 304 | remote-stub.o: remote-stub.c makeint.h filedef.h job.h commands.h
|
---|
[53] | 305 | getopt.o: getopt.c
|
---|
| 306 | getopt1.o : getopt1.c getopt.h
|
---|
| 307 | getloadavg.o: getloadavg.c
|
---|
[3138] | 308 | amiga.o: amiga.c makeint.h variable.h amiga.h
|
---|