From 11c930f71db58201994265b71a8f76187f1dbda1 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 27 Jan 2013 12:58:25 +0100 Subject: o Adding a common header to all scripts. o Disabling un-used tests and apps for now. --- Makefile | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2019e13..a3e5e42 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,33 @@ all: test -BATS=$(patsubst test/%,%,$(wildcard test/*.bats)) +BINS=$(wildcard bin/app-*) $(wildcard libexec/app-*) + +BATS=$(sort $(patsubst test/%,%,$(filter-out test/X-%,$(wildcard test/*.bats)))) TESTS=$(addprefix bats-,$(BATS)) bats-%: @echo === test/$(patsubst bats-%,%,$@) @bats test/$(patsubst bats-%,%,$@) -test: $(TESTS) +show-tests: @echo BATS=$(BATS) @echo TESTS=$(TESTS) + @echo $(addprefix set_header-,$(BINS)) +test: show-tests $(TESTS) .PHONY: test + +define set_header +set_header-$(1): + @count=`wc -l lib/header|cut -f 1 -d ' '`; \ + cat lib/header > x; \ + echo "# HEADER END" >> x; \ + sed '1,/HEADER END/d' $(1) >> x; \ + if [ `md5sum $(1)|cut -f 1 -d ' '` != `md5sum x|cut -f 1 -d ' '` ]; then echo Updated: $(1); cp x $(1); fi; \ + rm x +endef + +$(foreach f,$(BINS),$(eval $(call set_header,$(f)))) +set-headers: $(addprefix set_header-,$(BINS)) + +.PHONY: set-headers -- cgit v1.2.3