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

Pascal Raymond's avatar
Pascal Raymond committed
all: doit

OBJDIR=./obj$(HOSTTYPE)
SRCDIR=./src

LN=ln -s
$(OBJDIR)/% : $(SRCDIR)/%
	rm -f $@; cd $(OBJDIR) && $(LN) ../$(SRCDIR)/$* . 

$(OBJDIR):
	mkdir $(OBJDIR)

OCAMLMAKEFILE = ./OCamlMakefile
RESULT=$(OBJDIR)/lus2lic$(EXE)

LIBS = str unix

OCAMLC=ocamlc
OCAMLOPT=ocamlopt

ifeq ($(HOSTTYPE),cross-win32)
  OCAMLC=/usr/i586-mingw32msvc/bin/ocamlc
  OCAMLOPT=/usr/i586-mingw32msvc/bin/ocamlopt
  OCAMLDEP=/usr/i586-mingw32msvc/bin/ocamldep
  OCAMLRUN=/usr/i586-mingw32msvc/bin/ocamlrun
  OCAMLLIB = `/usr/i586-mingw32msvc/bin/ocamlc -where`
endif

ifeq ($(HOSTTYPE),cygwin)
CFLAGS=-mno-cygwin
endif

SOURCES =  \
	$(OBJDIR)/version.ml \
	$(OBJDIR)/verbose.mli \
	$(OBJDIR)/verbose.ml \
	$(OBJDIR)/filenameExtras.mli \
	$(OBJDIR)/filenameExtras.ml \
	$(OBJDIR)/global.ml \
	$(OBJDIR)/ident.mli \
	$(OBJDIR)/ident.ml \
	$(OBJDIR)/lxm.mli \
	$(OBJDIR)/lxm.ml \
	$(OBJDIR)/errors.ml \
	$(OBJDIR)/astPredef.ml \
	$(OBJDIR)/astCore.ml \
	$(OBJDIR)/astV6.ml \
	$(OBJDIR)/astV6Dump.mli \
	$(OBJDIR)/astV6Dump.ml \
	$(OBJDIR)/astRecognizePredef.mli \
	$(OBJDIR)/astRecognizePredef.ml \
Pascal Raymond's avatar
Pascal Raymond committed
	$(OBJDIR)/parserUtils.ml \
	$(OBJDIR)/parser.mly \
	$(OBJDIR)/lexer.mll \
	$(OBJDIR)/astInstanciateModel.mli \
	$(OBJDIR)/astInstanciateModel.ml \
	$(OBJDIR)/astTabSymbol.mli \
	$(OBJDIR)/astTabSymbol.ml \
	$(OBJDIR)/astTab.mli \
	$(OBJDIR)/astTab.ml \
	$(OBJDIR)/lic.ml \
	$(OBJDIR)/licName.mli \
	$(OBJDIR)/licName.ml \
Pascal Raymond's avatar
Pascal Raymond committed
	$(OBJDIR)/licDump.ml \
	$(OBJDIR)/licPrg.mli \
	$(OBJDIR)/licPrg.ml \
	$(OBJDIR)/uglyStuff.ml \
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)/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)/mainArgs.ml \
	$(OBJDIR)/mainArgs.mli \
Pascal Raymond's avatar
Pascal Raymond committed
	$(OBJDIR)/main.ml

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)/version.ml

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
	make nc

include $(OCAMLMAKEFILE)

# Specific rule (version)

.PRECIOUS: $(OBJDIR)/version.ml

$(OBJDIR)/version.ml: 
	echo "(** Automatically generated 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)">> $@
	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...
Pascal Raymond's avatar
Pascal Raymond committed
TESTDIR=./tests
Erwan Jahier's avatar
Erwan Jahier committed

.PHONY: diff test log

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   $(OBJDIR)/*.ml

Erwan Jahier's avatar
Erwan Jahier committed
log:
	rm -f lv6.log; git log > lv6.log

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

Clean:
	rm -rf $(OBJDIR)

Pascal Raymond's avatar
Pascal Raymond committed
test: clean all test_nc
Pascal Raymond's avatar
Pascal Raymond committed
	cd $(TESTDIR) ; make test_ec
Erwan Jahier's avatar
Erwan Jahier committed
test_lic:
Pascal Raymond's avatar
Pascal Raymond committed
	cd $(TESTDIR) ; make test_lic
Pascal Raymond's avatar
Pascal Raymond committed
	cd $(TESTDIR) ; make test_lv4
Pascal Raymond's avatar
Pascal Raymond committed
	cd $(TESTDIR) ; make utest
Erwan Jahier's avatar
Erwan Jahier committed
utest_lic:
Pascal Raymond's avatar
Pascal Raymond committed
	cd $(TESTDIR) ; make utest_lic
Pascal Raymond's avatar
Pascal Raymond committed
	cd $(TESTDIR) ; make utest_ec
Pascal Raymond's avatar
Pascal Raymond committed
	cd $(TESTDIR) ; make utest_lv4

Erwan Jahier's avatar
Erwan Jahier committed

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

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

	git commit -a -F log --amend  && rm -f $(OBJDIR)/version.ml

push:
	git push git+ssh://jahier@scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/git/lustre/lustre.git

xxx:
remote  add --track master origin  git+ssh://jahier@scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/git/lustre/lustre.git