Sys.Signals module for a Variant type of signals (and a set_signal function that...
[ocaml.git] / stdlib / Makefile
blob746c9c05b0388525bf46feedfc5e33e82c2e22f0
1 #########################################################################
2 # #
3 # Objective Caml #
4 # #
5 # Xavier Leroy, projet Cristal, INRIA Rocquencourt #
6 # #
7 # Copyright 1999 Institut National de Recherche en Informatique et #
8 # en Automatique. All rights reserved. This file is distributed #
9 # under the terms of the GNU Library General Public License, with #
10 # the special exception on linking described in file ../LICENSE. #
11 # #
12 #########################################################################
14 # $Id$
16 include ../config/Makefile
18 RUNTIME=../boot/ocamlrun
19 COMPILER=../ocamlc
20 CAMLC=$(RUNTIME) $(COMPILER)
21 COMPFLAGS=-g -warn-error A -nostdlib
22 OPTCOMPILER=../ocamlopt
23 CAMLOPT=$(RUNTIME) $(OPTCOMPILER)
24 OPTCOMPFLAGS=-warn-error A -nostdlib -g
25 CAMLDEP=../boot/ocamlrun ../tools/ocamldep
27 OBJS=pervasives.cmo $(OTHERS)
28 OTHERS=bitSet.cmo array.cmo list.cmo char.cmo string.cmo sys.cmo \
29 hashtbl.cmo sort.cmo marshal.cmo obj.cmo \
30 int32.cmo int64.cmo nativeint.cmo \
31 lexing.cmo parsing.cmo \
32 set.cmo map.cmo stack.cmo queue.cmo stream.cmo buffer.cmo \
33 printf.cmo format.cmo scanf.cmo \
34 arg.cmo printexc.cmo gc.cmo \
35 digest.cmo random.cmo callback.cmo \
36 camlinternalOO.cmo oo.cmo camlinternalMod.cmo \
37 genlex.cmo weak.cmo typestruct.cmo \
38 lazy.cmo filename.cmo complex.cmo \
39 arrayLabels.cmo listLabels.cmo stringLabels.cmo moreLabels.cmo stdLabels.cmo
41 all: stdlib.cma std_exit.cmo camlheader camlheader_ur
43 allopt: stdlib.cmxa std_exit.cmx allopt-$(PROFILING)
45 allopt-noprof:
47 allopt-prof: stdlib.p.cmxa std_exit.p.cmx
48 rm -f std_exit.p.cmi
50 install:
51 cp stdlib.cma std_exit.cmo *.cmi *.mli *.ml camlheader camlheader_ur \
52 $(LIBDIR)
54 installopt: installopt-default installopt-$(PROFILING)
56 installopt-default:
57 cp stdlib.cmxa stdlib.a std_exit.o *.cmx $(LIBDIR)
58 cd $(LIBDIR); $(RANLIB) stdlib.a
60 installopt-noprof:
61 rm -f $(LIBDIR)/stdlib.p.cmxa; ln -s stdlib.cmxa $(LIBDIR)/stdlib.p.cmxa
62 rm -f $(LIBDIR)/stdlib.p.a; ln -s stdlib.a $(LIBDIR)/stdlib.p.a
63 rm -f $(LIBDIR)/std_exit.p.cmx; \
64 ln -s std_exit.cmx $(LIBDIR)/std_exit.p.cmx
65 rm -f $(LIBDIR)/std_exit.p.o; ln -s std_exit.o $(LIBDIR)/std_exit.p.o
67 installopt-prof:
68 cp stdlib.p.cmxa stdlib.p.a std_exit.p.cmx std_exit.p.o $(LIBDIR)
69 cd $(LIBDIR); $(RANLIB) stdlib.p.a
71 stdlib.cma: $(OBJS)
72 $(CAMLC) -a -o stdlib.cma $(OBJS)
74 stdlib.cmxa: $(OBJS:.cmo=.cmx)
75 $(CAMLOPT) -a -o stdlib.cmxa $(OBJS:.cmo=.cmx)
77 stdlib.p.cmxa: $(OBJS:.cmo=.p.cmx)
78 $(CAMLOPT) -a -o stdlib.p.cmxa $(OBJS:.cmo=.p.cmx)
80 camlheader camlheader_ur: header.c ../config/Makefile
81 if $(SHARPBANGSCRIPTS); then \
82 echo '#!$(BINDIR)/ocamlrun' > camlheader && \
83 echo '#!' | tr -d '\012' > camlheader_ur; \
84 else \
85 $(BYTECC) $(BYTECCCOMPOPTS) $(BYTECCLINKOPTS) \
86 -DRUNTIME_NAME='"$(BINDIR)/ocamlrun"' \
87 header.c -o tmpheader$(EXE) && \
88 strip tmpheader$(EXE) && \
89 mv tmpheader$(EXE) camlheader && \
90 cp camlheader camlheader_ur; \
93 sys.ml: sys.mlp ../VERSION
94 sed -e "s|%%VERSION%%|`head -1 ../VERSION`|" sys.mlp >sys.ml
96 clean::
97 rm -f sys.ml
99 clean::
100 rm -f camlheader camlheader_ur
102 .SUFFIXES: .mli .ml .cmi .cmo .cmx .p.cmx
104 .mli.cmi:
105 $(CAMLC) $(COMPFLAGS) `./Compflags $@` -c $<
107 .ml.cmo:
108 $(CAMLC) $(COMPFLAGS) `./Compflags $@` -c $<
110 .ml.cmx:
111 $(CAMLOPT) $(OPTCOMPFLAGS) `./Compflags $@` -c $<
113 .ml.p.cmx:
114 $(CAMLOPT) $(OPTCOMPFLAGS) `./Compflags $@` -p -c -o $*.p.cmx $<
116 # Dependencies on the compiler
117 $(OBJS) std_exit.cmo: $(COMPILER)
118 $(OBJS:.cmo=.cmi) std_exit.cmi: $(COMPILER)
119 $(OBJS:.cmo=.cmx) std_exit.cmx: $(OPTCOMPILER)
120 $(OBJS:.cmo=.p.cmx) std_exit.p.cmx: $(OPTCOMPILER)
122 # Dependencies on Pervasives (not tracked by ocamldep)
123 $(OBJS) std_exit.cmo: pervasives.cmi
124 $(OTHERS:.cmo=.cmi) std_exit.cmi: pervasives.cmi
125 $(OBJS:.cmo=.cmx) std_exit.cmx: pervasives.cmi
126 $(OBJS:.cmo=.p.cmx) std_exit.p.cmx: pervasives.cmi
127 $(OTHERS:.cmo=.cmx) std_exit.cmx: pervasives.cmx
128 $(OTHERS:.cmo=.p.cmx) std_exit.p.cmx: pervasives.cmx
130 clean::
131 rm -f *.cm* *.o *.a
132 rm -f *~
134 include .depend
136 depend:
137 $(CAMLDEP) *.mli *.ml > .depend