tg-migrate-bases.sh: become POSIX compliant
[topgit/pro.git] / Makefile
blob2094e41dee18310040be85d5a438b0070107e178
1 # Makefile - POSIX Makefile for TopGit
2 # Copyright (C) 2017 Kyle J. McKay
3 # All rights reserved
4 # License GPL2
7 ## THIS IS NOT THE MAKEFILE YOU ARE LOOKING FOR!
8 ##
9 ## You likely want Makefile.mak (docs are in there)
11 ## NOTE: Makefile.sh feeds variables into Makefile.mak
12 ## You might want to look there too
14 ## Makefile drives the process
15 ## Makefile.sh provides POSIX sh support
16 ## Makefile.mak does the actual building
17 ## Makefile.mt always exists and is always empty (i.e. zero length)
20 .POSIX:
22 # Anything explicitly listed here will always avoid a bogus "up to date" result
23 TARGETS = \
24 all clean tg awk hooks helpers doc html \
25 precheck TG-BUILD-SETTINGS settings \
26 install install-doc install-html \
27 tg--awksome tg-tg.txt topgit.html \
28 shell_compatibility_test \
29 bin-wrappers/tg bin-wrapper/pre-commit \
30 test \
31 #TARGETS
33 __default_target__: __file_which_should_not_exist
34 +@set -- && set -ae && MAKE="$(MAKE)" && . ./Makefile.sh && $(MAKE) $${GNO_PD_OPT} -e -f Makefile.mak
36 .DEFAULT:
37 +@set -- "$@" && set -ae && MAKE="$(MAKE)" && . ./Makefile.sh && $(MAKE) $${GNO_PD_OPT} -e -f Makefile.mak "$$@"
39 target: __file_which_should_not_exist
40 +@set -- $(TARGET) && set -ae && MAKE="$(MAKE)" && . ./Makefile.sh && $(MAKE) $${GNO_PD_OPT} -e -f Makefile.mak "$$@"
42 __any_target__ $(TARGETS): __file_which_should_not_exist
43 +@set -- "$@" && set -ae && MAKE="$(MAKE)" && . ./Makefile.sh && $(MAKE) $${GNO_PD_OPT} -e -f Makefile.mak "$$@"
45 # Very important rule to avoid "accidents" caused by Makefile.sh's existence
46 # Some ridiculous "make" implementations will always implicitly "make Makefile"
47 # even though .POSIX: has been specified and that's definitely NOT POSIX!
48 Makefile:
49 @true
51 .PRECIOUS:
53 # Clean out the standard six single suffix inference rules
54 # Except for .sh (because it would then elicit a redefiniton warning)
55 .SUFFIXES:
56 .SUFFIXES: .c .sh .f .c˜ .sh˜ .f˜
57 .c:;
58 .f:;
59 #.sh:;
60 .c~:;
61 .f~:;
62 .sh~:;
63 .SUFFIXES:
64 .SUFFIXES: .sh .awk .txt .html
66 # These are imperfect because they don't really reflect the correct dependencies
67 # Running the default "make" or "make all" will always get it right, but when
68 # trying to make a specific target, these will often avoid the "up to date"
69 # output that would otherwise occur for existing files with no dependencies
70 .sh:
71 +@set -- "$@" && set -ae && MAKE="$(MAKE)" && . ./Makefile.sh && $(MAKE) $${GNO_PD_OPT} -e -f Makefile.mak "$$@"
72 .awk:
73 +@set -- "$@" && set -ae && MAKE="$(MAKE)" && . ./Makefile.sh && $(MAKE) $${GNO_PD_OPT} -e -f Makefile.mak "$$@"
74 .sh.txt:
75 +@set -- "$@" && set -ae && MAKE="$(MAKE)" && . ./Makefile.sh && $(MAKE) $${GNO_PD_OPT} -e -f Makefile.mak "$$@"
76 .sh.html:
77 +@set -- "$@" && set -ae && MAKE="$(MAKE)" && . ./Makefile.sh && $(MAKE) $${GNO_PD_OPT} -e -f Makefile.mak "$$@"
79 # This "phony" target must have at least one command otherwise it will not
80 # actually run anything and so will not actually trigger the rules that depend
81 # on it to run either. By using "true" instead of ":" "makes" that
82 # short-circuit directly to execvp should be able to run "true" directly.
83 __file_which_should_not_exist:
84 -@true