@ -150,7 +150,9 @@ DEPENDENCIES += java_stubs
e n d i f
e n d i f
i f e q ( $( BUILD_C_ANALYZERS ) , y e s )
i f e q ( $( BUILD_C_ANALYZERS ) , y e s )
INFER_CONFIG_TARGETS += $( INFERCLANG_MAIN) .native
INFER_CONFIG_TARGETS += $( INFERCLANG_MAIN) .native
DEPENDENCIES += clang
DEPENDENCIES += clang unit/clang
e l s e
DEPENDENCIES += unit/clang_stubs
e n d i f
e n d i f
OCAML_BASE_SOURCES = \
OCAML_BASE_SOURCES = \
@ -158,9 +160,9 @@ OCAML_BASE_SOURCES = \
$( DEPENDENCIES:= /[ a-zA-Z] *.mll) $( DEPENDENCIES:= /[ a-zA-Z] *.mly) \
$( DEPENDENCIES:= /[ a-zA-Z] *.mll) $( DEPENDENCIES:= /[ a-zA-Z] *.mly) \
$( DEPENDENCIES:= /[ a-zA-Z] *.re) $( DEPENDENCIES:= /[ a-zA-Z] *.rei) ) \
$( DEPENDENCIES:= /[ a-zA-Z] *.re) $( DEPENDENCIES:= /[ a-zA-Z] *.rei) ) \
$( STACKTREE_ATDGEN_STUBS) $( INFERPRINT_ATDGEN_STUBS)
$( STACKTREE_ATDGEN_STUBS) $( INFERPRINT_ATDGEN_STUBS)
OCAML_ SOURCES = $( OCAML_BASE_SOURCES)
OCAML_ CONFIG_ SOURCES = $( OCAML_BASE_SOURCES)
i f e q ( $( BUILD_C_ANALYZERS ) , y e s )
i f e q ( $( BUILD_C_ANALYZERS ) , y e s )
OCAML_ SOURCES += $( CLANG_ATDGEN_STUBS) $( INFER_CLANG_FCP_MIRRORED_FILES)
OCAML_ CONFIG_ SOURCES += $( CLANG_ATDGEN_STUBS) $( INFER_CLANG_FCP_MIRRORED_FILES)
e n d i f
e n d i f
OCAML_ALL_SOURCES = $( OCAML_BASE_SOURCES) $( CLANG_ATDGEN_STUBS) $( INFER_CLANG_FCP_MIRRORED_FILES)
OCAML_ALL_SOURCES = $( OCAML_BASE_SOURCES) $( CLANG_ATDGEN_STUBS) $( INFER_CLANG_FCP_MIRRORED_FILES)
@ -171,7 +173,7 @@ all: infer
# single out infer.native as the source of truth for make, knowing that in fact several targets are
# single out infer.native as the source of truth for make, knowing that in fact several targets are
# produced by the build
# produced by the build
$(INFER_BUILD_DIR)/$(INFER_MAIN).native : base /Version .ml $( BUILD_DIR ) $( OCAML_ SOURCES) \
$(INFER_BUILD_DIR)/$(INFER_MAIN).native : base /Version .ml $( BUILD_DIR ) $( OCAML_ CONFIG_ SOURCES) \
$( MAKEFILE_LIST)
$( MAKEFILE_LIST)
$( OCAMLBUILD_CONFIG) -build-dir $( INFER_BUILD_DIR) $( INFER_CONFIG_TARGETS)
$( OCAMLBUILD_CONFIG) -build-dir $( INFER_BUILD_DIR) $( INFER_CONFIG_TARGETS)
# let make know that the target is up-to-date even if ocamlbuild cached it
# let make know that the target is up-to-date even if ocamlbuild cached it
@ -197,9 +199,9 @@ ifeq ($(BUILD_C_ANALYZERS),yes)
infer : $( CLANG_BINIOU_DICT )
infer : $( CLANG_BINIOU_DICT )
e n d i f
e n d i f
$(INFER_BUILD_DIR)/$(INFER_MAIN).byte : base /Version .ml $( BUILD_DIR ) $( OCAML_ ALL _SOURCES)
$(INFER_BUILD_DIR)/$(INFER_MAIN).byte : base /Version .ml $( BUILD_DIR ) $( OCAML_ CONFIG _SOURCES)
$( OCAMLBUILD_ALL ) -build-dir $( INFER_BUILD_DIR) \
$( OCAMLBUILD_CONFIG ) -build-dir $( INFER_BUILD_DIR) \
$( INFER_ALL _TARGETS:.native= .byte) $( INFERUNIT_MAIN) .byte
$( INFER_CONFIG _TARGETS:.native= .byte) $( INFERUNIT_MAIN) .byte
@touch $@
@touch $@
$(INFER_BIN).byte : $( INFER_BUILD_DIR ) /$( INFER_MAIN ) .byte $( BIN_DIR )
$(INFER_BIN).byte : $( INFER_BUILD_DIR ) /$( INFER_MAIN ) .byte $( BIN_DIR )
@ -228,11 +230,11 @@ module: base/Version.ml $(BUILD_DIR) $(OCAML_ALL_SOURCES)
$( MFLAGS) \
$( MFLAGS) \
$( M)
$( M)
$(TEST_BUILD_DIR)/$(INFER_MAIN).byte : base /Version .ml $( BUILD_DIR ) $( OCAML_ ALL _SOURCES) \
$(TEST_BUILD_DIR)/$(INFER_MAIN).byte : base /Version .ml $( BUILD_DIR ) $( OCAML_ CONFIG _SOURCES) \
toplevel.mlpack $( MAKEFILE_LIST)
toplevel.mlpack $( MAKEFILE_LIST)
$( OCAMLBUILD_ALL ) -build-dir $( TEST_BUILD_DIR) \
$( OCAMLBUILD_CONFIG ) -build-dir $( TEST_BUILD_DIR) \
-cflags -warn-error,$( OCAML_FATAL_WARNINGS) \
-cflags -warn-error,$( OCAML_FATAL_WARNINGS) \
$( INFER_ALL _TARGETS:.native= .byte) $( INFERUNIT_MAIN) .byte toplevel.cmo
$( INFER_CONFIG _TARGETS:.native= .byte) $( INFERUNIT_MAIN) .byte toplevel.cmo
@touch $@
@touch $@
.PHONY : test_build
.PHONY : test_build
@ -283,7 +285,7 @@ $(shell \
| awk 'BEGIN { FS = "/"; OFS = "/" } ; {$$NF=toupper(substr($$NF,1,1))substr($$NF,2); print $$0}' )
| awk 'BEGIN { FS = "/"; OFS = "/" } ; {$$NF=toupper(substr($$NF,1,1))substr($$NF,2); print $$0}' )
e n d e f
e n d e f
toplevel.mlpack : base /Version .ml $( OCAML_ ALL _SOURCES) $( MAKEFILE_LIST )
toplevel.mlpack : base /Version .ml $( OCAML_ CONFIG _SOURCES) $( MAKEFILE_LIST )
# We need to pack all the infer modules into another module to avoid name clashes with some
# We need to pack all the infer modules into another module to avoid name clashes with some
# of them coming from ocaml libraries (Ident for example). To do that, we generate a .mlpack
# of them coming from ocaml libraries (Ident for example). To do that, we generate a .mlpack
# file containing namespaced modules.
# file containing namespaced modules.
@ -295,13 +297,13 @@ toplevel.mlpack: base/Version.ml $(OCAML_ALL_SOURCES) $(MAKEFILE_LIST)
$( foreach module,\
$( foreach module,\
$( filter-out $( foreach root,$( roots) ,%/$( root) ) ,\
$( filter-out $( foreach root,$( roots) ,%/$( root) ) ,\
$( foreach source,\
$( foreach source,\
$( filter-out unit/% facebook/scripts/eradicate_stats.ml,$( OCAML_ALL _SOURCES) ) ,\
$( filter-out unit/% facebook/scripts/eradicate_stats.ml,$( OCAML_CONFIG _SOURCES) ) ,\
$( call to_ocaml_module,$( source ) ) ) ) ,\
$( call to_ocaml_module,$( source ) ) ) ) ,\
$( shell echo $( module) >> $( $@ _tmp) ) )
$( shell echo $( module) >> $( $@ _tmp) ) )
mv $( $@ _tmp) $@
mv $( $@ _tmp) $@
$(INFER_BUILD_DIR)/toplevel.cmo : toplevel .mlpack $( BUILD_DIR )
$(INFER_BUILD_DIR)/toplevel.cmo : toplevel .mlpack $( BUILD_DIR )
$( OCAMLBUILD_ALL ) -build-dir $( INFER_BUILD_DIR) toplevel.cmo
$( OCAMLBUILD_CONFIG ) -build-dir $( INFER_BUILD_DIR) toplevel.cmo
@touch $@
@touch $@
.PHONY : toplevel
.PHONY : toplevel