build in one directory only

Summary:
Build everything at once all the time. This removes the need for multiple
directories, which were a hassle to begin with.

This removes the `java`, `clang`, and `llvm` targets in various Makefiles as
well.

Reviewed By: jberdine

Differential Revision: D3317230

fbshipit-source-id: 8e86140
master
Jules Villard 9 years ago committed by Facebook Github Bot 6
parent 17f123a4bf
commit 1c56310f39

5
.gitignore vendored

@ -103,8 +103,6 @@ buck-out/
/infer/src/backend/.projectSettings /infer/src/backend/.projectSettings
/infer/models/out/ /infer/models/out/
/infer/_build-infer/
/infer/src/clang/clang_ast_b.ml /infer/src/clang/clang_ast_b.ml
/infer/src/clang/clang_ast_b.mli /infer/src/clang/clang_ast_b.mli
/infer/src/clang/clang_ast_j.ml /infer/src/clang/clang_ast_j.ml
@ -118,6 +116,9 @@ buck-out/
/infer/src/clang/clang_ast_visit.ml /infer/src/clang/clang_ast_visit.ml
/infer/src/clang/clang_ast_main.ml /infer/src/clang/clang_ast_main.ml
/infer/src/llvm/lLexer.ml
/infer/src/llvm/lParser.ml
/infer/annotations/annot_classes/ /infer/annotations/annot_classes/
/infer/annotations/annotations.jar /infer/annotations/annotations.jar
/infer/annotations/processor_classes/ /infer/annotations/processor_classes/

@ -44,16 +44,10 @@ INFERTRACEBUGS_BIN = $(BIN_DIR)/inferTraceBugs
INFER_BIN_RELPATH = bin/infer INFER_BIN_RELPATH = bin/infer
INFERTRACEBUGS_BIN_RELPATH = bin/inferTraceBugs INFERTRACEBUGS_BIN_RELPATH = bin/inferTraceBugs
INFER_ANALYZERS=
ifeq (@BUILD_C_ANALYZERS@,yes)
INFER_ANALYZERS+=clang
endif
ifeq (@BUILD_JAVA_ANALYZERS@,yes) ifeq (@BUILD_JAVA_ANALYZERS@,yes)
INFER_ANALYZERS+=java
JAVA_HOME=@USER_JAVA_HOME@ JAVA_HOME=@USER_JAVA_HOME@
endif endif
JAVA_DEPS = $(addprefix $(PYTHON_LIB_DIR)/, \ JAVA_DEPS = $(addprefix $(PYTHON_LIB_DIR)/, \
analyze.py config.py issues.py jwlib.py source.py utils.py) \ analyze.py config.py issues.py jwlib.py source.py utils.py) \
$(addprefix $(CAPTURE_LIB_DIR)/, javac.py util.py) \ $(addprefix $(CAPTURE_LIB_DIR)/, javac.py util.py) \

@ -29,35 +29,15 @@ TARGETS_TO_TEST += objc objcpp
endif endif
TARGETS_TO_TEST := $(shell echo $(TARGETS_TO_TEST)) TARGETS_TO_TEST := $(shell echo $(TARGETS_TO_TEST))
all: $(INFER_ANALYZERS) all: infer inferTraceBugs
java: inferTraceBugs infer:
ifneq (@BUILD_JAVA_ANALYZERS@,yes) $(MAKE) -C $(INFER_DIR) infer
@echo
@echo " error: java analyzers disabled by ./configure"
@echo " to enable them again, see"
@echo
@echo " ./configure --help"
@echo
@exit 1
else
$(MAKE) -C $(INFER_DIR) java
endif
clang: inferTraceBugs ifeq (@BUILD_C_ANALYZERS@,yes)
ifneq (@BUILD_C_ANALYZERS@,yes) infer: clang_plugin
@echo
@echo " error: clang analyzers disabled by ./configure"
@echo " to enable them again, see"
@echo
@echo " ./configure --help"
@echo
@exit 1
else
$(MAKE) -C $(INFER_DIR) clang
endif endif
ifeq (@BUILD_C_ANALYZERS@,yes)
clang_setup: clang_setup:
export CC="@CC@" CFLAGS="@CFLAGS@"; \ export CC="@CC@" CFLAGS="@CFLAGS@"; \
export CXX="@CXX@" CXXFLAGS="@CXXFLAGS@"; \ export CXX="@CXX@" CXXFLAGS="@CXXFLAGS@"; \
@ -83,31 +63,10 @@ ifeq (@IS_RELEASE_TREE@,no)
CLANG_INCLUDES=@CLANG_INCLUDES@ CLANG_INCLUDES=@CLANG_INCLUDES@
endif endif
clang: clang_plugin
endif
test_build_src:
$(MAKE) -C $(SRC_DIR) test_build
test_build_clang: clang_plugin
$(MAKE) -C $(INFER_DIR) clang
test_build_java:
$(MAKE) -C $(INFER_DIR) java
test_build_llvm:
$(MAKE) -C $(INFER_DIR) llvm
test_build: test_build_src test_build_clang test_build_java test_build_llvm
unit:
$(MAKE) -C $(SRC_DIR) unit
ifeq (@BUILD_C_ANALYZERS@,yes)
test_build: clang_plugin test_build: clang_plugin
endif $(MAKE) -C $(SRC_DIR) test_build
ocaml_unit_test: test_build unit ocaml_unit_test: test_build
$(INFERUNIT_BIN) $(INFERUNIT_BIN)
buck_test: test_build buck_test: test_build
@ -117,7 +76,7 @@ ifeq (@BUILD_JAVA_ANALYZERS@,yes)
NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py
endif endif
buck_test_xml: $(INFER_ANALYZERS) buck_test_xml: test_build
NO_BUCKD=1 buck clean NO_BUCKD=1 buck clean
NO_BUCKD=1 buck test --xml test.xml $(TARGETS_TO_TEST) NO_BUCKD=1 buck test --xml test.xml $(TARGETS_TO_TEST)
ifeq (@BUILD_JAVA_ANALYZERS@,yes) ifeq (@BUILD_JAVA_ANALYZERS@,yes)
@ -128,17 +87,10 @@ inferTraceBugs:
$(MAKE) -C $(INFER_DIR) $(INFERTRACEBUGS_BIN_RELPATH) $(MAKE) -C $(INFER_DIR) $(INFERTRACEBUGS_BIN_RELPATH)
inferTraceBugs_test: test_build inferTraceBugs_test: test_build
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
$(INFER_BIN) -o __test-infer-out__ -- \ $(INFER_BIN) -o __test-infer-out__ -- \
javac $(EXAMPLES_DIR)/Hello.java \ javac $(EXAMPLES_DIR)/Hello.java \
> /dev/null > /dev/null
@rm -f Hello.class @rm -f Hello.class
else
$(INFER_BIN) -o __test-infer-out__ \
-- clang -c $(EXAMPLES_DIR)/hello.c \
> /dev/null
@rm -f hello.o
endif
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \ $(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
--select 0 --max-level max > /dev/null --select 0 --max-level max > /dev/null
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \ $(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
@ -154,12 +106,8 @@ check_missing_mli:
for x in `find infer/src -name "*.ml"`; do \ for x in `find infer/src -name "*.ml"`; do \
test -f "$$x"i || echo Missing "$$x"i; done' test -f "$$x"i || echo Missing "$$x"i; done'
test: test: test_build ocaml_unit_test buck_test inferTraceBugs_test
$(MAKE) -C $(INFER_DIR) $(INFER_BIN_RELPATH)
$(MAKE) -C $(SRC_DIR) init
$(MAKE) -j$(NCPU) test_build
$(MAKE) -C $(SRC_DIR) mod_dep.dot $(MAKE) -C $(SRC_DIR) mod_dep.dot
$(MAKE) ocaml_unit_test buck_test inferTraceBugs_test
test_xml: buck_test_xml test_xml: buck_test_xml
@ -168,7 +116,7 @@ uninstall:
$(REMOVE) $(DESTDIR)$(bindir)/inferTraceBugs $(REMOVE) $(DESTDIR)$(bindir)/inferTraceBugs
$(REMOVE) $(DESTDIR)$(bindir)/infer $(REMOVE) $(DESTDIR)$(bindir)/infer
install: $(INFER_ANALYZERS) inferTraceBugs install: infer inferTraceBugs
# create directory structure # create directory structure
test -d $(DESTDIR)$(bindir) || \ test -d $(DESTDIR)$(bindir) || \
$(MKDIR_P) $(DESTDIR)$(bindir) $(MKDIR_P) $(DESTDIR)$(bindir)
@ -291,7 +239,7 @@ conf-clean: clean
$(REMOVE_DIR) infer/models/objc/out/ $(REMOVE_DIR) infer/models/objc/out/
$(REMOVE) infer/src/Makefile $(REMOVE) infer/src/Makefile
.PHONY: all buck_test buck_test_xml clean clang .PHONY: all buck_test buck_test_xml clean
.PHONY: clang_plugin clang_setup inferTraceBugs inferTraceBugs_test java .PHONY: clang_plugin clang_setup infer inferTraceBugs inferTraceBugs_test
.PHONY: ocaml_unit_test check_missing_mli test test_xml test_build unit .PHONY: ocaml_unit_test check_missing_mli test test_xml test_build
.PHONY: install uninstall .PHONY: install uninstall

@ -113,14 +113,6 @@ if [ ! -f .release ]; then
./autogen.sh > /dev/null ./autogen.sh > /dev/null
fi fi
TARGETS=""
if [ "$BUILD_JAVA" = "yes" ]; then
TARGETS+=" java"
fi
if [ "$BUILD_CLANG" = "yes" ]; then
TARGETS+=" clang"
fi
CONFIGURE_ARGS= CONFIGURE_ARGS=
if [ "$BUILD_CLANG" = "no" ]; then if [ "$BUILD_CLANG" = "no" ]; then
CONFIGURE_ARGS+=" --disable-c-analyzers" CONFIGURE_ARGS+=" --disable-c-analyzers"
@ -162,7 +154,7 @@ if [ "$BUILD_CLANG" = "yes" ] && ! facebook-clang-plugins/clang/setup.sh --only-
fi fi
fi fi
make -j $NCPU $TARGETS || ( make -j $NCPU all || (
echo echo
echo ' compilation failure; you can try running' echo ' compilation failure; you can try running'
echo echo

@ -67,6 +67,14 @@ AC_ARG_ENABLE(java-analyzers,
BUILD_JAVA_ANALYZERS=$enable_java_analyzers BUILD_JAVA_ANALYZERS=$enable_java_analyzers
AC_SUBST([BUILD_JAVA_ANALYZERS]) AC_SUBST([BUILD_JAVA_ANALYZERS])
AC_ARG_ENABLE(llvm-analyzers,
AS_HELP_STRING([--enable-llvm-analyzers],
[build the LLVM experimental analyzers (default is not to build them)]),
,
enable_llvm_analyzers=no)
BUILD_LLVM_ANALYZERS=$enable_llvm_analyzers
AC_SUBST([BUILD_LLVM_ANALYZERS])
AC_ARG_WITH(fcp-clang, AC_ARG_WITH(fcp-clang,
AS_HELP_STRING([--without-fcp-clang], AS_HELP_STRING([--without-fcp-clang],
[do not use $CLANG_PREFIX/bin/clang to override the default compiler (default is to override if in an infer release)]), [do not use $CLANG_PREFIX/bin/clang to override the default compiler (default is to override if in an infer release)]),

@ -1,5 +1,5 @@
S src/** S src/**
B _build-infer/** B _build/infer/**
PKG atdgen PKG atdgen
PKG extlib PKG extlib
PKG javalib PKG javalib

@ -10,28 +10,19 @@ ROOT_DIR = ..
include $(ROOT_DIR)/Makefile.config include $(ROOT_DIR)/Makefile.config
all: clang java llvm $(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH) all: infer $(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH)
all: checkCopyright
$(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH): $(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH):
($(REMOVE) $@ && \ ($(REMOVE) $@ && \
cd $(@D) && \ cd $(@D) && \
$(LN_S) ../lib/python/$(@F) $(@F)) $(LN_S) ../lib/python/$(@F) $(@F))
java: $(INFER_BIN_RELPATH) infer: $(INFER_BIN_RELPATH)
$(MAKE) -C $(SRC_DIR) java $(MAKE) -C $(SRC_DIR) infer
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
$(MAKE) -C $(ANNOTATIONS_DIR) $(MAKE) -C $(ANNOTATIONS_DIR)
$(MAKE) -C $(MODELS_DIR) java endif
$(MAKE) -C $(MODELS_DIR) all
clang: $(INFER_BIN_RELPATH)
$(MAKE) -C $(SRC_DIR) clang
$(MAKE) -C $(MODELS_DIR) clang
llvm: $(INFER_BIN_RELPATH)
$(MAKE) -C $(SRC_DIR) llvm
checkCopyright:
$(MAKE) -C $(SRC_DIR) checkCopyright
clean: clean:
$(MAKE) -C $(SRC_DIR) clean $(MAKE) -C $(SRC_DIR) clean
@ -39,4 +30,4 @@ clean:
$(MAKE) -C $(MODELS_DIR) clean $(MAKE) -C $(MODELS_DIR) clean
$(REMOVE) $(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH) $(REMOVE) $(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH)
.PHONY: all checkCopyright clang clean java llvm models .PHONY: all clean infer

@ -19,6 +19,14 @@ ifneq (no, @XCODE_SELECT@)
CLANG_SUBDIRS += $(OBJC_MODELS_DIR) CLANG_SUBDIRS += $(OBJC_MODELS_DIR)
endif endif
all:
ifeq (@BUILD_C_ANALYZERS@,yes)
all: clang
endif
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
all: java
endif
.PHONY: java clang clean $(CLANG_SUBDIRS) .PHONY: java clang clean $(CLANG_SUBDIRS)
clang: $(CLANG_SUBDIRS) clang: $(CLANG_SUBDIRS)

@ -17,13 +17,9 @@ ATDGEN = @ATDGEN@
#### Global declarations #### #### Global declarations ####
BUILD_DIR = $(INFER_DIR)/_build-infer BUILD_DIR = $(INFER_DIR)/_build
JAVA_BUILD_DIR = $(BUILD_DIR)/java INFER_BUILD_DIR = $(BUILD_DIR)/infer
CLANG_BUILD_DIR = $(BUILD_DIR)/clang
LLVM_BUILD_DIR = $(BUILD_DIR)/llvm LLVM_BUILD_DIR = $(BUILD_DIR)/llvm
SCRIPTS_BUILD_DIR = $(BUILD_DIR)/scripts
TEST_BUILD_DIR = $(BUILD_DIR)/test
UNIT_BUILD_DIR = $(BUILD_DIR)/unit
ANNOT_DIR = $(SRC_DIR)/_build ANNOT_DIR = $(SRC_DIR)/_build
ETC_DIR = $(INFER_DIR)/etc ETC_DIR = $(INFER_DIR)/etc
@ -111,6 +107,7 @@ CLANG_BINIOU_DICT = $(ETC_DIR)/clang_ast.dict
#### LLVM declarations #### #### LLVM declarations ####
LLVM_SOURCES = llvm LLVM_SOURCES = llvm
MENHIR_SOURCES = menhir
INFERLLVM_MAIN = $(LLVM_SOURCES)/lMain INFERLLVM_MAIN = $(LLVM_SOURCES)/lMain
INFERLLVM_BIN = $(BIN_DIR)/InferLLVM INFERLLVM_BIN = $(BIN_DIR)/InferLLVM
@ -132,78 +129,107 @@ endif
DEPENDENCIES = IR backend checkers eradicate harness \ DEPENDENCIES = IR backend checkers eradicate harness \
facebook/checkers facebook/checkers/graphql facebook/scripts $(EXTRA_DEPS) facebook/checkers facebook/checkers/graphql facebook/scripts $(EXTRA_DEPS)
OCAMLBUILD = rebuild $(OCAMLBUILD_OPTIONS) -j $(NCPU) $(addprefix -I , $(DEPENDENCIES)) # ocamlbuild command with options common to all build targets
OCAMLBUILD_BASE = rebuild $(OCAMLBUILD_OPTIONS) -j $(NCPU) $(addprefix -I , $(DEPENDENCIES))
.PHONY: all java clang llvm unit checkCopyright build_java build_clang build_llvm build_unit \ # ocamlbuild with options necessary to build all targets at once, regardless of configure flags
build_checkCopyright java_annotations clang_annotations llvm_annotations \ OCAMLBUILD_ALL = $(OCAMLBUILD_BASE) $(JAVA_OCAMLBUILD_OPTIONS)
scripts_annotations init version sanitize clean
default: $(INFER_ANALYZERS) # list of ocamlbuild targets common to all build targets -- native version
INFER_BASE_TARGETS = \
all: java clang llvm checkCopyright unit $(INFERANALYZE_MAIN).native \
$(INFERPRINT_MAIN).native \
$(INFERUNIT_MAIN).native \
$(CHECKCOPYRIGHT_MAIN).native \
$(INFERUNIT_MAIN).native
java: $(INFERJAVA_BIN) INFER_ALL_TARGETS = $(INFER_BASE_TARGETS) \
$(INFERJAVA_MAIN).native \
$(INFERCLANG_MAIN).native \
$(INFERLLVM_MAIN).native
clang: $(INFERCLANG_BIN) $(CLANG_BINIOU_DICT) # configure-aware ocamlbuild commands and targets
OCAMLBUILD_CONFIG = $(OCAMLBUILD_BASE)
INFER_CONFIG_TARGETS = $(INFER_BASE_TARGETS)
llvm: $(INFERLLVM_BIN) ifeq (@BUILD_JAVA_ANALYZERS@,yes)
OCAMLBUILD_CONFIG += $(JAVA_OCAMLBUILD_OPTIONS)
INFER_CONFIG_TARGETS += $(INFERJAVA_MAIN).native
endif
ifeq (@BUILD_C_ANALYZERS@,yes)
INFER_CONFIG_TARGETS += $(INFERCLANG_MAIN).native
endif
ifeq (@BUILD_LLVM_ANALYZERS@,yes)
INFER_CONFIG_TARGETS += $(INFERLLVM_MAIN).native
endif
unit: $(INFERUNIT_BIN) .PHONY: all infer init version sanitize clean
checkCopyright: $(CHECKCOPYRIGHT_BIN) all: infer
build_java: init $(INFERPRINT_ATDGEN_STUBS) infer: init $(INFERPRINT_ATDGEN_STUBS)
$(OCAMLBUILD) -build-dir $(JAVA_BUILD_DIR) $(JAVA_OCAMLBUILD_OPTIONS) \ $(OCAMLBUILD_CONFIG) -build-dir $(INFER_BUILD_DIR) $(INFER_CONFIG_TARGETS)
$(INFERANALYZE_MAIN).native \ $(COPY) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN)
$(INFERPRINT_MAIN).native \ $(COPY) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN)
$(INFERJAVA_MAIN).native $(COPY) $(INFER_BUILD_DIR)/$(CHECKCOPYRIGHT_MAIN).native $(CHECKCOPYRIGHT_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN)
build_clang: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) ifeq (@BUILD_LLVM_ANALYZERS@,yes)
$(OCAMLBUILD) -build-dir $(CLANG_BUILD_DIR) \ $(COPY) $(INFER_BUILD_DIR)/$(INFERLLVM_MAIN).native $(INFERLLVM_BIN)
$(INFERANALYZE_MAIN).native \ endif
$(INFERPRINT_MAIN).native \ ifeq (@BUILD_JAVA_ANALYZERS@,yes)
$(INFERCLANG_MAIN).native $(COPY) $(INFER_BUILD_DIR)/$(INFERJAVA_MAIN).native $(INFERJAVA_BIN)
endif
ifeq (@BUILD_C_ANALYZERS@,yes)
$(COPY) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN)
endif
ifeq (@ENABLE_OCAML_ANNOT@,yes)
rsync -a --include '*/' --include '*.annot' --exclude '*' $(INFER_BUILD_DIR)/ $(ANNOT_DIR)/
endif
build_llvm: ifeq (@BUILD_C_ANALYZERS@,yes)
$(OCAMLBUILD) -build-dir $(LLVM_BUILD_DIR) -use-menhir $(INFERLLVM_MAIN).native infer: $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES)
endif
ifeq (@BUILD_LLVM_ANALYZERS@,yes)
infer: $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml
endif
build_checkCopyright: $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml: init
$(OCAMLBUILD) -build-dir $(SCRIPTS_BUILD_DIR) -I $(SCRIPT_SOURCES) \ $(OCAMLBUILD_BASE) -build-dir $(LLVM_BUILD_DIR) -I $(LLVM_SOURCES) -use-menhir $(MENHIR_SOURCES)/$(@F)
$(CHECKCOPYRIGHT_MAIN).native $(COPY) $(LLVM_BUILD_DIR)/$(MENHIR_SOURCES)/$(@F) $@
build_unit: $(LLVM_SOURCES)/lLexer.ml: $(MENHIR_SOURCES)/lLexer.mll
$(OCAMLBUILD) -build-dir $(UNIT_BUILD_DIR) -I $(UNIT_SOURCES) \ # avoid race condition between concurrently running ocamlbuild instances by making the parser depend
$(INFERUNIT_MAIN).native # on the lexer
$(LLVM_SOURCES)/lParser.ml: $(MENHIR_SOURCES)/lParser.mly $(LLVM_SOURCES)/lLexer.ml
byte: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) byte: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) \
$(OCAMLBUILD) -build-dir $(TEST_BUILD_DIR) $(JAVA_OCAMLBUILD_OPTIONS) \ $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml
$(INFERANALYZE_MAIN).byte \ $(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) $(INFER_ALL_TARGETS:.native=.byte)
$(INFERPRINT_MAIN).byte \
$(INFERJAVA_MAIN).byte \
$(INFERCLANG_MAIN).byte \
$(INFERUNIT_MAIN).byte \
$(CHECKCOPYRIGHT_MAIN).byte
# to build only the single module <Module> (and its dependencies) with extra flags execute: # to build only the single module <Module> (and its dependencies) with extra flags execute:
# make INFER_CFLAGS=<flags> M=<Module>.cm{o,x} module # make INFER_CFLAGS=<flags> M=<Module>.cm{o,x} module
M= M=
INFER_CFLAGS= INFER_CFLAGS=
module: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) module: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) \
$(OCAMLBUILD) -build-dir $(TEST_BUILD_DIR) $(JAVA_OCAMLBUILD_OPTIONS) \ $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml
$(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) \
-cflags -warn-error,$(OCAML_FATAL_WARNINGS) \ -cflags -warn-error,$(OCAML_FATAL_WARNINGS) \
-cflags $(INFER_CFLAGS) \ -cflags $(INFER_CFLAGS) \
$(M) $(M)
test_build: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) test_build: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) \
$(OCAMLBUILD) -build-dir $(TEST_BUILD_DIR) $(JAVA_OCAMLBUILD_OPTIONS) \ $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml
$(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) \
-cflags -warn-error,$(OCAML_FATAL_WARNINGS) \ -cflags -warn-error,$(OCAML_FATAL_WARNINGS) \
$(INFERANALYZE_MAIN).byte \ $(INFER_ALL_TARGETS)
$(INFERPRINT_MAIN).byte \ $(COPY) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN)
$(INFERJAVA_MAIN).byte \ $(COPY) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN)
$(INFERCLANG_MAIN).byte \ $(COPY) $(INFER_BUILD_DIR)/$(CHECKCOPYRIGHT_MAIN).native $(CHECKCOPYRIGHT_BIN)
$(INFERUNIT_MAIN).byte \ $(COPY) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN)
$(CHECKCOPYRIGHT_MAIN).byte $(COPY) $(INFER_BUILD_DIR)/$(INFERLLVM_MAIN).native $(INFERLLVM_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(INFERJAVA_MAIN).native $(INFERJAVA_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN)
$(DEPENDENCIES_DIR)/ocamldot/ocamldot: $(DEPENDENCIES_DIR)/ocamldot/ocamldot:
$(MAKE) -C $(DEPENDENCIES_DIR)/ocamldot $(MAKE) -C $(DEPENDENCIES_DIR)/ocamldot
@ -218,25 +244,6 @@ mod_dep.dot: $(DEPENDENCIES_DIR)/ocamldot/ocamldot $(src_files)
| $(DEPENDENCIES_DIR)/ocamldot/ocamldot -lr $(root_flags) \ | $(DEPENDENCIES_DIR)/ocamldot/ocamldot -lr $(root_flags) \
> mod_dep.dot > mod_dep.dot
ifeq (@ENABLE_OCAML_ANNOT@,yes)
java_annotations: build_java
rsync -a --include '*/' --include '*.annot' --exclude '*' $(JAVA_BUILD_DIR)/ $(ANNOT_DIR)/
clang_annotations: build_clang
rsync -a --include '*/' --include '*.annot' --exclude '*' $(CLANG_BUILD_DIR)/ $(ANNOT_DIR)/
llvm_annotations: build_llvm
rsync -a --include '*/' --include '*.annot' --exclude '*' $(LLVM_BUILD_DIR)/ $(ANNOT_DIR)/
scripts_annotations: build_checkCopyright
rsync -a --include '*/' --include '*.annot' --exclude '*' $(SCRIPTS_BUILD_DIR)/ $(ANNOT_DIR)/
java: java_annotations
clang: clang_annotations
llvm: llvm_annotations
checkCopyright: scripts_annotations
endif
define gen_atdgen_rules define gen_atdgen_rules
# generate files using atdgen # generate files using atdgen
# parameters: # parameters:
@ -303,33 +310,17 @@ version: backend/version.ml.in Makefile
$(BUILD_DIR): $(BUILD_DIR):
$(MKDIR_P) $(BUILD_DIR) $(MKDIR_P) $(BUILD_DIR)
$(INFERJAVA_BIN): build_java
$(COPY) $(JAVA_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN)
$(COPY) $(JAVA_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN)
$(COPY) $(JAVA_BUILD_DIR)/$(INFERJAVA_MAIN).native $(INFERJAVA_BIN)
$(INFERCLANG_BIN): build_clang
$(COPY) $(CLANG_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN)
$(COPY) $(CLANG_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN)
$(COPY) $(CLANG_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN)
$(INFERLLVM_BIN): build_llvm
$(COPY) $(LLVM_BUILD_DIR)/$(INFERLLVM_MAIN).native $(INFERLLVM_BIN)
$(INFERUNIT_BIN): build_unit
$(COPY) $(UNIT_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN)
$(CHECKCOPYRIGHT_BIN): build_checkCopyright
$(COPY) $(SCRIPTS_BUILD_DIR)/$(CHECKCOPYRIGHT_MAIN).native $(CHECKCOPYRIGHT_BIN)
test_clean: test_clean:
$(REMOVE_DIR) $(TEST_BUILD_DIR) $(REMOVE_DIR) $(INFER_BUILD_DIR)
clean: clean:
$(REMOVE_DIR) $(BUILD_DIR) $(REMOVE_DIR) $(BUILD_DIR)
$(REMOVE) $(ETC_DIR)/clang_ast.dict $(REMOVE) $(ETC_DIR)/clang_ast.dict
ifeq (@ENABLE_OCAML_ANNOT@,yes) ifeq (@ENABLE_OCAML_ANNOT@,yes)
$(REMOVE_DIR) $(ANNOT_DIR) $(REMOVE_DIR) $(ANNOT_DIR)
endif
ifeq (@BUILD_LLVM_ANALYZERS@,yes)
$(REMOVE) $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml
endif endif
$(REMOVE) backend/version.ml $(REMOVE) backend/version.ml
$(REMOVE) backend/version.ml.tmp.* $(REMOVE) backend/version.ml.tmp.*

@ -0,0 +1,3 @@
REC
S *
B ../../_build/llvm/**
Loading…
Cancel
Save