1 ### Remove GNU make implicit rules
3 ## This speeds things up since we don't need to look for and stat() a
4 ## "foo.c,v" every time a rule referring to "foo.c" is in play. See
5 ## "make -p -f/dev/null | grep ^%::'".
12 ## Likewise delete default $(SUFFIXES). See:
14 ## info make --index-search=.SUFFIXES
17 ### Flags affecting all rules
19 # A GNU make extension since gmake 3.72 (released in late 1994) to
20 # remove the target of rules if commands in those rules fail. The
21 # default is to only do that if make itself receives a signal. Affects
24 # info make --index-search=.DELETE_ON_ERROR
29 ## comma, empty, space: handy variables as these tokens are either
30 ## special or can be hard to spot among other Makefile syntax.
33 space
:= $(empty
) $(empty
)
37 QUIET_SUBDIR0
= +$(MAKE
) -C
# space to separate -C and subdir
40 ifneq ($(findstring w
,$(firstword -$(MAKEFLAGS
))),w
)
41 PRINT_DIR
= --no-print-directory
46 ifneq ($(findstring s
,$(firstword -$(MAKEFLAGS
))),s
)
49 QUIET_SUBDIR0
= +@subdir
=
50 QUIET_SUBDIR1
= ;$(NO_SUBDIR
) echo
' ' SUBDIR
$$subdir; \
51 $(MAKE
) $(PRINT_DIR
) -C
$$subdir
54 QUIET_GEN
= @echo
' ' GEN
$@
;
56 QUIET_MKDIR_P_PARENT
= @echo
' ' MKDIR
-p
$(@D
);
59 QUIET_CC
= @echo
' ' CC
$@
;
60 QUIET_AR
= @echo
' ' AR
$@
;
61 QUIET_LINK
= @echo
' ' LINK
$@
;
62 QUIET_BUILT_IN
= @echo
' ' BUILTIN
$@
;
63 QUIET_CP
= @echo
' ' CP
$< $@
;
64 QUIET_LNCP
= @echo
' ' LN
/CP
$@
;
65 QUIET_XGETTEXT
= @echo
' ' XGETTEXT
$@
;
66 QUIET_MSGINIT
= @echo
' ' MSGINIT
$@
;
67 QUIET_MSGFMT
= @echo
' ' MSGFMT
$@
;
68 QUIET_MSGMERGE
= @echo
' ' MSGMERGE
$@
;
69 QUIET_GCOV
= @echo
' ' GCOV
$@
;
70 QUIET_SP
= @echo
' ' SP
$<;
71 QUIET_HDR
= @echo
' ' HDR
$(<:hcc
=h
);
72 QUIET_RC
= @echo
' ' RC
$@
;
74 ## Used in "Makefile": SPATCH
75 QUIET_SPATCH
= @echo
' ' SPATCH
$< \
>$@
;
76 QUIET_SPATCH_TEST
= @echo
' ' SPATCH TEST
$(@
:.build
/%=%);
77 QUIET_SPATCH_CAT
= @echo
' ' SPATCH CAT
$(@
:%.patch
=%.d
/)\
*\
*.patch \
>$@
;
79 ## Used in "Documentation/Makefile"
80 QUIET_ASCIIDOC
= @echo
' ' ASCIIDOC
$@
;
81 QUIET_XMLTO
= @echo
' ' XMLTO
$@
;
82 QUIET_DB2TEXI
= @echo
' ' DB2TEXI
$@
;
83 QUIET_MAKEINFO
= @echo
' ' MAKEINFO
$@
;
84 QUIET_DBLATEX
= @echo
' ' DBLATEX
$@
;
85 QUIET_XSLTPROC
= @echo
' ' XSLTPROC
$@
;
86 QUIET_GEN
= @echo
' ' GEN
$@
;
87 QUIET_STDERR
= 2> /dev
/null
89 QUIET_LINT_GITLINK
= @echo
' ' LINT GITLINK
$<;
90 QUIET_LINT_MANSEC
= @echo
' ' LINT MAN SEC
$<;
91 QUIET_LINT_MANEND
= @echo
' ' LINT MAN END
$<;
99 ## mkdir_p_parent: lazily "mkdir -p" the path needed for a $@
100 ## file. Uses $(wildcard) to avoid the "mkdir -p" if it's not
103 ## Is racy, but in a good way; we might redundantly (and safely)
104 ## "mkdir -p" when running in parallel, but won't need to exhaustively create
105 ## individual rules for "a" -> "prefix" -> "dir" -> "file" if given a
106 ## "a/prefix/dir/file". This can instead be inserted at the start of
107 ## the "a/prefix/dir/file" rule.
108 define mkdir_p_parent_template
109 $(if
$(wildcard $(@D
)),,$(QUIET_MKDIR_P_PARENT
)$(shell mkdir
-p
$(@D
)))
112 ## Getting sick of writing -L$(SOMELIBDIR) $(CC_LD_DYNPATH)$(SOMELIBDIR)?
113 ## Write $(call libpath_template,$(SOMELIBDIR)) instead, perhaps?
114 ## With CC_LD_DYNPATH set to either an empty string or to "-L", the
115 ## the directory is not shown the second time.
116 define libpath_template
117 -L
$(1) $(if
$(filter-out -L
,$(CC_LD_DYNPATH
)),$(CC_LD_DYNPATH
)$(1))