Subversion Repositories pub

Compare Revisions

Ignore whitespace Rev 518 → Rev 519

/video-contact-sheet/branches/1.13/tests/GNUmakefile
1,25 → 1,37
# $Id$
 
VCS:=../vcs
extract=sed -n "/$*()"'/,/^}$$/p' "$(VCS)"
#VCS:=../portability/oldvcs/vcs-1.11.2
extract=sed -n "/^$*()"'/,/^}$$/p' "$(VCS)"
 
 
TESTS_FILE=src/tests.txt
TEST_MAKER=src/make_test.bash
get_interval_reqs = $(addprefix inc/, \
$(addsuffix .func.bash,get_interval trace error \
is_number tolower assert awkexf fptest \
fsimeq) \
$(addsuffix .inc.bash,constants) \
)
 
all: get_interval
 
constants.inc.bash:
sed -n '/{{{ # Constants/,/}}}/p' "$(VCS)" > $@
inc/constants.inc.bash: $(VCS)
mkdir -p inc/
echo 'declare -r RELEASE=0' > $@
echo 'declare DEBUG=1' >> $@
echo '$(shell grep -m1 'VERSION=' "$(VCS)")' >> $@
sed -n '/{{{ # Constants/,/}}}/p' "$(VCS)" >> $@
 
get_interval: $(addsuffix .func.bash,get_interval trace error is_number tolower) \
$(addsuffix .inc.bash,constants)
{ \
echo '#!/bin/bash' ; \
for req in $^; do \
echo "source $$req" ; \
done ; \
}
%.func.bash:
get_interval: $(TESTS_FILE) $(get_interval_reqs)
$(TEST_MAKER) $@ $(get_interval_reqs) > $@.test.bash
chmod +x $@.test.bash
 
inc/%.func.bash: $(VCS)
mkdir -p inc
$(extract) >$@
 
clean:
$(RM) *.func.bash *.inc.bash
$(RM) inc/* *.test.bash
-rmdir -p inc/