Newer
Older
#######################################################################################
# TEST, NON REGR. ETC...
TESTDIR=./test
test_nc:
cd $(TESTDIR) ; make test ; cd $(curdir)
test:
cd $(TESTDIR) ; make ; make time
cd $(curdir)
make clean_test
clean_test:
rm -f test/tmp2/*.cm* test/tmp1/*.cm*
rm -f test/tmp2/*.o test/tmp1/*.o
qtest:
cd $(TESTDIR) ; make test ; make time
cd $(curdir)
#######################################################################################
#
README.md: README.txt
cat $< | grep -v "^(\*" > $@
#######################################################################################
# git entry points
#######################################################################################
# Workflow:
# C=git commit ; A=git amend ; U=update_version ; P=opam pack
# - to make sure the sha and the version are good, one should never
# do U and then A.
# - to make sure gtit is not confused, one should never do A and the P
#
# thereforeto avoid such problems, legal trace are defined by this automata:
# 0 -C-> 1
# 1 -A-> 1
# 1 -U-> 0
# to implement such a workflow, C puts a lock (state 1) and U removes it (state 0)
uv:update_version
update_version:
rm -f src/lv6version.ml
make src/lv6version.ml
cp _oasis _oasis.save
cat _oasis.save | sed "s/^Version:.*/Version: $(VERSION)/" > _oasis
rm committed
git add _oasis
git add src/lv6version.ml
make clean && make
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
test -f committed && \
echo "*** I won't commit!\n*** until you 'make update_version'!" \
|| (git commit -a -F log && touch committed) && echo "Hint: 'make ci' to test the CI before doing 'make 'push'"
amend:
test -f committed && git commit -a -F log --amend
###############################
# opam-ing
NAME=lustre-v6
Erwan Jahier
committed
PACKNAME=$(NAME).$(PRE_VERSION)
WWW=/import/www/DIST-TOOLS/SYNCHRONE
HTTP=http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE
# for testing opam packages before publishing
WWWTEST=/import/www/DIST-TOOLS/SYNCHRONE/test
HTTPTEST=http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/test
Erwan Jahier
committed
OPAM_FILE=$(shell find $(WWW)/opam-repository/packages -name opam | grep lustre | sort | tail -1 | sed -e 's/^./\U&/')
OPAM_FILE_TEST=$(shell find $(WWW)/test/opam-repository/packages -name opam | grep lustre | sort | tail -1 | sed -e 's/^./\U&/')
Erwan Jahier
committed
OPAM_DIR=$(shell dirname $(OPAM_FILE))
OFFICIAL_OPAM_DIR=/home/jahier/local/opam-repository/packages/lustre-v6
$(PACKNAME).tgz:
git archive --prefix=$(PACKNAME)/ -o $(PACKNAME).tgz HEAD
$(WWW)/pool/$(PACKNAME).tgz: $(PACKNAME).tgz
$(WWWTEST)/pool/$(PACKNAME).tgz: $(PACKNAME).tgz
cp $^ $@
opam : $(WWW)/pool/$(PACKNAME).tgz
cd $(WWW)/opam-repository/packages && \
oasis2opam $(HTTP)/pool/$(PACKNAME).tgz && \
Erwan Jahier
committed
cp ~/lus2lic/opam $(OPAM_FILE) && \
cd .. ; opam-admin check && opam-admin make -g \
Erwan Jahier
committed
) || echo "*** I won't make an opam package\n*** until you commit something!" && \
echo 'post-messages: ["A more up-to-date version can be obtained from (opam repo add) http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/opam-repository/ "]' >> $(OPAM_FILE) && \
cp -rf $(OPAM_DIR) $(OFFICIAL_OPAM_DIR)
opam-test : $(WWWTEST)/pool/$(PACKNAME).tgz
[ "$(BRANCH)" = "master" ] && cd $(WWWTEST)/opam-repository/packages && \
oasis2opam $(HTTPTEST)/pool/$(PACKNAME).tgz && \
cp $(OPAM_FILE_TEST) $(PWD)/opam.oasis2opam && \
diff -u $(PWD)/opam.oasis2opam $(PWD)/opam | \
grep -v opam.oasis2opam > $(PWD)/opam.diff &&\
diff $(PWD)/opam.diff $(PWD)/opam.diff.exp && \
cp $(PWD)/opam $(OPAM_FILE_TEST) || \
(echo "The opam file needs some update"; exit 2) && \
cd .. ; opam-admin check && opam-admin make -g