Skip to content
Snippets Groups Projects
Makefile.version 773 B
Newer Older

# can oasis do all this stuff?
SHA:=`git log -1 --pretty=format:"%h"`
COMMIT_NB:=`git log --pretty=oneline  | wc -l`

# until the git repo is created
SHA:=0
COMMIT_NB:=0



VERSION:=1.0.$(COMMIT_NB)

del_version:
	rm -f lutils/src/lutilsVersion.ml

gen_version: del_version src/lutilsVersion.ml

src/lutilsVersion.ml:
	echo "let str=\"$(VERSION)\"" > src/lutilsVersion.ml ; \
	echo "let sha=\"$(SHA)\"" >> src/lutilsVersion.ml ; \
	rm -f version.tex ; \
	date +VERSION_DATE=%d-%m-%y > version.tex ; \
	echo "\\\newcommand{\\\version}{$(VERSION)}" > doc/version.tex ; \
	echo "\\\newcommand{\\\sha}{$(SHA)}" >> doc/version.tex ; \
	echo "\\\newcommand{\\\versionname}{none}" >> doc/version.tex ; \
	echo "\\\newcommand{\\\versiondate}{`date +%d-%m-%y`}" >> doc/version.tex