| 1 | # This is a -*-Makefile-*-, or close enough
|
|---|
| 2 | #
|
|---|
| 3 | # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
|---|
| 4 | # 2007 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 it under
|
|---|
| 8 | # the terms of the GNU General Public License as published by the Free Software
|
|---|
| 9 | # Foundation; either version 3 of the License, or (at your option) any later
|
|---|
| 10 | # version.
|
|---|
| 11 | #
|
|---|
| 12 | # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
|---|
| 13 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|---|
| 14 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|---|
| 15 | # details.
|
|---|
| 16 | #
|
|---|
| 17 | # You should have received a copy of the GNU General Public License along with
|
|---|
| 18 | # this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 19 |
|
|---|
| 20 | AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news
|
|---|
| 21 | ACLOCAL_AMFLAGS = -I config
|
|---|
| 22 |
|
|---|
| 23 | MAKE_HOST = @MAKE_HOST@
|
|---|
| 24 |
|
|---|
| 25 | # Only process if target is MS-Windows
|
|---|
| 26 | if WINDOWSENV
|
|---|
| 27 | MAYBE_W32 = w32
|
|---|
| 28 | W32INC = -I $(top_srcdir)/w32/include
|
|---|
| 29 | W32LIB = -Lw32 -lw32
|
|---|
| 30 | endif
|
|---|
| 31 |
|
|---|
| 32 | # we can safely drop doc and po when bootstrapping kmk.
|
|---|
| 33 | # SUBDIRS = glob config po doc $(MAYBE_W32)
|
|---|
| 34 | SUBDIRS = glob config $(MAYBE_W32)
|
|---|
| 35 |
|
|---|
| 36 | bin_PROGRAMS = kmk kmk_redirect
|
|---|
| 37 |
|
|---|
| 38 | if USE_CUSTOMS
|
|---|
| 39 | remote = remote-cstms.c
|
|---|
| 40 | else
|
|---|
| 41 | remote = remote-stub.c
|
|---|
| 42 | endif
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 | kmk_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \
|
|---|
| 46 | function.c getopt.c getopt1.c implicit.c job.c main.c \
|
|---|
| 47 | misc.c read.c remake.c $(remote) rule.c signame.c \
|
|---|
| 48 | strcache.c variable.c version.c vpath.c hash.c \
|
|---|
| 49 | \
|
|---|
| 50 | expreval.c \
|
|---|
| 51 | incdep.c \
|
|---|
| 52 | strcache2.c \
|
|---|
| 53 | kbuild.c \
|
|---|
| 54 | electric.c \
|
|---|
| 55 | ../lib/md5.c \
|
|---|
| 56 | ../lib/kDep.c \
|
|---|
| 57 | \
|
|---|
| 58 | kmkbuiltin.c \
|
|---|
| 59 | kmkbuiltin/append.c \
|
|---|
| 60 | kmkbuiltin/cat.c \
|
|---|
| 61 | kmkbuiltin/chmod.c \
|
|---|
| 62 | kmkbuiltin/cmp.c \
|
|---|
| 63 | kmkbuiltin/cmp_util.c \
|
|---|
| 64 | kmkbuiltin/cp.c \
|
|---|
| 65 | kmkbuiltin/cp_utils.c \
|
|---|
| 66 | kmkbuiltin/echo.c \
|
|---|
| 67 | kmkbuiltin/expr.c \
|
|---|
| 68 | kmkbuiltin/install.c \
|
|---|
| 69 | kmkbuiltin/kDepIDB.c \
|
|---|
| 70 | kmkbuiltin/ln.c \
|
|---|
| 71 | kmkbuiltin/md5sum.c \
|
|---|
| 72 | kmkbuiltin/mkdir.c \
|
|---|
| 73 | kmkbuiltin/mv.c \
|
|---|
| 74 | kmkbuiltin/printf.c \
|
|---|
| 75 | kmkbuiltin/rm.c \
|
|---|
| 76 | kmkbuiltin/rmdir.c \
|
|---|
| 77 | kmkbuiltin/sleep.c \
|
|---|
| 78 | kmkbuiltin/test.c \
|
|---|
| 79 | kmkbuiltin/err.c \
|
|---|
| 80 | kmkbuiltin/setmode.c \
|
|---|
| 81 | kmkbuiltin/strmode.c \
|
|---|
| 82 | kmkbuiltin/strlcpy.c \
|
|---|
| 83 | kmkbuiltin/osdep.c \
|
|---|
| 84 | kmkbuiltin/kbuild_protection.c \
|
|---|
| 85 | kmkbuiltin/kbuild_version.c
|
|---|
| 86 |
|
|---|
| 87 | kmk_redirect_SOURCES = kmkbuiltin/redirect.c
|
|---|
| 88 |
|
|---|
| 89 | EXTRA_kmk_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
|
|---|
| 90 |
|
|---|
| 91 | noinst_HEADERS = commands.h dep.h filedef.h job.h make.h rule.h variable.h \
|
|---|
| 92 | debug.h getopt.h gettext.h hash.h
|
|---|
| 93 |
|
|---|
| 94 | #kmk_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@
|
|---|
| 95 | kmk_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@
|
|---|
| 96 | # Only process if target is MS-Windows
|
|---|
| 97 | if WINDOWSENV
|
|---|
| 98 | kmk_LDADD += $(W32LIB)
|
|---|
| 99 | endif
|
|---|
| 100 |
|
|---|
| 101 | man_MANS = make.1
|
|---|
| 102 |
|
|---|
| 103 | # org - DEFS = -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" @DEFS@
|
|---|
| 104 | DEFS = \
|
|---|
| 105 | -DNO_ARCHIVES \
|
|---|
| 106 | -DEXPERIMENTAL \
|
|---|
| 107 | -DCONFIG_WITH_TOUPPER_TOLOWER \
|
|---|
| 108 | -DCONFIG_WITH_DEFINED \
|
|---|
| 109 | -DCONFIG_WITH_EXPLICIT_MULTITARGET \
|
|---|
| 110 | -DCONFIG_WITH_PREPEND_ASSIGNMENT \
|
|---|
| 111 | -DCONFIG_WITH_LOCAL_VARIABLES \
|
|---|
| 112 | -DCONFIG_WITH_2ND_TARGET_EXPANSION \
|
|---|
| 113 | -DCONFIG_WITH_ALLOC_CACHES \
|
|---|
| 114 | -DCONFIG_WITH_STRCACHE2 \
|
|---|
| 115 | \
|
|---|
| 116 | -DKMK \
|
|---|
| 117 | -DKMK_HELPERS \
|
|---|
| 118 | -DCONFIG_NO_DEFAULT_SUFFIXES \
|
|---|
| 119 | -DCONFIG_NO_DEFAULT_PATTERN_RULES \
|
|---|
| 120 | -DCONFIG_NO_DEFAULT_TERMINAL_RULES \
|
|---|
| 121 | -DCONFIG_NO_DEFAULT_SUFFIX_RULES \
|
|---|
| 122 | -DCONFIG_NO_DEFAULT_VARIABLES \
|
|---|
| 123 | -DCONFIG_WITH_EXTENDED_NOTPARALLEL \
|
|---|
| 124 | -DCONFIG_WITH_INCLUDEDEP \
|
|---|
| 125 | -DCONFIG_WITH_VALUE_LENGTH \
|
|---|
| 126 | -DCONFIG_WITH_RSORT \
|
|---|
| 127 | -DCONFIG_WITH_ABSPATHEX \
|
|---|
| 128 | -DCONFIG_WITH_COMPARE \
|
|---|
| 129 | -DCONFIG_WITH_STACK \
|
|---|
| 130 | -DCONFIG_WITH_MATH \
|
|---|
| 131 | -DCONFIG_WITH_XARGS \
|
|---|
| 132 | -DCONFIG_WITH_NANOTS \
|
|---|
| 133 | -DCONFIG_WITH_SET_CONDITIONALS \
|
|---|
| 134 | -DCONFIG_WITH_IF_CONDITIONALS \
|
|---|
| 135 | -DCONFIG_WITH_DATE \
|
|---|
| 136 | -DCONFIG_WITH_FILE_SIZE \
|
|---|
| 137 | -DCONFIG_WITH_WHICH \
|
|---|
| 138 | -DCONFIG_WITH_EVALPLUS \
|
|---|
| 139 | -DCONFIG_WITH_MINIMAL_STATS \
|
|---|
| 140 | -DCONFIG_WITH_COMMANDS_FUNC \
|
|---|
| 141 | -DCONFIG_PRETTY_COMMAND_PRINTING \
|
|---|
| 142 | -DCONFIG_WITH_PRINT_STATS_SWITCH \
|
|---|
| 143 | -DCONFIG_WITH_RDONLY_VARIABLE_VALUE \
|
|---|
| 144 | -DCONFIG_WITH_LAZY_DEP_LISTS \
|
|---|
| 145 | \
|
|---|
| 146 | -DKBUILD_TYPE=\"$(KBUILD_TYPE)\" \
|
|---|
| 147 | -DKBUILD_HOST=\"$(KBUILD_TARGET)\" \
|
|---|
| 148 | -DKBUILD_HOST_ARCH=\"$(KBUILD_TARGET_ARCH)\" \
|
|---|
| 149 | -DKBUILD_HOST_CPU=\"$(KBUILD_TARGET_CPU)\" \
|
|---|
| 150 | \
|
|---|
| 151 | -DKBUILD_SVN_REV=1 \
|
|---|
| 152 | -DKBUILD_VERSION_MAJOR=0 \
|
|---|
| 153 | -DKBUILD_VERSION_MINOR=1 \
|
|---|
| 154 | -DKBUILD_VERSION_PATCH=4 \
|
|---|
| 155 | \
|
|---|
| 156 | -DCONFIG_WITH_KMK_BUILTIN \
|
|---|
| 157 | @DEFS@
|
|---|
| 158 |
|
|---|
| 159 | AM_CPPFLAGS = $(GLOBINC) -I$(srcdir)/../lib
|
|---|
| 160 | # Only process if target is MS-Windows
|
|---|
| 161 | if WINDOWSENV
|
|---|
| 162 | AM_CPPFLAGS += $(W32INC)
|
|---|
| 163 | endif
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 | # Extra stuff to include in the distribution.
|
|---|
| 167 |
|
|---|
| 168 | EXTRA_DIST = README build.sh.in $(man_MANS) \
|
|---|
| 169 | README.customs README.OS2 \
|
|---|
| 170 | SCOPTIONS SMakefile \
|
|---|
| 171 | README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h \
|
|---|
| 172 | README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
|
|---|
| 173 | README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat \
|
|---|
| 174 | make_msvc_net2003.sln make_msvc_net2003.vcproj \
|
|---|
| 175 | readme.vms makefile.vms makefile.com config.h-vms \
|
|---|
| 176 | vmsdir.h vmsfunctions.c vmsify.c
|
|---|
| 177 |
|
|---|
| 178 | # This is built during configure, but behind configure's back
|
|---|
| 179 |
|
|---|
| 180 | DISTCLEANFILES = build.sh
|
|---|
| 181 |
|
|---|
| 182 | # Forward targets
|
|---|
| 183 |
|
|---|
| 184 | html:
|
|---|
| 185 | cd doc && $(MAKE) $(AM_MAKEFLAGS) $@
|
|---|
| 186 |
|
|---|
| 187 | .PHONY: html
|
|---|
| 188 |
|
|---|
| 189 | # --------------- Internationalization Section
|
|---|
| 190 |
|
|---|
| 191 | localedir = $(datadir)/locale
|
|---|
| 192 |
|
|---|
| 193 | # --------------- Local INSTALL Section
|
|---|
| 194 |
|
|---|
| 195 | # If necessary, change the gid of the app and turn on the setgid flag.
|
|---|
| 196 | #
|
|---|
| 197 |
|
|---|
| 198 | # Whether or not make needs to be installed setgid.
|
|---|
| 199 | # The value should be either `true' or `false'.
|
|---|
| 200 | # On many systems, the getloadavg function (used to implement the `-l'
|
|---|
| 201 | # switch) will not work unless make is installed setgid kmem.
|
|---|
| 202 | #
|
|---|
| 203 | inst_setgid = @NEED_SETGID@
|
|---|
| 204 |
|
|---|
| 205 | # Install make setgid to this group so it can get the load average.
|
|---|
| 206 | #
|
|---|
| 207 | inst_group = @KMEM_GROUP@
|
|---|
| 208 |
|
|---|
| 209 | install-exec-local:
|
|---|
| 210 | @if $(inst_setgid); then \
|
|---|
| 211 | app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
|
|---|
| 212 | if chgrp $(inst_group) $$app && chmod g+s $$app; then \
|
|---|
| 213 | echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
|
|---|
| 214 | else \
|
|---|
| 215 | echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
|
|---|
| 216 | echo "otherwise the \`-l' option will probably not work."; \
|
|---|
| 217 | echo "You may need special privileges to complete the installation"; \
|
|---|
| 218 | echo "of $$app."; \
|
|---|
| 219 | fi; \
|
|---|
| 220 | else true; fi
|
|---|
| 221 |
|
|---|
| 222 | # --------------- Local DIST Section
|
|---|
| 223 |
|
|---|
| 224 | # Install the w32 and tests subdirectories
|
|---|
| 225 | #
|
|---|
| 226 | dist-hook:
|
|---|
| 227 | (cd $(srcdir); \
|
|---|
| 228 | sub=`find w32 tests -follow \( -name CVS -prune -o -name .cvsignore -o -name work -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
|
|---|
| 229 | tar chf - $$sub) \
|
|---|
| 230 | | (cd $(distdir); tar xfBp -)
|
|---|
| 231 |
|
|---|
| 232 |
|
|---|
| 233 | # --------------- Local CHECK Section
|
|---|
| 234 |
|
|---|
| 235 | check-local: check-regression check-loadavg
|
|---|
| 236 | @banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
|
|---|
| 237 | dashes=`echo "$$banner" | sed s/./=/g`; \
|
|---|
| 238 | echo; \
|
|---|
| 239 | echo "$$dashes"; \
|
|---|
| 240 | echo "$$banner"; \
|
|---|
| 241 | echo "$$dashes"; \
|
|---|
| 242 | echo
|
|---|
| 243 |
|
|---|
| 244 | .PHONY: check-loadavg check-regression
|
|---|
| 245 |
|
|---|
| 246 | check-loadavg: loadavg$(EXEEXT)
|
|---|
| 247 | @echo The system uptime program believes the load average to be:
|
|---|
| 248 | -uptime
|
|---|
| 249 | @echo The GNU load average checking code thinks:
|
|---|
| 250 | -./loadavg$(EXEEXT)
|
|---|
| 251 |
|
|---|
| 252 | # The loadavg function is invoked during "make check" to test getloadavg.
|
|---|
| 253 | check_PROGRAMS = loadavg
|
|---|
| 254 | nodist_loadavg_SOURCES = getloadavg.c
|
|---|
| 255 | loadavg_CPPFLAGS = -DTEST
|
|---|
| 256 | loadavg_LDADD = @GETLOADAVG_LIBS@
|
|---|
| 257 |
|
|---|
| 258 | # > check-regression
|
|---|
| 259 | #
|
|---|
| 260 | # Look for the make test suite, and run it if found and we can find perl.
|
|---|
| 261 | # If we're building outside the tree, we use symlinks to make a local copy of
|
|---|
| 262 | # the test suite. Unfortunately the test suite itself isn't localizable yet.
|
|---|
| 263 | #
|
|---|
| 264 | MAKETESTFLAGS =
|
|---|
| 265 |
|
|---|
| 266 | check-regression:
|
|---|
| 267 | @if test -f "$(srcdir)/tests/run_make_tests"; then \
|
|---|
| 268 | if $(PERL) -v >/dev/null 2>&1; then \
|
|---|
| 269 | case `cd $(srcdir); pwd` in `pwd`) : ;; \
|
|---|
| 270 | *) test -d tests || mkdir tests; \
|
|---|
| 271 | rm -f srctests; \
|
|---|
| 272 | if ln -s "$(srcdir)/tests" srctests; then \
|
|---|
| 273 | for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
|
|---|
| 274 | rm -f tests/$$f; ln -s ../srctests/$$f tests; \
|
|---|
| 275 | done; fi ;; \
|
|---|
| 276 | esac; \
|
|---|
| 277 | echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
|
|---|
| 278 | cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS); \
|
|---|
| 279 | else \
|
|---|
| 280 | echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
|---|
| 281 | fi; \
|
|---|
| 282 | else \
|
|---|
| 283 | echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
|
|---|
| 284 | fi
|
|---|
| 285 |
|
|---|
| 286 |
|
|---|
| 287 | # --------------- Maintainer's Section
|
|---|
| 288 |
|
|---|
| 289 | # Tell automake that I haven't forgotten about this file and it will be
|
|---|
| 290 | # created before we build a distribution (see maintMakefile in the CVS
|
|---|
| 291 | # distribution).
|
|---|
| 292 |
|
|---|
| 293 | README:
|
|---|
| 294 |
|
|---|
| 295 | @MAINT_MAKEFILE@
|
|---|