summaryrefslogtreecommitdiff
path: root/stdlib/Makefile
blob: 2beea0f2fee1d3a96319763cf8ee8d694158f536 (plain)
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
#**************************************************************************
#*                                                                        *
#*                                 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 Lesser General Public License version 2.1, with the          *
#*   special exception on linking described in the file LICENSE.          *
#*                                                                        *
#**************************************************************************

include Makefile.shared

allopt:
	$(MAKE) stdlib.cmxa std_exit.cmx
	$(MAKE) allopt-$(PROFILING)

allopt-noprof:

allopt-prof: stdlib.p.cmxa std_exit.p.cmx
	rm -f std_exit.p.cmi

installopt: installopt-default installopt-$(PROFILING)

installopt-default:
	cp stdlib.cmxa stdlib.a std_exit.o *.cmx "$(INSTALL_LIBDIR)"
	cd "$(INSTALL_LIBDIR)"; $(RANLIB) stdlib.a

installopt-noprof:
	rm -f "$(INSTALL_LIBDIR)/stdlib.p.cmxa"; \
	  ln -s stdlib.cmxa "$(INSTALL_LIBDIR)/stdlib.p.cmxa"
	rm -f "$(INSTALL_LIBDIR)/stdlib.p.a"; \
	  ln -s stdlib.a "$(INSTALL_LIBDIR)/stdlib.p.a"
	rm -f "$(INSTALL_LIBDIR)/std_exit.p.cmx"; \
	  ln -s std_exit.cmx "$(INSTALL_LIBDIR)/std_exit.p.cmx"
	rm -f "$(INSTALL_LIBDIR)/std_exit.p.o"; \
	  ln -s std_exit.o "$(INSTALL_LIBDIR)/std_exit.p.o"

installopt-prof:
	cp stdlib.p.cmxa stdlib.p.a std_exit.p.cmx std_exit.p.o \
	  "$(INSTALL_LIBDIR)"
	cd "$(INSTALL_LIBDIR)"; $(RANLIB) stdlib.p.a

stdlib.p.cmxa: $(OBJS:.cmo=.p.cmx)
	$(CAMLOPT) -a -o stdlib.p.cmxa $(OBJS:.cmo=.p.cmx)

camlheader target_camlheader camlheader_ur \
camlheaderd target_camlheaderd \
camlheaderi target_camlheaderi: \
  header.c ../config/Makefile
	if $(SHARPBANGSCRIPTS); then \
	  for suff in '' d i; do \
	    echo '#!$(BINDIR)/ocamlrun'$$suff > camlheader$$suff && \
	    echo '#!$(TARGET_BINDIR)/ocamlrun'$$suff >target_camlheader$$suff; \
	  done && \
	  echo '#!' | tr -d '\012' > camlheader_ur; \
	else \
	  for suff in '' d i; do \
	    $(BYTECC) $(BYTECCCOMPOPTS) $(BYTECCLINKOPTS) \
	              -DRUNTIME_NAME='"$(BINDIR)/ocamlrun'$$suff'"' \
	              header.c -o tmpheader$(EXE) && \
	    strip tmpheader$(EXE) && \
	    mv tmpheader$(EXE) camlheader$$suff && \
	    $(BYTECC) $(BYTECCCOMPOPTS) $(BYTECCLINKOPTS) \
	              -DRUNTIME_NAME='"$(TARGET_BINDIR)/ocamlrun'$$suff'"' \
	              header.c -o tmpheader$(EXE) && \
	    strip tmpheader$(EXE) && \
	    mv tmpheader$(EXE) target_camlheader$$suff; \
	  done && \
	  cp camlheader camlheader_ur; \
	fi

.PHONY: all allopt allopt-noprof allopt-prof install installopt
.PHONY: installopt-default installopt-noprof installopt-prof clean depend