####################################################################################### # 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 -P-> 2 # 2 -U-> 0 # 1 -U-> 0 # to implement such a workflow, C puts a lock (state 1) and U removes it (state 0) ############################### # a few git shortcuts uv:update_version update_version: rm -f lutin/src/version.ml make lutin/src/version.ml cp _oasis _oasis.save cat _oasis.save | sed "s/^Version:.*/Version: $(VERSION)/" > _oasis rm -f committed git add lutin/src/version.ml _oasis make clean && make cia: test man cia-no-test cia-no-test: test -f committed && \ echo "*** I won't commit!\n*** until you 'make update_version'!" \ || (git commit -a -F log && touch committed) push: opam-test git push && make uv amend: test -f committed && git commit -a -F log --amend dif: git --no-pager diff --color-words diff:dodiff echo "il y a $(shell grep "+" diff.diff | wc -l) + et $(shell grep "-" diff.diff | wc -l) -" dodiff: git diff HEAD -w > diff.diff # diff of the lastly commited change cdiff: git diff -w "HEAD^" HEAD > diff.diff ############################### # tags OTAGS=otags # otags don't manage to parse gnuplotRif.ml NO_TAGS=gnuplotRif.ml tags: $(OTAGS) -v $(shell ocamlc -where)/*.mli $(shell ls src/*.ml | grep -v $(NO_TAGS)) ############################### # opam-ing NAME=lutin 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 $(PACKNAME).tgz: git archive --prefix=$(PACKNAME)/ -o $(PACKNAME).tgz HEAD $(WWW)/pool/$(PACKNAME).tgz: $(PACKNAME).tgz cp $^ $@ $(WWWTEST)/pool/$(PACKNAME).tgz: $(PACKNAME).tgz cp $^ $@ OPAM_FILE=$(shell find $(WWW)/opam-repository/packages -name opam | grep Lutin | sort | tail -1 | sed -e 's/^./\U&/') OPAM_FILE_TEST=$(shell find $(WWWTEST)/opam-repository/packages -name opam | grep Lutin | sort | tail -1 | sed -e 's/^./\U&/') OPAM_DIR=$(shell dirname $(OPAM_FILE)) OFFICIAL_OPAM_DIR=/home/jahier/local/opam-repository/packages/lutin x: echo $(OPAM_FILE) echo $(OPAM_FILE_TEST) i: opam-installer Lutin.install --prefix=$(OPAM_DIR) opam : $(WWW)/pool/$(PACKNAME).tgz cd $(WWW)/opam-repository/packages && \ oasis2opam $(HTTP)/pool/$(PACKNAME).tgz && \ cp ~/lurette/opam $(OPAM_FILE) && \ cd .. ; opam-admin check && opam-admin make -g && \ cp -rf $(OPAM_DIR) $(OFFICIAL_OPAM_DIR) opam-test : $(WWWTEST)/pool/$(PACKNAME).tgz cd $(WWWTEST)/opam-repository/packages && \ oasis2opam $(HTTPTEST)/pool/$(PACKNAME).tgz && \ opam-installer Lutin.install --prefix=$(OPAM_DIR) && \ cd .. ; opam-admin check && opam-admin make -g # xxxcp ~/lurette/opam $(OPAM_FILE_TEST) && \ opam-pr: cp -rf $(OPAM_DIR) /home/jahier/local/opam-repository/packages/lutin/ .PHONY:install $(WWW)/pool/$(PACKNAME).tgz $(WWWTEST)/pool/$(PACKNAME).tgz oi:install or:reinstall ob:build oc:clean clean: ocaml setup.ml -clean rm -f setup.data cd polka; make clean cd lutin-utils/src/ ; make clean