1 # Copyright 2012, INRIA
2 # Julia Lawall, Gilles Muller
3 # Copyright 2010-2011, INRIA, University of Copenhagen
4 # Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
5 # Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
6 # Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
7 # This file is part of Coccinelle.
9 # Coccinelle is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, according to version 2 of the License.
13 # Coccinelle is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
21 # The authors reserve the right to distribute this or future versions of
22 # Coccinelle under other licenses.
25 #############################################################################
26 # Configuration section
27 #############################################################################
31 # 'distclean' does not require configure to have run, and should also
32 # clean all the bundled directories. Hence, a special case.
33 ifeq ($(MAKECMDGOALS
),distclean)
34 MAKELIBS
:=$(dir $(wildcard .
/bundles
/*/Makefile
))
36 ifneq ($(MAKECMDGOALS
),configure
)
37 -include Makefile.config
41 -include /etc
/lsb-release
42 -include Makefile.
override # local customizations, if any
43 -include /etc
/Makefile.coccinelle
# local customizations, if any
46 VERSION
=$(shell cat .
/version | tr
-d
'\n')
47 CCVERSION
=$(shell cat scripts
/coccicheck
/README | egrep
-o
'[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' | head
-n1
)
48 PKGVERSION
=$(shell dpkg-parsechangelog
-ldebian
/changelog.
$(DISTRIB_CODENAME
) 2> /dev
/null \
49 | sed
-n
's/^Version: \(.*\)/\1/p' )
51 ##############################################################################
53 ##############################################################################
57 SRC
=flag_cocci.ml cocci.ml testing.ml
test.ml
$(LEXER_SOURCES
:.mll
=.ml
) main.ml
59 ifeq ($(FEATURE_PYTHON
),1)
60 PYTHON_INSTALL_TARGET
=install-python
62 PYTHON_INSTALL_TARGET
=
65 SYSLIBS
=str.cma unix.cma bigarray.cma nums.cma
66 LIBS
=commons
/commons.cma \
69 parsing_cocci
/cocci_parser.cma parsing_c
/parsing_c.cma \
70 engine
/cocciengine.cma popl09
/popl.cma \
71 extra
/extra.cma python
/coccipython.cma ocaml
/cocciocaml.cma
73 MAKESUBDIRS
=$(MAKELIBS
) commons \
74 globals ctl parsing_cocci parsing_c \
75 engine popl09 extra python ocaml
77 CLEANSUBDIRS
=commons \
78 globals ctl parsing_cocci parsing_c \
79 engine popl09 extra python ocaml docs \
82 INCLUDEDIRSDEP
=commons commons
/ocamlextra \
84 parsing_cocci parsing_c engine popl09 extra python ocaml \
87 INCLUDEDIRS
=$(INCLUDEDIRSDEP
) $(PCREDIR
) $(INCLIBS
)
89 ##############################################################################
91 ##############################################################################
93 # sort to remove duplicates
94 INCLUDESET
=$(sort $(INCLUDEDIRS
))
95 INCLUDES
=$(INCLUDESET
:%=-I
%)
98 OPTOBJS
= $(SRC
:.ml
=.cmx
)
102 ##############################################################################
103 # Generic ocaml variables
104 ##############################################################################
106 OCAMLC_CMD
=$(OCAMLC
) $(OCAMLCFLAGS
) $(INCLUDES
)
107 OCAMLOPT_CMD
=$(OCAMLOPT
) $(OPTFLAGS
) $(INCLUDES
)
108 OCAMLYACC_CMD
=$(OCAMLYACC
) -v
109 OCAMLDEP_CMD
=$(OCAMLDEP
) $(INCLUDEDIRSDEP
:%=-I
%)
110 OCAMLMKTOP_CMD
=$(OCAMLMKTOP
) -g
-custom
$(INCLUDES
)
112 # these are unused at the moment (todo: remove)
113 EXTRA_CFLAGS
= # -static -pie -fpie -fPIE -static-libgcc
114 EXTRA_OCAML_CFLAGS
=$(EXTRA_CFLAGS
:%=-ccopt
%)
116 # 'make purebytecode' unsets this definition
117 BYTECODE_EXTRA
=-custom
$(EXTRA_OCAML_FLAGS
)
119 ##############################################################################
121 ##############################################################################
122 .PHONY
:: all all.opt byte opt top
clean distclean configure opt-compil
123 .PHONY
:: $(MAKESUBDIRS
:%=%.
all) $(MAKESUBDIRS
:%=%.opt
) subdirs.
all subdirs.opt
124 .PHONY
:: all-opt all-byte byte-only opt-only
125 .PHONY
:: copy-stubs install-stubs
install install-man install-python install-common
128 # All make targets that are expected to be an entry point have a dependency on
129 # 'Makefile.config' to ensure that if Makefile.config is not present, an error
130 # message is printed first before any other actions are executed.
131 # In addition, the targets that actually build something have a dependency on
132 # '.depend' and 'version.ml'.
134 # dispatches to either 'all-dev' or 'all-release'
137 $(MAKE
) $(TARGET_ALL
)
139 # make "all" comes in three flavours
140 world
: Makefile.config version.ml
141 @echo
"building both versions of spatch"
148 @echo
-e
"\tcoccinelle can now be installed via 'make install'"
150 # note: the 'all-dev' target excludes the documentation
151 all-dev
: Makefile.config version.ml
153 @echo
"building the unoptimized version of spatch"
157 @echo
-e
"\tcoccinelle can now be installed via 'make install'"
159 all-release
: Makefile.config version.ml
160 @echo building
$(TARGET_SPATCH
)
162 $(MAKE
) $(TARGET_SPATCH
)
166 @echo
-e
"\tcoccinelle can now be installed via 'make install'"
168 all.opt
: Makefile.config
173 # aliases for "byte" and "opt-compil"
174 opt opt-only
: Makefile.config opt-compil
175 byte-only
: Makefile.config byte
177 byte
: Makefile.config version.ml
181 @echo the compilation of
$(EXEC
) finished
182 @echo
$(EXEC
) can be installed or used
184 opt-compil
: Makefile.config version.ml
186 $(MAKE
) subdirs.opt BUILD_OPT
=yes
187 $(MAKE
) $(EXEC
).opt BUILD_OPT
=yes
188 @echo the compilation of
$(EXEC
).opt finished
189 @echo
$(EXEC
).opt can be installed or used
194 @
+for D in
$(MAKESUBDIRS
); do
$(MAKE
) $$D.
all || exit
1 ; done
197 @
+for D in
$(MAKESUBDIRS
); do
$(MAKE
) $$D.opt || exit
1 ; done
199 $(MAKESUBDIRS
:%=%.
all):
200 @
$(MAKE
) -C
$(@
:%.
all=%) all
202 $(MAKESUBDIRS
:%=%.opt
):
203 @
$(MAKE
) -C
$(@
:%.opt
=%) all.opt
209 # parsing_cocci: commons globals menhirLib
210 # parsing_c:parsing_cocci
211 # ctl:globals commonsg
212 # engine: parsing_cocci parsing_c ctl
214 # extra: parsing_cocci parsing_c ctl
216 # python:pycaml parsing_cocci parsing_c
218 clean:: Makefile.config
219 @set
-e
; for i in
$(CLEANSUBDIRS
); do
$(MAKE
) -C
$$i $@
; done
220 @
$(MAKE
) -C demos
/spp
$@
222 $(LIBS
): $(MAKESUBDIRS
:%=%.
all)
223 $(LIBS
:.cma
=.cmxa
): $(MAKESUBDIRS
:%=%.opt
)
224 $(LNKLIBS
) : $(MAKESUBDIRS
:%=%.
all)
225 $(LNKOPTLIBS
) : $(MAKESUBDIRS
:%=%.opt
)
228 $(OPTOBJS
):$(LIBS
:.cma
=.cmxa
)
230 $(EXEC
): $(LNKLIBS
) $(LIBS
) $(OBJS
)
231 $(OCAMLC_CMD
) $(BYTECODE_EXTRA
) $(FLAGSLIBS
) -o
$@
$(SYSLIBS
) $^
233 $(EXEC
).opt
: $(OPTLNKLIBS
) $(LIBS
:.cma
=.cmxa
) $(OPTOBJS
)
234 $(OCAMLOPT_CMD
) $(OPTFLAGSLIBS
) -o
$@
$(SYSLIBS
:.cma
=.cmxa
) $^
236 $(EXEC
).top
: $(LNKLIBS
) $(LIBS
) $(OBJS
)
237 $(OCAMLMKTOP_CMD
) -custom
-o
$@
$(SYSLIBS
) $(FLAGSLIBS
) $^
240 rm -f
$(TARGET
) $(TARGET
).opt
$(TARGET
).top
242 .PHONY
:: tools configure
245 .
/configure
$(CONFIGURE_FLAGS
)
247 # the dependencies on Makefile.config should give a hint to the programmer that
248 # configure should be run again
249 Makefile.config
: Makefile.config.in configure.ac
250 @echo
"Makefile.config needs to be (re)build. Run ./configure $(CONFIGURE_FLAGS) to generate it."
253 tools
: $(LIBS
) $(LNKLIBS
)
257 @if
[ -d tools
] ; then
$(MAKE
) -C tools
distclean ; fi
259 # it seems impossible to pass "-static" unless all dependent
260 # libraries are also available as static archives.
261 # set $(STATIC) to -static if you have such libraries.
263 rm -f spatch.opt spatch
264 $(MAKE
) $(STATIC
) opt-only
267 # creates a portable version of spatch, which, however, may
268 # be dependent on non-portably dynamic libraries. You
269 # may need the stubs, see 'copy-stubs'.
271 rm -f spatch.opt spatch
272 $(MAKE
) BYTECODE_EXTRA
="" byte-only
273 sed
-i
'1 s,^#!.*$$,#!/usr/bin/ocamlrun,g' spatch
275 # copies the stubs libraries (if any) to the root directory
277 @if
test -f .
/bundles
/pycaml
/dllpycaml_stubs.so
; then \
278 cp
-fv .
/bundles
/pycaml
/dllpycaml_stubs.so .
; fi
279 @if
test -f .
/bundles
/pcre
/dllpcre_stubs.so
; then \
280 cp
-fv .
/bundles
/pcre
/dllpcre_stubs.so .
; fi
282 ##############################################################################
283 # Build version information
284 ##############################################################################
287 @echo
"version.ml is missing. Run ./configure to generate it."
290 ##############################################################################
291 # Build documentation
292 ##############################################################################
296 @
$(MAKE
) -C docs ||
(echo
"warning: ignored the failed construction of the manual" 1>&2)
297 @if
test "x$(FEATURE_OCAML)" = x1
; then \
298 if
test -f .
/parsing_c
/ast_c.cmo
-o
-f .
/parsing_c
/ast_c.cmx
; then \
299 $(MAKE
) -C ocaml doc
; \
300 else echo
"note: to obtain coccilib documenation, it is required to build 'spatch' first so that ./parsing_c/ast_c.cm* gets build."; \
302 @echo
"finished building manuals"
304 clean:: Makefile.config
305 $(MAKE
) -C docs
clean
306 $(MAKE
) -C ocaml cleandoc
308 ##############################################################################
309 # Pre-Install (customization of spatch frontend script)
310 ##############################################################################
312 preinstall
: docs
/spatch
.1 scripts
/spatch scripts
/spatch.opt scripts
/spatch.byte
313 @echo
"generated the wrapper scripts for spatch (the frontends)"
315 docs
/spatch
.1: Makefile.config
316 $(MAKE
) -C docs spatch
.1
318 # user will use spatch to run spatch.opt (native)
319 scripts
/spatch
: Makefile.config scripts
/spatch.sh
320 cp scripts
/spatch.sh scripts
/spatch
321 chmod
+x scripts
/spatch
323 # user will use spatch to run spatch (bytecode)
324 scripts
/spatch.byte
: Makefile.config scripts
/spatch.sh
325 cp scripts
/spatch.sh scripts
/spatch.byte
326 chmod
+x scripts
/spatch.byte
328 # user will use spatch.opt to run spatch.opt (native)
329 scripts
/spatch.opt
: Makefile.config scripts
/spatch.sh
330 cp scripts
/spatch.sh scripts
/spatch.opt
331 chmod
+x scripts
/spatch.opt
334 rm -f scripts
/spatch scripts
/spatch.byte scripts
/spatch.opt
336 ##############################################################################
338 ##############################################################################
340 # don't remove DESTDIR, it can be set by package build system like ebuild
341 # for staged installation.
343 $(MKDIR_P
) $(DESTDIR
)$(BINDIR
)
344 $(MKDIR_P
) $(DESTDIR
)$(LIBDIR
)
345 $(MKDIR_P
) $(DESTDIR
)$(SHAREDIR
)/ocaml
346 $(MKDIR_P
) $(DESTDIR
)$(SHAREDIR
)/commons
347 $(MKDIR_P
) $(DESTDIR
)$(SHAREDIR
)/globals
348 $(MKDIR_P
) $(DESTDIR
)$(SHAREDIR
)/parsing_c
349 $(INSTALL_DATA
) standard.h
$(DESTDIR
)$(SHAREDIR
)
350 $(INSTALL_DATA
) standard.iso
$(DESTDIR
)$(SHAREDIR
)
351 $(INSTALL_DATA
) ocaml
/coccilib.cmi
$(DESTDIR
)$(SHAREDIR
)/ocaml
/
352 $(INSTALL_DATA
) parsing_c
/*.cmi
$(DESTDIR
)$(SHAREDIR
)/parsing_c
/
353 $(INSTALL_DATA
) commons
/*.cmi
$(DESTDIR
)$(SHAREDIR
)/commons
/
354 $(INSTALL_DATA
) globals
/iteration.cmi
$(DESTDIR
)$(SHAREDIR
)/globals
/
357 @echo
"Installing manuals in: ${DESTDIR}${MANDIR}"
358 $(MKDIR_P
) $(DESTDIR
)$(MANDIR
)/man1
359 $(MKDIR_P
) $(DESTDIR
)$(MANDIR
)/man3
360 $(INSTALL_DATA
) docs
/spatch
.1 $(DESTDIR
)$(MANDIR
)/man1
/
361 $(INSTALL_DATA
) docs
/Coccilib
.3cocci
$(DESTDIR
)$(MANDIR
)/man3
/
364 @echo
"Installing bash completion in: ${DESTDIR}${BASH_COMPLETION_DIR}"
365 $(MKDIR_P
) $(DESTDIR
)$(BASH_COMPLETION_DIR
)
366 $(INSTALL_DATA
) scripts
/spatch.bash_completion \
367 $(DESTDIR
)$(BASH_COMPLETION_DIR
)/spatch
370 @echo
"Installing tools in: ${DESTDIR}${BINDIR}"
371 $(MKDIR_P
) $(DESTDIR
)$(BINDIR
)
372 $(INSTALL_PROGRAM
) tools
/splitpatch \
373 $(DESTDIR
)$(BINDIR
)/splitpatch
374 $(INSTALL_PROGRAM
) tools
/cocci-send-email.perl \
375 $(DESTDIR
)$(BINDIR
)/cocci-send-email.perl
378 @echo
"Installing python support in: ${DESTDIR}${SHAREDIR}/python"
379 $(MKDIR_P
) $(DESTDIR
)$(SHAREDIR
)/python
/coccilib
/coccigui
380 $(INSTALL_DATA
) python
/coccilib
/*.py \
381 $(DESTDIR
)$(SHAREDIR
)/python
/coccilib
382 $(INSTALL_DATA
) python
/coccilib
/coccigui
/*.py \
383 $(DESTDIR
)$(SHAREDIR
)/python
/coccilib
/coccigui
384 $(INSTALL_DATA
) python
/coccilib
/coccigui
/pygui.glade \
385 $(DESTDIR
)$(SHAREDIR
)/python
/coccilib
/coccigui
386 $(INSTALL_DATA
) python
/coccilib
/coccigui
/pygui.gladep \
387 $(DESTDIR
)$(SHAREDIR
)/python
/coccilib
/coccigui
390 $(MKDIR_P
) $(DESTDIR
)$(SHAREDIR
)
391 @if
test -f .
/bundles
/pycaml
/dllpycaml_stubs.so
; then \
392 cp
-fv .
/bundles
/pycaml
/dllpycaml_stubs.so
$(DESTDIR
)$(SHAREDIR
); fi
393 @if
test -f .
/bundles
/pcre
/dllpcre_stubs.so
; then \
394 cp
-fv .
/bundles
/pcre
/dllpcre_stubs.so
$(DESTDIR
)$(SHAREDIR
); fi
396 install: install-man install-common install-stubs
$(PYTHON_INSTALL_TARGET
)
397 rm -f
$(DESTDIR
)$(SHAREDIR
)/spatch
398 rm -f
$(DESTDIR
)$(SHAREDIR
)/spatch.opt
399 @if
test -x spatch
-o
-x spatch.opt
; then \
400 $(MAKE
) install-def
;fi
401 @if
test -x spatch
; then \
402 $(MAKE
) install-byte
; fi
403 @if
test -x spatch.opt
; then \
404 $(MAKE
) install-opt
;fi
405 @if
test ! -x spatch
-a
! -x spatch.opt
; then \
406 echo
-e
"\n\n\t==> Run 'make', 'make opt', or both first. <==\n\n";fi
408 @echo
-e
"\tYou can also install spatch by copying the program spatch"
409 @echo
-e
"\t(available in this directory) anywhere you want and"
410 @echo
-e
"\tgive it the right options to find its configuration files."
414 # Installation of spatch and spatch.opt and their wrappers
417 # user will use spatch to run one of the binaries
419 $(INSTALL_PROGRAM
) scripts
/spatch
$(DESTDIR
)$(BINDIR
)/spatch
421 # user will use spatch.byte to run spatch (bytecode)
423 $(INSTALL_PROGRAM
) spatch
$(DESTDIR
)$(SHAREDIR
)
424 $(INSTALL_PROGRAM
) scripts
/spatch.byte
$(DESTDIR
)$(BINDIR
)/spatch.byte
426 # user will use spatch.opt to run spatch.opt (native)
428 $(INSTALL_PROGRAM
) spatch.opt
$(DESTDIR
)$(SHAREDIR
)
429 $(INSTALL_PROGRAM
) scripts
/spatch.opt
$(DESTDIR
)$(BINDIR
)/spatch.opt
432 rm -f
$(DESTDIR
)$(BINDIR
)/spatch
433 rm -f
$(DESTDIR
)$(BINDIR
)/spatch.opt
434 rm -f
$(DESTDIR
)$(BINDIR
)/spatch.byte
435 rm -f
$(DESTDIR
)$(SHAREDIR
)/dllpycaml_stubs.so
436 rm -f
$(DESTDIR
)$(SHAREDIR
)/dllpcre_stubs.so
437 rm -f
$(DESTDIR
)$(SHAREDIR
)/spatch
438 rm -f
$(DESTDIR
)$(SHAREDIR
)/spatch.opt
439 rm -f
$(DESTDIR
)$(SHAREDIR
)/standard.h
440 rm -f
$(DESTDIR
)$(SHAREDIR
)/standard.iso
441 rm -f
$(DESTDIR
)$(SHAREDIR
)/ocaml
/coccilib.cmi
442 rm -f
$(DESTDIR
)$(SHAREDIR
)/parsing_c
/*.cmi
443 rm -f
$(DESTDIR
)$(SHAREDIR
)/commons
/*.cmi
444 rm -f
$(DESTDIR
)$(SHAREDIR
)/globals
/*.cmi
445 rm -f
$(DESTDIR
)$(SHAREDIR
)/python
/coccilib
/coccigui
/*
446 rm -f
$(DESTDIR
)$(SHAREDIR
)/python
/coccilib
/*.py
447 rmdir
--ignore-fail-on-non-empty
-p \
448 $(DESTDIR
)$(SHAREDIR
)/python
/coccilib
/coccigui
449 rmdir
$(DESTDIR
)$(SHAREDIR
)/globals
450 rmdir
$(DESTDIR
)$(SHAREDIR
)/commons
451 rmdir
$(DESTDIR
)$(SHAREDIR
)/parsing_c
452 rmdir
$(DESTDIR
)$(SHAREDIR
)/ocaml
453 rmdir
$(DESTDIR
)$(SHAREDIR
)
454 rm -f
$(DESTDIR
)$(MANDIR
)/man1
/spatch
.1
455 rm -f
$(DESTDIR
)$(MANDIR
)/man3
/Coccilib
.3cocci
458 rm -f
$(DESTDIR
)$(BASH_COMPLETION_DIR
)/spatch
459 rmdir
--ignore-fail-on-non-empty
-p \
460 $(DESTDIR
)$(BASH_COMPLETION_DIR
)
463 rm -f
$(DESTDIR
)$(BINDIR
)/splitpatch
464 rm -f
$(DESTDIR
)$(BINDIR
)/cocci-send-email.perl
467 @echo
"spatch $(VERSION)"
468 @echo
"spatch $(PKGVERSION) ($(DISTRIB_ID))"
469 @echo
"coccicheck $(CCVERSION)"
472 ##############################################################################
473 # Deb package (for Ubuntu) and release rules
474 ##############################################################################
476 include Makefile.release
478 ##############################################################################
480 ##############################################################################
482 -include Makefile.dev
488 .
/$(TARGET
) -D standard.h
-parse_c
-dir tests
/
490 # the check target runs:
491 # * some feature tests (depending on what is enabled)
493 check: scripts
/spatch
494 @echo
"testing if spatch works on hello world..."
495 @COCCINELLE_HOME
="$$(pwd)" .
/scripts
/spatch
--sp-file demos
/hello
/hello-smpl.cocci demos
/hello
/helloworld.c
--very-quiet | grep
-q
'+ printf("world, hello!");'
496 @echo
"testing if spatch works with regexes..."
497 @COCCINELLE_HOME
="$$(pwd)" .
/scripts
/spatch
--sp-file demos
/hello
/hello-regexp.cocci demos
/hello
/helloworld.c
--very-quiet | grep
-q
'+ printf("world, hello!");'
498 @if
test "x${FEATURE_OCAML}" = x1
-a
-z
"${NO_OCAMLFIND}"; then \
499 echo
"testing if spatch works with ocaml scripts..."; \
500 COCCINELLE_HOME
="$$(pwd)" .
/scripts
/spatch
--sp-file demos
/hello
/hello-ocaml.cocci demos
/hello
/helloworld.c
--very-quiet | grep
-q
'Hello at: 2'; fi
501 @if
test "x${FEATURE_PYTHON}" = x1
; then \
502 echo
"testing if spatch works with python scripts..."; \
503 COCCINELLE_HOME
="$$(pwd)" .
/scripts
/spatch
--sp-file demos
/hello
/hello-python.cocci demos
/hello
/helloworld.c
--very-quiet | grep
-q
'Hello at: 2'; fi
504 @echo running the
test suite
505 COCCINELLE_HOME
="$$(pwd)" .
/scripts
/spatch
--testall
--no-update-score-file
507 # -inline 0 to see all the functions in the profile.
508 # Can also use the profile framework in commons/ and run your program
511 $(MAKE
) OPTFLAGS
="-p -inline 0 ${EXTRA_OCAML_FLAGS}" opt
514 rm -f gmon.out ocamlprof.dump
517 otags
-no-mli-tags
-r .
520 find .
-name
"*.ml" |grep
-v
"scripts" | xargs
$(OCAMLDEP
) -I commons
-I globals
-I ctl
-I parsing_cocci
-I parsing_c
-I engine
-I popl09
-I extra
> /tmp
/dependfull.depend
521 ocamldot
-lr
/tmp
/dependfull.depend
> /tmp
/dependfull.dot
522 dot
-Tps
/tmp
/dependfull.dot
> /tmp
/dependfull.ps
523 ps2pdf
/tmp
/dependfull.ps
/tmp
/dependfull.pdf
525 ##############################################################################
527 ##############################################################################
529 # each member of the project can have its own test.ml. this file is
532 echo
"let foo_ctl () = failwith \"there is no foo_ctl formula\"" \
535 ##############################################################################
536 # Generic ocaml rules
537 ##############################################################################
539 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
546 $(OCAMLOPT_CMD
) -c
$<
553 rm -f
*.cm
[iox
] *.o
*.annot
554 rm -f
*~ .
*~
*.exe
#*#
557 set
-e
; for i in
$(CLEANSUBDIRS
); do
$(MAKE
) -C
$$i $@
; done
559 rm -f TAGS
*.native
*.byte
*.d.native
*.p.byte
561 rm -f tests
/SCORE_actual.sexp tests
/SCORE_best_of_both.sexp
562 find .
-name
".#*1.*" | xargs
rm -f
563 rm -f
$(EXEC
) $(EXEC
).opt
$(EXEC
).top
565 # using 'touch' to prevent infinite recursion with 'make depend'
567 .depend
: Makefile.config
test.ml version
571 depend
: Makefile.config
test.ml version
572 @echo constructing
'.depend'
574 @set
-e
; for i in
$(MAKESUBDIRS
); do
$(MAKE
) -C
$$i depend
; done
575 $(OCAMLDEP_CMD
) *.mli
*.ml
> .depend
577 ##############################################################################
579 ##############################################################################
582 @echo
"cleaning configured files"
583 if
test -z
"${KEEP_CONFIG}"; then
rm -f Makefile.config
; fi
584 rm -rf autom4te.cache
588 rm -f globals
/config.ml
589 rm -f globals
/regexp.ml python
/pycocci.ml ocaml
/prepare_ocamlcocci.ml
590 rm -f scripts
/spatch.sh
592 @echo
"run 'configure' again prior to building coccinelle"
595 # don't include depend for those actions that either don't need
596 # depend or that call 'make .depend' explicitly.
597 # TODO: find a nicer way to express this
598 ifneq ($(MAKECMDGOALS
),clean)
599 ifneq ($(MAKECMDGOALS
),distclean)
600 ifneq ($(MAKECMDGOALS
),configure
)
601 ifneq ($(MAKECMDGOALS
),prerelease
)
602 ifneq ($(MAKECMDGOALS
),release
)
603 ifneq ($(MAKECMDGOALS
),package
)
604 ifneq ($(MAKECMDGOALS
),all-release
)
605 ifneq ($(MAKECMDGOALS
),all-dev
)
606 ifneq ($(MAKECMDGOALS
),all)
607 ifneq ($(MAKECMDGOALS
),.depend
)
608 ifneq ($(MAKECMDGOALS
),depend
)
622 include Makefile.common