-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathMakefile
47 lines (34 loc) · 1.14 KB
/
Makefile
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
40
41
42
43
44
45
46
47
SHELL = /bin/bash
MAKEFLAGS += --jobs 4
INCLUDES = -I src -I src/vendor/res_outcome_printer -I src/vendor
OCAMLOPT = ocamlopt.opt
OCAMLFLAGS = -g -w +26+27+32+33+39 -bin-annot -I +compiler-libs $(INCLUDES)
OCAMLDEP = ocamldep.opt
OUTPUT = rescript-editor-analysis.exe
%.cmi : %.mli
@echo Building $@
@$(OCAMLOPT) $(OCAMLFLAGS) -c $<
%.cmx : %.ml
@echo Building $@
@$(OCAMLOPT) $(OCAMLFLAGS) -c $<
include .depend
depend:
@$(OCAMLDEP) -native $(INCLUDES) `find src -name "*.ml" -o -name "*.mli"` > .depend
SOURCE_FILES = $(shell $(OCAMLDEP) -sort `find src -name "*.ml"` | sed -E "s/\.ml/.cmx/g")
$(OUTPUT): $(SOURCE_FILES)
@echo Linking...
@$(OCAMLOPT) $(OCAMLFLAGS) -O2 -o $(OUTPUT) \
-I +compiler-libs unix.cmxa str.cmxa ocamlcommon.cmxa $(INCLUDES) $(SOURCE_FILES)
@echo Done!
build-native: $(OUTPUT) depend
dce: build-native
../node_modules/.bin/reanalyze -dce-cmt src -suppress src/vendor
tests/node_modules/.bin/bsb:
@cd tests && npm install
test: dce tests/node_modules/.bin/bsb
@cd tests && node_modules/.bin/bsb -make-world
./test.sh
clean:
git clean -dfx .
.DEFAULT_GOAL := build-native
.PHONY: depend clean build-native dce test