update-all-config.pl: add nice progress indicator
[girocco.git] / makefile
blob57186acdfb388e1840a150fd0fba34ad106826c7
1 # makefile -- redirect "make" command to version specific make
2 # Copyright (C) 2015 Kyle J. McKay. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are met:
7 # 1. Redistributions of source code must retain the above copyright notice,
8 # this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright notice,
11 # this list of conditions and the following disclaimer in the documentation
12 # and/or other materials provided with the distribution.
14 # 3. Neither the name of the copyright holder nor the names of its contributors
15 # may be used to endorse or promote products derived from this software
16 # without specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 # POSSIBILITY OF SUCH DAMAGE.
31 # Note that .POSIX must be the first non-comment line and
32 # also that the behavior of blank lines is unspecified
33 .POSIX:
35 # Set MAKEFILE__NAME to the version-specific file name that "make" would
36 # read instead of this file if the correct version of "make" had been run.
37 # For GNU make use "GNUmakefile" and for BSD make use "BSDmakefile".
38 # For kmk use either "Makefile.kmk" or "makefile.kmk"
39 MAKEFILE__NAME = GNUmakefile
41 # Set MAKE__COMMAND__NAME to the typical name of the version-specific "make"
42 # command that was intended to be run when it's not available as "make".
43 # For GNU make this is typically "gmake" and for BSD make typically "bsdmake".
44 # For kmk this should be "kmk".
45 MAKE__COMMAND__NAME = gmake
47 # Note that when we run $(MAKE__COMMAND__NAME) we do not need to pass on any
48 # "make" options as a POSIX "make" will have put them in MAKEFLAGS for us
49 # and $(MAKE__COMMAND__NAME) will pick them up from there.
51 # In case any of the other targets are not recognized as special, the default
52 # target must be the first target and it depends on a file that should not exist
53 # just in case .PHONY is not supported by the "make" that's reading this file.
54 # This rule will be used if no targets are specified on the command line. We
55 # must not name it "all" because we do not pass the target name on in this case
56 # -- that is handled by the .DEFAULT rule.
57 __makefile_compatibility_wrapper__: __file_which_should_not_exist
58 +@test -r "$(MAKEFILE__NAME)" || \
59 { echo error: missing $(MAKEFILE__NAME); exit 1; }
60 +@$(MAKE__COMMAND__NAME)
62 # Turn off parallel mode on "make"s that support it
63 # Other "makes" will treat these as normal rules
64 .NOTPARALLEL:
65 .NO_PARALLEL:
67 # Ensure that there are no built-in rules to interfere
68 # with using our .DEFAULT rule
69 .SUFFIXES:
71 # This rule will be used if any targets are specified
72 .DEFAULT:
73 +@test -r "$(MAKEFILE__NAME)" || \
74 { echo error: missing $(MAKEFILE__NAME); exit 1; }
75 +@$(MAKE__COMMAND__NAME) $@
76 # This rule shouldn't be necessary but some makes are broken
77 install: __file_which_should_not_exist
78 +@test -r "$(MAKEFILE__NAME)" || \
79 { echo error: missing $(MAKEFILE__NAME); exit 1; }
80 +@$(MAKE__COMMAND__NAME) install
82 # Mark "__file_which_should_not_exist" as a phony target
83 # for "make"s which support phony targets
84 .PHONY: __file_which_should_not_exist
86 # In case .PHONY is not supported we need an explicit
87 # rule for this to make sure the .DEFAULT rule is not used
88 # and we end it with ; to make it clear it has no commands
89 __file_which_should_not_exist: ;