Skip to content
Snippets Groups Projects
Makefile 6.36 KiB
Newer Older
Erwan Jahier's avatar
Erwan Jahier committed

Pascal Raymond's avatar
Pascal Raymond committed
all: doit

include ./Makefile.common
Pascal Raymond's avatar
Pascal Raymond committed

COMON_SOURCES = \
	$(OBJDIR)/data.mli \
	$(OBJDIR)/data.ml \
	$(OBJDIR)/expr.ml \
	$(OBJDIR)/failure.ml \
	$(OBJDIR)/event.ml \
	$(OBJDIR)/genlex.mli \
	$(OBJDIR)/genlex.ml \
	$(OBJDIR)/rif_base.mli \
	$(OBJDIR)/rif_base.ml \
	$(OBJDIR)/verbose.ml \
	$(OBJDIR)/verbose.mli \


SOC_SOURCES = \
	$(OBJDIR)/soc.ml \
	$(OBJDIR)/socUtils.mli \
	$(OBJDIR)/socUtils.ml \
	$(OBJDIR)/socPredef.mli \
	$(OBJDIR)/socPredef.ml \
	$(OBJDIR)/toposort.mli \
	$(OBJDIR)/toposort.ml \
	$(OBJDIR)/actionsDeps.mli \
	$(OBJDIR)/actionsDeps.ml \
	$(OBJDIR)/lic2soc.mli \
	$(OBJDIR)/lic2soc.ml \
	$(OBJDIR)/socExecValue.mli \
	$(OBJDIR)/socExecValue.ml \
	$(OBJDIR)/socExecEvalPredef.mli \
	$(OBJDIR)/socExecEvalPredef.ml \
	$(OBJDIR)/socExec.mli \
	$(OBJDIR)/socExec.ml
	$(OBJDIR)/lv6util.ml \
Pascal Raymond's avatar
Pascal Raymond committed
	$(OBJDIR)/filenameExtras.mli \
	$(OBJDIR)/filenameExtras.ml \
	$(OBJDIR)/lv6MainArgs.ml \
	$(OBJDIR)/lv6MainArgs.mli \
Pascal Raymond's avatar
Pascal Raymond committed
	$(OBJDIR)/ident.mli \
	$(OBJDIR)/ident.ml \
	$(OBJDIR)/lxm.mli \
	$(OBJDIR)/lxm.ml \
	$(OBJDIR)/lv6errors.ml \
	$(OBJDIR)/astPredef.ml \
	$(OBJDIR)/astCore.ml \
	$(OBJDIR)/astV6.ml \
	$(OBJDIR)/astV6Dump.mli \
	$(OBJDIR)/astV6Dump.ml \
	$(OBJDIR)/astRecognizePredef.mli \
	$(OBJDIR)/astRecognizePredef.ml \
	$(OBJDIR)/lv6parserUtils.ml \
	$(OBJDIR)/lv6parser.mly \
	$(OBJDIR)/lv6lexer.mll \
	$(OBJDIR)/astInstanciateModel.mli \
	$(OBJDIR)/astInstanciateModel.ml \
	$(OBJDIR)/astTabSymbol.mli \
	$(OBJDIR)/astTabSymbol.ml \
	$(OBJDIR)/astTab.mli \
	$(OBJDIR)/astTab.ml \
	$(OBJDIR)/lic.ml \
	$(OBJDIR)/idSolver.ml \
	$(OBJDIR)/licName.mli \
	$(OBJDIR)/licName.ml \
Pascal Raymond's avatar
Pascal Raymond committed
	$(OBJDIR)/licDump.ml \
	$(OBJDIR)/licPrg.mli \
	$(OBJDIR)/licPrg.ml \
	$(SOC_SOURCES) \
Pascal Raymond's avatar
Pascal Raymond committed
	$(OBJDIR)/unifyType.mli \
	$(OBJDIR)/unifyType.ml \
	$(OBJDIR)/unifyClock.mli \
	$(OBJDIR)/unifyClock.ml \
	$(OBJDIR)/licEvalType.mli \
	$(OBJDIR)/licEvalType.ml \
	$(OBJDIR)/licEvalConst.mli \
	$(OBJDIR)/licEvalConst.ml \
	$(OBJDIR)/licEvalClock.mli \
	$(OBJDIR)/licEvalClock.ml \
Pascal Raymond's avatar
Pascal Raymond committed
	$(OBJDIR)/evalConst.mli \
	$(OBJDIR)/evalConst.ml \
	$(OBJDIR)/evalType.mli \
	$(OBJDIR)/evalType.ml \
	$(OBJDIR)/evalClock.mli \
	$(OBJDIR)/evalClock.ml \
	$(OBJDIR)/licMetaOp.mli \
	$(OBJDIR)/licMetaOp.ml \
	$(OBJDIR)/ast2lic.mli \
	$(OBJDIR)/ast2lic.ml \
	$(OBJDIR)/misc.ml \
	$(OBJDIR)/l2lCheckLoops.mli \
	$(OBJDIR)/l2lCheckLoops.ml \
	$(OBJDIR)/l2lCheckOutputs.mli \
	$(OBJDIR)/l2lCheckOutputs.ml \
	$(OBJDIR)/l2lExpandArrays.mli \
	$(OBJDIR)/l2lExpandArrays.ml \
	$(OBJDIR)/l2lExpandNodes.mli \
	$(OBJDIR)/l2lExpandNodes.ml \
	$(OBJDIR)/l2lExpandMetaOp.ml \
	$(OBJDIR)/l2lExpandMetaOp.mli \
	$(OBJDIR)/l2lRmPoly.mli \
	$(OBJDIR)/l2lRmPoly.ml \
	$(OBJDIR)/l2lAliasType.mli \
	$(OBJDIR)/l2lAliasType.ml \
	$(OBJDIR)/l2lSplit.mli \
	$(OBJDIR)/l2lSplit.ml \
	$(OBJDIR)/licTab.ml \
	$(OBJDIR)/licTab.mli \
Pascal Raymond's avatar
Pascal Raymond committed
	$(OBJDIR)/compile.ml \
	$(OBJDIR)/lv6version.ml \
	$(COMON_SOURCES) \
Pascal Raymond's avatar
Pascal Raymond committed
	$(OBJDIR)/main.ml

	$(OBJDIR)/lv6version.ml \
	$(COMPILER_SOURCES)
Pascal Raymond's avatar
Pascal Raymond committed
# Be sure to build those files before doing something else
# since they are needed by $(RESULT)
PRE_TARGETS=$(OBJDIR)/lv6version.ml
Pascal Raymond's avatar
Pascal Raymond committed

NOMLI_SOURCES=$(filter %.ml %.mll %.mly, $(SOURCES))

NOMLY_SOURCES=$(SOURCES:.mly=.ml)
MLONLY_SOURCES=$(NOMLY_SOURCES:.mll=.ml)

dot:
	ocamldoc -I  $(OBJDIR) $(MLONLY_SOURCES) -d ocamldoc -dot -dot-reduce
	dot -Tpdf ocamldoc.out > lus2lic.pdf
	ocamldoc -I  $(OBJDIR) $(MLONLY_SOURCES) -d ocamldoc -dot -dot-reduce -dot-types
	dot -Tpdf ocamldoc.out > lus2lic-types.pdf
	xpdf lus2lic.pdf
	xpdf lus2lic-types.pdf

html:
	ocamldoc -I  $(OBJDIR) $(MLONLY_SOURCES) -d ocamldoc -html -keep-code

nomli:
	rm $(OBJDIR)/*.mli

debug: nomli dc
Pascal Raymond's avatar
Pascal Raymond committed

ln: $(OBJDIR) $(SOURCES)

doit: ln nc
Pascal Raymond's avatar
Pascal Raymond committed

include $(OCAMLMAKEFILE)

# Specific rule (lv6version)
Pascal Raymond's avatar
Pascal Raymond committed

.PRECIOUS: $(OBJDIR)/lv6version.ml
Pascal Raymond's avatar
Pascal Raymond committed

$(OBJDIR)/lv6version.ml: Makefile
	echo "(** Automatically gen	erated from Makefile *) " > $@
Pascal Raymond's avatar
Pascal Raymond committed
	echo "let tool = \"lus2lic\"" >> $@
	echo "let branch = \"$(shell utils/get_branch_name)\"" >> $@
	echo "let commit = \"$(shell utils/get_commit_number)\"" >> $@
	echo "let sha_1 = \"$(shell utils/get_sha_1)"\">> $@
	echo "let str = (branch ^ \".\" ^ commit ^ \" (\" ^ sha_1 ^ \")\")">> $@
	echo "let maintainer = \"jahier@imag.fr\"">> $@

Pascal Raymond's avatar
Pascal Raymond committed
	make all
	make test

Pascal Raymond's avatar
Pascal Raymond committed
# TEST, NON REGR. ETC...
Erwan Jahier's avatar
Erwan Jahier committed

.PHONY: diff test log
Erwan Jahier's avatar
Erwan Jahier committed

diff:
	rm -f diff_lv6.diff; git diff --ignore-all-space > diff_lv6.diff ; ls -l diff_lv6.diff
Erwan Jahier's avatar
Erwan Jahier committed

OTAGS=$(HOME)/bin/otags
tags:
	$(OTAGS) -v $(shell $(OCAMLC) -where)/*.mli   src/*.ml
Erwan Jahier's avatar
Erwan Jahier committed
log:
	rm -f lv6.log; git log > lv6.log

	cd $(TESTDIR) ; make test ; cd $(curdir)
Pascal Raymond's avatar
Pascal Raymond committed

Clean:
	rm -rf $(OBJDIR)

Pascal Raymond's avatar
Pascal Raymond committed

Erwan Jahier's avatar
Erwan Jahier committed

ci: $(OBJDIR)/lv6version.ml
	make test && git commit -F log && rm -f $(OBJDIR)/lv6version.ml
Erwan Jahier's avatar
Erwan Jahier committed

cia: $(OBJDIR)/lv6version.ml
	git commit -a -F log && rm -f $(OBJDIR)/lv6version.ml
Erwan Jahier's avatar
Erwan Jahier committed

	git commit -a -F log --amend  && rm -f $(OBJDIR)/lv6version.ml
	git push git+ssh://jahier@scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/git/lustre/lus2lic.git
pull:
	git pull git+ssh://jahier@scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/git/lustre/lus2lic.git

	chmod u+w ../lurette/source/lus2lic/*
	cp $(LDBG_SOURCES) ../lurette/source/lus2lic/
	chmod u-w ../lurette/source/lus2lic/*

# Keep those files in sync as they are shared
# and prevent their modification
cp_comon_file:
	chmod u+w src/data.ml 
	chmod u+w src/data.mli 
	chmod u+w src/rif_base.ml 
	chmod u+w src/rif_base.mli 
	chmod u+w src/genlex.ml 
	chmod u+w src/genlex.mli 
	chmod u+w src/verbose.ml 
	chmod u+w src/verbose.mli 
	chmod u+w src/expr.ml 
	chmod u+w src/event.ml 
	chmod u+w src/failure.ml 
	cp ~/lurette/source/common/data.ml src/
	cp ~/lurette/source/common/data.mli src/
	cp ~/lurette/source/common/rif_base.ml src/
	cp ~/lurette/source/common/rif_base.mli src/
	cp ~/lurette/source/common/genlex.ml src/
	cp ~/lurette/source/common/genlex.mli src/
	cp ~/lurette/source/Lutin/verbose.ml src/
	cp ~/lurette/source/Lutin/verbose.mli src/
	cp ~/lurette/source/Lurettetop/expr.ml src/
	cp ~/lurette/source/Lurettetop/event.ml src/
	cp ~/lurette/source/Lurettetop/failure.ml src/
	chmod u-w src/data.ml 
	chmod u-w src/data.mli 
	chmod u-w src/rif_base.ml 
	chmod u-w src/rif_base.mli 
	chmod u-w src/genlex.ml 
	chmod u-w src/genlex.mli 
	chmod u-w src/verbose.ml 
	chmod u-w src/verbose.mli 
	chmod u-w src/expr.ml 
	chmod u-w src/event.ml 
	chmod u-w src/failure.ml