tg-annihilate.sh: autostash and support --stash and --no-stash
[topgit/pro.git] / Makefile
blob43b21230adb5641e70a88ce41608b276aed01c70
1 # Makefile - POSIX Makefile for TopGit
2 # Copyright (C) 2017 Kyle J. McKay
3 # All rights reserved
4 # License GPL2
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)
11 .POSIX:
13 # Anything explicitly listed here will always avoid a bogus "up to date" result
14 TARGETS = \
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 \
21 test \
22 #TARGETS
24 __default_target__: __file_which_should_not_exist
25 +@set -- && set -ae && . ./Makefile.sh && $(MAKE) -f Makefile.mak
27 .DEFAULT:
28 +@set -- "$@" && set -ae && . ./Makefile.sh && $(MAKE) -f Makefile.mak "$@"
30 __any_target__ $(TARGETS): __file_which_should_not_exist
31 +@set -- "$@" && set -ae && . ./Makefile.sh && $(MAKE) -f Makefile.mak "$@"
33 # Very important rule to avoid "accidents" caused by Makefile.sh's existence
34 # Some ridiculous "make" implementations will always implicitly "make Makefile"
35 # even though .POSIX: has been specified and that's definately NOT POSIX!
36 Makefile:
37 @true
39 .PRECIOUS:
41 # Clean out the standard six single suffix inference rules
42 # Except for .sh (because it would then elicit a redefiniton warning)
43 .SUFFIXES: .c .sh .f .c˜ .sh˜ .f˜
44 .c:;
45 .f:;
46 #.sh:;
47 .c~:;
48 .f~:;
49 .sh~:;
50 .SUFFIXES: .sh .awk .txt .html
52 # These are imperfect because they don't really reflect the correct dependencies
53 # Running the default "make" or "make all" will always get it right, but when
54 # trying to make a specific target, these will often avoid the "up to date"
55 # output that would otherwise occur for existing files with no dependencies
56 .sh:
57 +@set -- "$@" && set -ae && . ./Makefile.sh && $(MAKE) -f Makefile.mak "$@"
58 .awk:
59 +@set -- "$@" && set -ae && . ./Makefile.sh && $(MAKE) -f Makefile.mak "$@"
60 .sh.txt:
61 +@set -- "$@" && set -ae && . ./Makefile.sh && $(MAKE) -f Makefile.mak "$@"
62 .sh.html:
63 +@set -- "$@" && set -ae && . ./Makefile.sh && $(MAKE) -f Makefile.mak "$@"
65 # This "phony" target must have at least one command otherwise it will not
66 # actually run anything and so will not actually trigger the rules that depend
67 # on it to run either. By using "true" instead of ":" "makes" that
68 # short-circuit directly to execvp should be able to run "true" directly.
69 __file_which_should_not_exist:
70 -@true