forked from rescript-lang/rescript-compiler
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
65 lines (52 loc) · 1.79 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# export BS_RELEASE_BUILD=1
# so that amdjs is also set
# Note we should not do snapshotml here
# since in relese build, user may not have the sources available
# -B is not necessary in CI, however, when dir is not clean..
NPROCS := 8
KERNEL := $(shell uname -s)
ifeq ($(KERNEL),Linux)
NPROCS := $(shell grep -c '^processor' /proc/cpuinfo)
endif
DEST=lib/ocaml
RUNTIME=jscomp/runtime
STDLIB=jscomp/stdlib-402
OTHERS=jscomp/others
BELT_BYTE=jscomp/belt_byte
BELT_NATIVE=jscomp/belt_native
OCAML=vendor/ocaml
world:
@echo "Making compiler"
$(MAKE) -B -C lib -j $(NPROCS) all
$(MAKE) libs
libs:
@echo "Making compiler finished"
$(MAKE) -C jscomp/runtime -j $(NPROCS) all
$(MAKE) -C jscomp/others -j $(NPROCS) all
$(MAKE) -C $(STDLIB) -j $(NPROCS) all
world-native:
@echo "Making compiler"
$(MAKE) BS_NATIVE=true -B -C lib -j $(NPROCS) all
$(MAKE) libs-native
libs-native:
@echo "Making compiler finished"
$(MAKE) -C jscomp/runtime -j $(NPROCS) all
$(MAKE) -C jscomp/others -j $(NPROCS) all
$(MAKE) -C $(STDLIB) -j $(NPROCS) all
$(MAKE) BS_NATIVE=true -C jscomp/belt_byte
$(MAKE) BS_NATIVE=true -C jscomp/belt_native
# TODO: sync up with
# scripts/build_uitil.js
# function install
# scripts/build_util.install
# ATTENTION: syncup build_util.install for windows
install:
@echo "Installation"
cp $(RUNTIME)/*.cmt* $(RUNTIME)/*.cmj $(RUNTIME)/js.ml $(RUNTIME)/js.cmi $(RUNTIME)/js.cmj \
$(STDLIB)/*.cm* $(STDLIB)/*.ml $(STDLIB)/*.mli \
$(OTHERS)/*.ml $(OTHERS)/*.mli $(OTHERS)/*.cm* $(DEST)
mkdir -p $(DEST)/bytecode $(DEST)/native
cp $(BELT_BYTE)/*.ml $(BELT_BYTE)/*mli $(BELT_BYTE)/*.o $(BELT_BYTE)/*.cm* $(DEST)/bytecode
cp $(BELT_NATIVE)/*.ml $(BELT_NATIVE)/*mli $(BELT_NATIVE)/*.o $(BELT_NATIVE)/*.cm* $(BELT_NATIVE)/*.a $(DEST)/native
cp -r $(OCAML)/lib/ocaml/caml $(DEST)
.PHONY: libs world