aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-05-15 20:55:06 +0200
committerLoïc Hoguin <[email protected]>2017-05-15 21:37:08 +0200
commit0305622f259c11258cc9d56fa46af28d2206bd43 (patch)
tree84d17c6ac8b8a55455acae1f14a9e9463e823fed /Makefile
parent9292409f21393ec539cdf40720d26b43914f6018 (diff)
downloaderlang.mk-0305622f259c11258cc9d56fa46af28d2206bd43.tar.gz
erlang.mk-0305622f259c11258cc9d56fa46af28d2206bd43.tar.bz2
erlang.mk-0305622f259c11258cc9d56fa46af28d2206bd43.zip
Add tweaks and tests for the WITHOUT feature
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 6d6ff23..1580445 100644
--- a/Makefile
+++ b/Makefile
@@ -15,15 +15,16 @@
WITHOUT ?=
BUILD_CONFIG_FILE ?= $(CURDIR)/build.config
-ifeq ($(WITHOUT),)
+
+ifeq ($(strip $(WITHOUT)),)
BUILD_CONFIG = $(shell sed "s/\#.*//" $(BUILD_CONFIG_FILE))
else
empty := $(subst ,, )
-BUILD_EXCLUDE = "^$(subst $(empty),\|^,$(WITHOUT))"
-BUILD_CONFIG = $(shell sed "s/\#.*//" $(BUILD_CONFIG_FILE)|grep -v $(BUILD_EXCLUDE))
+BUILD_CONFIG = $(shell sed "s/\#.*//" $(BUILD_CONFIG_FILE) \
+ | grep -v "^$(subst $(empty),\|^,$(WITHOUT))")
endif
-ERLANG_MK = erlang.mk
+ERLANG_MK ?= erlang.mk
ERLANG_MK_VERSION = $(shell git describe --tags --dirty)
.PHONY: all check
@@ -31,8 +32,8 @@ ERLANG_MK_VERSION = $(shell git describe --tags --dirty)
all:
export LC_COLLATE=C; \
awk 'FNR==1 && NR!=1{print ""}1' $(patsubst %,%.mk,$(BUILD_CONFIG)) \
- | sed 's/^ERLANG_MK_VERSION = .*/ERLANG_MK_VERSION = $(ERLANG_MK_VERSION)/' \
- | sed 's:^ERLANG_MK_WITHOUT = .*:ERLANG_MK_WITHOUT = $(WITHOUT):' > $(ERLANG_MK)
+ | sed 's/^ERLANG_MK_VERSION =.*/ERLANG_MK_VERSION = $(ERLANG_MK_VERSION)/' \
+ | sed 's:^ERLANG_MK_WITHOUT =.*:ERLANG_MK_WITHOUT = $(WITHOUT):' > $(ERLANG_MK)
ifdef p
# Remove p from the list of variables since that conflicts with bootstrapping.