X-Git-Url: http://git.hcoop.net/bpt/coccinelle.git/blobdiff_plain/993936c04d73e4c97d0dc0910dbbef5f2c684c15..d6ce1786f27a05efa53cabeca92fc8e744a4b239:/globals/Makefile diff --git a/globals/Makefile b/globals/Makefile index 6d325fe..af2432f 100644 --- a/globals/Makefile +++ b/globals/Makefile @@ -1,4 +1,6 @@ -# Copyright 2010, INRIA, University of Copenhagen +# Copyright 2012, INRIA +# Julia Lawall, Gilles Muller +# Copyright 2010-2011, INRIA, University of Copenhagen # Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix # Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen # Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix @@ -20,30 +22,32 @@ # Coccinelle under other licenses. - --include ../Makefile.config +ifneq ($(MAKECMDGOALS),distclean) +include ../Makefile.config +endif ############################################################################## # Variables ############################################################################## TARGET=globals -SRC= flag.ml config.ml iteration.ml regexp.ml +OCAMLCFLAGS ?= -g -dtypes +OPTFLAGS ?= -g + +SRC=config.ml flag.ml iteration.ml $(REGEXP_FILE) regexp.ml LIBS= -INCLUDEDIRS= ../commons $(PCREDIR) +INCLUDEDIRS= ../commons $(PCREDIR) ############################################################################## # Generic variables ############################################################################## INCLUDES=$(INCLUDEDIRS:%=-I %) - -OCAMLCFLAGS ?= -g -dtypes -OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES) -OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES) -OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES) -OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES) +OCAMLC_CMD=$(OCAMLC) -thread $(OCAMLCFLAGS) $(INCLUDES) +OCAMLOPT_CMD=$(OCAMLOPT) -thread $(OPTFLAGS) $(INCLUDES) +OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDES) +OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDES) OBJS= $(SRC:.ml=.cmo) OPTOBJS= $(SRC:.ml=.cmx) @@ -53,13 +57,14 @@ OPTOBJS= $(SRC:.ml=.cmx) ############################################################################## all: $(TARGET).cma -all.opt: $(TARGET).cmxa +all.opt: + @$(MAKE) $(TARGET).cmxa BUILD_OPT=yes $(TARGET).cma: $(LIBS) $(OBJS) - $(OCAMLC) -a -o $(TARGET).cma $(OBJS) + $(OCAMLC_CMD) -a -o $(TARGET).cma $(OBJS) $(TARGET).cmxa: $(LIBS:.cma=.cmxa) $(OPTOBJS) - $(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS) + $(OCAMLOPT_CMD) -a -o $(TARGET).cmxa $(OPTOBJS) ############################################################################## # Developer rules @@ -67,29 +72,30 @@ $(TARGET).cmxa: $(LIBS:.cma=.cmxa) $(OPTOBJS) .SUFFIXES: .ml .mli .cmo .cmi .cmx .ml.cmo: - $(OCAMLC) -c $< + $(OCAMLC_CMD) -c $< .mli.cmi: - $(OCAMLC) -c $< + $(OCAMLC_CMD) -c $< .ml.cmx: - $(OCAMLOPT) -c $< + $(OCAMLOPT_CMD) -c $< .ml.mldepend: - $(OCAMLC) -i $< + $(OCAMLC_CMD) -i $< -clean:: +clean: rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot rm -f *~ .*~ gmon.out #*# - -distclean:: rm -f .depend -beforedepend:: +distclean: clean -depend:: beforedepend - $(OCAMLDEP) *.mli *.ml > .depend +.PHONEY: depend +.depend depend: + $(OCAMLDEP_CMD) *.mli *.ml > .depend +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(MAKECMDGOALS),distclean) -include .depend +endif +endif - - - +include ../Makefile.common