forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.shared
executable file
·138 lines (106 loc) · 4.54 KB
/
Makefile.shared
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#########################################################################
# #
# OCaml #
# #
# Xavier Leroy, projet Cristal, INRIA Rocquencourt #
# #
# Copyright 1999 Institut National de Recherche en Informatique et #
# en Automatique. All rights reserved. This file is distributed #
# under the terms of the GNU Library General Public License, with #
# the special exception on linking described in file ../LICENSE. #
# #
#########################################################################
# include ../config/Makefile
# CAMLRUN ?= ../boot/ocamlrun
# CAMLYACC ?= ../boot/ocamlyacc
# TARGET_BINDIR ?= $(BINDIR)
COMPILER=../../lib/bsc.exe
CAMLC=$(CAMLRUN) $(COMPILER)
#COMPFLAGS=-strict-sequence -w +33..39 -g -warn-error A -bin-annot -nostdlib \
# -safe-string
BS_COMMON_FLAGS= -bs-no-version-header -bs-diagnose -bs-no-check-div-by-zero -bs-cross-module-opt -bs-package-name bs-platform -bs-no-warn-unimplemented-external
include ../Makefile.shared
# ifdef BS_RELEASE_BUILD
# BS_FLAGS= $(BS_COMMON_FLAGS) -bs-package-output commonjs:lib/js -bs-package-output amdjs:lib/amdjs -bs-package-output es6:lib/es6
# else
# BS_FLAGS= $(BS_COMMON_FLAGS) -bs-package-output commonjs:lib/js
# endif
BS_FLAGS= $(BS_COMMON_FLAGS) $(BS_PKG_FLAGS)
COMPFLAGS= $(BS_FLAGS) -strict-sequence -w +33..39-102 -g -nostdlib \
-safe-string -I ../runtime -I ../others
# OPTCOMPILER=ocamlopt.opt
# CAMLOPT=$(CAMLRUN) $(OPTCOMPILER)
#CAMLDEP=ocamldep.opt
# CAMLDEP=$(CAMLRUN) ../tools/ocamldep
OBJS=camlinternalFormatBasics.cmo pervasives.cmo $(OTHERS)
OTHERS=array.cmo list.cmo char.cmo bytes.cmo string.cmo sys.cmo \
sort.cmo marshal.cmo obj.cmo \
int32.cmo int64.cmo nativeint.cmo \
lexing.cmo parsing.cmo \
set.cmo map.cmo stack.cmo queue.cmo \
camlinternalLazy.cmo lazy.cmo stream.cmo \
buffer.cmo camlinternalFormat.cmo printf.cmo \
arg.cmo printexc.cmo gc.cmo \
digest.cmo random.cmo hashtbl.cmo format.cmo scanf.cmo callback.cmo \
camlinternalOO.cmo oo.cmo camlinternalMod.cmo \
genlex.cmo weak.cmo \
filename.cmo complex.cmo \
arrayLabels.cmo listLabels.cmo bytesLabels.cmo \
stringLabels.cmo moreLabels.cmo stdLabels.cmo \
unix.cmo unixLabels.cmo \
bigarray.cmo
# allcmis:$(OBJS:.cmo=.cmi) std_exit.cmi $(COMPILER)
all: $(OBJS:.cmo=.cmj) std_exit.cmj $(COMPILER)
# all: stdlib.cma std_exit.cmo
# all: stdlib.cma std_exit.cmo camlheader target_camlheader camlheader_ur
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
install: install-$(RUNTIMED)
cp stdlib.cma std_exit.cmo *.cmi *.mli *.ml camlheader_ur \
$(INSTALL_LIBDIR)
cp target_camlheader $(INSTALL_LIBDIR)/camlheader
install-noruntimed:
.PHONY: install-noruntimed
install-runtimed: target_camlheaderd
cp target_camlheaderd $(INSTALL_LIBDIR)/camlheaderd
.PHONY: install-runtimed
stdlib.cma: $(OBJS)
$(CAMLC) -a -o stdlib.cma $(OBJS)
stdlib.cmxa: $(OBJS:.cmo=.cmx)
$(CAMLOPT) -a -o stdlib.cmxa $(OBJS:.cmo=.cmx)
# sys.ml: sys.mlp ../VERSION
# sed -e "s|%%VERSION%%|`sed -e 1q ../VERSION`|" sys.mlp >sys.ml
# clean::
# rm -f sys.ml
clean::
rm -f camlheader target_camlheader camlheader_ur target_camlheaderd
.SUFFIXES: .mli .ml .cmi .cmo .cmx .p.cmx .cmj
.mli.cmi:
$(CAMLC) $(COMPFLAGS) `./Compflags $@` -c $<
.ml.cmj:
$(CAMLC) $(COMPFLAGS) `./Compflags $@` -c $<
.ml.p.cmj:
$(CAMLC) $(COMPFLAGS) `./Compflags $@` -p -c -o $*.p.cmj $<
# Dependencies on the compiler
$(OBJS) std_exit.cmo: $(COMPILER)
$(OBJS:.cmo=.cmi) std_exit.cmi: $(COMPILER)
$(OBJS:.cmo=.cmj) std_exit.cmj: $(OPTCOMPILER)
$(OBJS:.cmo=.p.cmj) std_exit.p.cmj: $(OPTCOMPILER)
# Dependencies on Pervasives (not tracked by ocamldep)
$(OTHERS) std_exit.cmo: pervasives.cmi
$(OTHERS:.cmo=.cmi) std_exit.cmi: pervasives.cmi
$(OBJS:.cmo=.cmj) std_exit.cmj: pervasives.cmi
$(OBJS:.cmo=.p.cmj) std_exit.p.cmj: pervasives.cmi
$(OTHERS:.cmo=.cmj) std_exit.cmj: pervasives.cmj
# Add missing dependencies
$(OTHERS) std_exit.cmo: pervasives.cmo
$(OTHERS:.cmo=.p.cmj) std_exit.p.cmj: pervasives.cmj
clean::
rm -f *.cm* *.$(O) *.$(A)
rm -f *~
rm -f *.annot
rm -f *.rawlambda *.lam
include .depend
depend:
$(CAMLDEP) *.mli *.ml | sed -e 's/\.cmo/.cmj/g' > .depend
$(CAMLDEP) *.ml | sed -e 's/\.cmx/.cmj/g' >>.depend
# $(CAMLDEP) *.ml | sed -e 's/\.cmx/.p.cmj/g' >>.depend