bubble ctx for decls 4/4
[hiphop-php.git] / hphp / hack / Makefile.dune
blob91b94f164f1f688ba4653999f02cc7a2b5e4b5b5
1 BYTECODE=
3 ROOT=$(shell pwd)
5 ################################################################################
6 #                                    Rules                                     #
7 ################################################################################
9 .NOTPARALLEL:
11 all: build-hack copy-hack-files
13 debug: build-hack-debug copy-hack-debug-files
15 clean:
16         find ./bin -mindepth 1 -not -path ./bin/README -delete
17         dune clean
19 # First argument is the extension to use.
20 # Second argument is a suffix for the rules name. Optional
22 # The only supported configuration are:
23 # 1=exe 2=        (literaly nothing, not even a space)
24 # 1=bc 2=-debug
25 define build_hack
26 $(eval ext := $(if $(filter $(2),-debug),".bc",""))
27 build-hack$(2):
28         dune build \
29                 src/hh_server.$(1) \
30                 src/hh_client.$(1) \
31                 src/hh_single_type_check.$(1) \
32                 src/hackfmt.$(1) \
33                 src/hh_parse.$(1) \
34                 src/generate_full_fidelity.$(1) \
35                 src/hh_single_compile.$(1)
37 copy-hack$(2)-files: build-hack$(2)
38         mkdir -p "$(HACK_BIN_DIR)"
39         cp "$(DUNE_BUILD_DIR)/default/src/hh_server.$(1)" "$(HACK_BIN_DIR)/hh_server$(ext)"
40         cp "$(DUNE_BUILD_DIR)/default/src/hh_client.$(1)" "$(HACK_BIN_DIR)/hh_client$(ext)"
41         cp "$(DUNE_BUILD_DIR)/default/src/hh_single_type_check.$(1)" "$(HACK_BIN_DIR)/hh_single_type_check$(ext)"
42         cp "$(DUNE_BUILD_DIR)/default/src/hackfmt.$(1)" "$(HACK_BIN_DIR)/hackfmt$(ext)"
43         cp "$(DUNE_BUILD_DIR)/default/src/hh_parse.$(1)" "$(HACK_BIN_DIR)/hh_parse$(ext)"
44         cp "$(DUNE_BUILD_DIR)/default/src/generate_full_fidelity.$(1)" "$(HACK_BIN_DIR)/generate_full_fidelity$(ext)"
45         cp "$(DUNE_BUILD_DIR)/default/src/hh_single_compile.$(1)" "$(HACK_BIN_DIR)/hh_single_compile$(ext)"
46 endef
48 # Define rules for normal build / debug build
49 # The name of the rules is important as it matches what is expected by cmake
50 $(eval $(call build_hack,exe,))
51 $(eval $(call build_hack,bc,-debug))
54 .PHONY: test do-test
55 test: build-hack copy-hack-files
56         $(MAKE) -f Makefile.dune do-test
58 do-test:
59         dune runtest
60         # python3 ./test/integration/runner.py ./bin/hh_server ./bin/hh_client