File: Makefile.common

package info (click to toggle)
coccinelle 1.0.8.deb-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 26,148 kB
  • sloc: ml: 136,392; ansic: 23,594; sh: 2,189; makefile: 2,157; perl: 1,576; lisp: 840; python: 823; awk: 70; csh: 12
file content (39 lines) | stat: -rw-r--r-- 1,444 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# This file is part of Coccinelle, licensed under the terms of the GPL v2.
# See copyright.txt in the Coccinelle source code for more information.
# The Coccinelle source code can be obtained at http://coccinelle.lip6.fr

# Some common definitions that factored out many reoccurring patterns
# in the Makefiles of the project. This file is included at the bottom
# so that its implicit rules take precedence over implicit rules in
# the file  that includes this one.

# this is a "hack" so that we do not have to pass --native to ocamldep
# and rebuild .depend when building the native version. Since we have
# .ml files without .mli files, building the .cmo *and .cmx file could
# cause the .cmi file to be build twice, which could cause trouble when
# the .cmi file is read by other compilation steps (especially when
# building in parallel).
export BUILD_OPT
ifeq ($(BUILD_OPT),yes)
%.cmo: %.ml
%.cmo: %.cmx
	@echo "skipped building $@ in optimizing mode: $< will be built instead."
endif

define without_mli
ifeq ($(wildcard $(SOURCE).mli),)
ifeq ($(BUILD_OPT),yes)
$(SOURCE).cmo: $(SOURCE).cmx
$(SOURCE).cmi: $(SOURCE).cmx
else
$(SOURCE).cmi: $(SOURCE).cmo
endif
endif
endef

$(foreach SOURCE,$(SOURCES),$(eval $(without_mli)))
$(foreach SOURCE,$(SRC),$(eval $(without_mli)))

# If this variable is set, then 'make distclean' should not remove certain
# generated files like the generated parsers, and documentation.
export KEEP_GENERATED