| 1 |
# This file is part of Coccinelle, licensed under the terms of the GPL v2. |
| 2 |
# See copyright.txt in the Coccinelle source code for more information. |
| 3 |
# The Coccinelle source code can be obtained at http://coccinelle.lip6.fr |
| 4 |
|
| 5 |
ifneq ($(MAKECMDGOALS),distclean) |
| 6 |
include ../Makefile.config |
| 7 |
-include ../Makefile.local |
| 8 |
endif |
| 9 |
|
| 10 |
OCAMLCFLAGS ?= -g |
| 11 |
OPTFLAGS ?= -g |
| 12 |
|
| 13 |
SYSLIBS = str.cma unix.cma bigarray.cma |
| 14 |
|
| 15 |
INCLUDE=-I ../commons -I ../extra -I ../parsing_c |
| 16 |
LIBS=../commons/commons.cma ../globals/globals.cma \ |
| 17 |
../parsing_c/parsing_c.cma ../extra/extra.cma |
| 18 |
|
| 19 |
OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDE) |
| 20 |
OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDE) |
| 21 |
OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDE) |
| 22 |
OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom $(INCLUDE) |
| 23 |
OCAMLYACC_CMD=$(OCAMLYACC) -v |
| 24 |
|
| 25 |
|
| 26 |
PROGS=spp gitgrep splitpatch extract_c_and_res \ |
| 27 |
gitsort alloc_free bridge \ |
| 28 |
process_isoprofile |
| 29 |
#generate_dependencies |
| 30 |
|
| 31 |
all: $(PROGS) |
| 32 |
|
| 33 |
all.opt: |
| 34 |
@$(MAKE) $(PROGS) BUILD_OPT=yes |
| 35 |
|
| 36 |
gitgrep: gitgrep.ml |
| 37 |
$(OCAMLOPT) -o gitgrep str.cmxa gitgrep.ml |
| 38 |
|
| 39 |
gitsort: gitsort.ml |
| 40 |
$(OCAMLOPT) -o gitsort str.cmxa gitsort.ml |
| 41 |
|
| 42 |
process_isoprofile: process_isoprofile.ml |
| 43 |
$(OCAMLC) -g -o process_isoprofile str.cma process_isoprofile.ml |
| 44 |
|
| 45 |
alloc_free: alloc_free.ml |
| 46 |
$(OCAMLOPT) -o alloc_free str.cmxa alloc_free.ml |
| 47 |
|
| 48 |
# more flexible version of alloc_free |
| 49 |
bridge: bridge.ml |
| 50 |
$(OCAMLOPT) -o bridge str.cmxa dumper.mli dumper.ml bridge.ml |
| 51 |
|
| 52 |
install_bridge: bridge |
| 53 |
cp -f bridge /usr/local/bin |
| 54 |
|
| 55 |
spp: spp.ml |
| 56 |
$(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+ |
| 57 |
|
| 58 |
splitpatch: splitpatch.cmo |
| 59 |
$(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $+ |
| 60 |
|
| 61 |
extract_c_and_res: extract_c_and_res.cmo |
| 62 |
$(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+ |
| 63 |
|
| 64 |
generate_dependencies: generate_dependencies.cmo |
| 65 |
$(OCAMLC_CMD) -o $@ $(SYSLIBS) $(INCLUDE) $(LIBS) $+ |
| 66 |
|
| 67 |
isoprof: process_isoprofile |
| 68 |
cp process_isoprofile isoprof |
| 69 |
|
| 70 |
|
| 71 |
.SUFFIXES: .ml .mli .cmo .cmi .cmx |
| 72 |
|
| 73 |
.ml.cmo: |
| 74 |
$(OCAMLC_CMD) -c $< |
| 75 |
.mli.cmi: |
| 76 |
$(OCAMLC_CMD) -c $< |
| 77 |
.ml.cmx: |
| 78 |
$(OCAMLOPT_CMD) -c $< |
| 79 |
|
| 80 |
clean:: |
| 81 |
rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot |
| 82 |
|
| 83 |
distclean: clean |
| 84 |
rm -f $(PROGS) isoprof |
| 85 |
rm -f .depend |
| 86 |
|
| 87 |
.PHONY: depend |
| 88 |
.depend depend: beforedepend |
| 89 |
ocamldep $(INCLUDE) *.mli *.ml > .depend |
| 90 |
|
| 91 |
ifneq ($(MAKECMDGOALS),clean) |
| 92 |
ifneq ($(MAKECMDGOALS),distclean) |
| 93 |
-include .depend |
| 94 |
endif |
| 95 |
endif |
| 96 |
|
| 97 |
include ../Makefile.common |