summaryrefslogtreecommitdiff
path: root/GNUmakefile
blob: 0bb8100d40040021c9881ac0fd291230746f5a0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# This file is a hack to let us pass whatever flags we want to Make,
# since adjusting MAKEFLAGS at runtime only half-works.
#
# Most of the complexity is dancing around to avoid having any
# possibly conflicting identifiers.

# The flags that we actually want to pass to Make.
desired_MAKEFLAGS  = --no-builtin-rules
desired_MAKEFLAGS += --no-builtin-variables
desired_MAKEFLAGS += --warn-undefined-variables
# Setting GNUMAKEFLAGS is important so that --no-builtin-variables
# with --warn-undefined-variables doesn't cause Make (as of 4.4.1) to
# print spurious warnings about it being undefined for internal use.
desired_MAKEFLAGS += GNUMAKEFLAGS=''

# Quiet this parent Make a bit.
MAKEFLAGS += --no-print-directory

# Main.
rest = $(wordlist 2,$(words $1),$1)
target = $(or $(firstword $(MAKECMDGOALS)),default)
$(or $(call rest,$(MAKECMDGOALS)),_$(target)): $(target)
	@:
$(target):
	@$(MAKE) -f Makefile $(desired_MAKEFLAGS) $(MAKECMDGOALS)