1 # 'There's more than one passage here,' he whispered with an effort: it seemed
2 # hard to make his breath give any sound. `It's as orc-like a place as ever
6 ### The build commands and verbosity
8 # If we are verbose, we will show commands prefixed by $(Q) (which acts as
9 # @ in the non-verbose mode), and we will show the "real" cmds instead of
10 # their quiet versions (which are used in the non-verbose mode).
11 # Inspired by the Linux kernel build system.
22 # Show the command (quiet or non-quiet version based on the assignment
23 # just above) and then execute it.
24 ncmd = $(if $($(quiet)cmd_$(1)),echo $($(quiet)cmd_$(1)) &&) $(cmd_$(1))
25 cmd = @$(if $($(quiet)cmd_$(1)),echo $($(quiet)cmd_$(1)) &&) $(cmd_$(1))
26 mcmd = @$(if $($(mquiet)cmd_$(1)),echo $($(mquiet)cmd_$(1)) &&) $(cmd_$(1))
28 quiet_cmd_compile = '[CC] $<'
29 masq_cmd_compile = $(COMPILE) -c $<
30 cmd_compile = $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
32 quiet_cmd_archive = '[AR] $@'
33 cmd_archive = $(AR) r $@ $^
35 quiet_cmd_link = '[LINK] $@'
36 cmd_link = $(LINK) -o $@ $^ $(LIBS)
39 quiet_cmd_recmake = "[MAKE $$target] $$subdir"
40 cmd_recmake = $(MAKE) -C $$subdir $$target
44 ### Internal build rules
47 CFLAGS += $(CUSTOM_CFLAGS) $(XCFLAGS) $(INCLUDES) $(SYS_CFLAGS)
48 COMPILE = $(CC) $(CFLAGS)
49 LINK = $(CC) $(LDFLAGS) $(XLDFLAGS)
51 DEP_FILES_1 = $(foreach src,$(OBJS),.deps/$(src))
52 DEP_FILES = $(DEP_FILES_1:%.o=%.P)
54 DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
62 @-cp .deps/$(*F).pp .deps/$(*F).P; \
63 tr ' ' '\012' < .deps/$(*F).pp \
64 | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
74 .PHONY: all-recursive clean-recursive clean-profiles-recursive
75 all-recursive clean-recursive clean-profiled-recursive:
76 +@target=`echo $@ | sed s/-recursive//`; \
77 for subdir in $(SUBDIRS); do \
78 $(call ncmd,recmake) || exit 1; \