diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-01-27 12:58:25 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-01-27 12:58:25 +0100 |
commit | 11c930f71db58201994265b71a8f76187f1dbda1 (patch) | |
tree | b0f90a4d631b946e4cb3d3755e9da1e3198aee71 /Makefile | |
parent | 6076c500405b7759845496dce6d3b9e1dc619cca (diff) | |
download | app.sh-11c930f71db58201994265b71a8f76187f1dbda1.tar.gz app.sh-11c930f71db58201994265b71a8f76187f1dbda1.tar.bz2 app.sh-11c930f71db58201994265b71a8f76187f1dbda1.tar.xz app.sh-11c930f71db58201994265b71a8f76187f1dbda1.zip |
o Adding a common header to all scripts.
o Disabling un-used tests and apps for now.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -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 |