aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorbenoitc <[email protected]>2016-04-03 23:46:20 +0200
committerLoïc Hoguin <[email protected]>2017-05-15 19:10:46 +0200
commit9292409f21393ec539cdf40720d26b43914f6018 (patch)
treedcac806b43259fed1067098c162ce77087bd55c6 /Makefile
parent724521b68c19f107437db9fa2ee8def6ff604e0a (diff)
downloaderlang.mk-9292409f21393ec539cdf40720d26b43914f6018.tar.gz
erlang.mk-9292409f21393ec539cdf40720d26b43914f6018.tar.bz2
erlang.mk-9292409f21393ec539cdf40720d26b43914f6018.zip
Add WITHOUT variable to exclude components on build
This allows to ignore lines from the default build.config if needed. For example to not include packages run make WITHOUT=index
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7c8d54b..6d6ff23 100644
--- a/Makefile
+++ b/Makefile
@@ -12,8 +12,16 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+WITHOUT ?=
+
BUILD_CONFIG_FILE ?= $(CURDIR)/build.config
+ifeq ($(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))
+endif
ERLANG_MK = erlang.mk
ERLANG_MK_VERSION = $(shell git describe --tags --dirty)
@@ -23,7 +31,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)/' > $(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.