You need to sign in or sign up before continuing.
common.mk 539 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
# common bits for building and reporting parts

# somewhat reusable
BUILD_LOG = build.log

# link it to BUILDDIR if possible
SYMLINK = build

# brevity postprocessor; not exported, for toplevel use only
10
SHORTEN = $(shell FILTER=; \
11
	if [ -s "$(SYMLINK)" ]; then \
12 13 14 15 16 17 18 19 20 21
		FILTER=" -e 's,$(BUILDDIR),$(SYMLINK),'"; \
	fi; \
	if [ -n "$$TMP" ]; then \
		FILTER="$$FILTER -e 's,$$TMP,\$$TMP,'"; \
	fi; \
	if [ -n "$$HOME" ]; then \
		FILTER="$$FILTER -e 's,$$HOME,~,'"; \
	fi; \
	if [ -n "$$FILTER" ]; then \
		echo -n "| sed $$FILTER"; \
22 23
	fi; \
)