1 # Makefile - POSIX Makefile for TopGit
2 # Copyright (C) 2017 Kyle J. McKay
6 # Makefile drives the process
7 # Makefile.sh provides POSIX sh support
8 # Makefile.mak does the actual building
9 # Makefile.mt always exists and is always empty (i.e. zero length)
13 # Anything explicitly listed here will always avoid a bogus "up to date" result
15 all clean tg awk hooks helpers doc html \
16 precheck TG-BUILD-SETTINGS \
17 install install-doc install-html \
18 tg--awksome tg-tg.txt topgit.html \
19 shell_compatibility_test \
20 bin-wrappers
/tg bin-wrapper
/pre-commit \
24 __default_target__
: __file_which_should_not_exist
25 +@set
-- && set
-ae
&& MAKE
="$(MAKE)" && . .
/Makefile.sh
&& $(MAKE
) -e
-f Makefile.mak
28 +@set
-- "$@" && set
-ae
&& MAKE
="$(MAKE)" && . .
/Makefile.sh
&& $(MAKE
) -e
-f Makefile.mak
"$@"
30 target
: __file_which_should_not_exist
31 +@set
-- $(TARGET
) && set
-ae
&& MAKE
="$(MAKE)" && . .
/Makefile.sh
&& $(MAKE
) -e
-f Makefile.mak
$(TARGET
)
33 __any_target__
$(TARGETS
): __file_which_should_not_exist
34 +@set
-- "$@" && set
-ae
&& MAKE
="$(MAKE)" && . .
/Makefile.sh
&& $(MAKE
) -e
-f Makefile.mak
"$@"
36 # Very important rule to avoid "accidents" caused by Makefile.sh's existence
37 # Some ridiculous "make" implementations will always implicitly "make Makefile"
38 # even though .POSIX: has been specified and that's definitely NOT POSIX!
44 # Clean out the standard six single suffix inference rules
45 # Except for .sh (because it would then elicit a redefiniton warning)
46 .SUFFIXES
: .c .sh .f .c˜ .sh˜ .f˜
53 .SUFFIXES
: .sh .awk .txt .html
55 # These are imperfect because they don't really reflect the correct dependencies
56 # Running the default "make" or "make all" will always get it right, but when
57 # trying to make a specific target, these will often avoid the "up to date"
58 # output that would otherwise occur for existing files with no dependencies
60 +@set
-- "$@" && set
-ae
&& MAKE
="$(MAKE)" && . .
/Makefile.sh
&& $(MAKE
) -e
-f Makefile.mak
"$@"
62 +@set
-- "$@" && set
-ae
&& MAKE
="$(MAKE)" && . .
/Makefile.sh
&& $(MAKE
) -e
-f Makefile.mak
"$@"
64 +@set
-- "$@" && set
-ae
&& MAKE
="$(MAKE)" && . .
/Makefile.sh
&& $(MAKE
) -e
-f Makefile.mak
"$@"
66 +@set
-- "$@" && set
-ae
&& MAKE
="$(MAKE)" && . .
/Makefile.sh
&& $(MAKE
) -e
-f Makefile.mak
"$@"
68 # This "phony" target must have at least one command otherwise it will not
69 # actually run anything and so will not actually trigger the rules that depend
70 # on it to run either. By using "true" instead of ":" "makes" that
71 # short-circuit directly to execvp should be able to run "true" directly.
72 __file_which_should_not_exist
: