summaryrefslogtreecommitdiff
path: root/stdlib/Makefile
blob: 38c7f74ae91f5c54fa8d00b95f39b74a6c053b7e (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
include ../Makefile.config

COMPILER=../camlc
CAMLC=../byterun/camlrun $(COMPILER)
CAMLDEP=../tools/camldep

OBJS=pervasives.cmo list.cmo string.cmo char.cmo array.cmo sys.cmo \
  hashtbl.cmo sort.cmo filename.cmo obj.cmo lexing.cmo parsing.cmo \
  set.cmo map.cmo stack.cmo queue.cmo \
  printf.cmo format.cmo arg.cmo printexc.cmo gc.cmo

all: stdlib.cma cslheader

install:
	cp stdlib.cma *.cmi *.mli cslheader $(LIBDIR)

stdlib.cma: $(OBJS)
	$(CAMLC) -a -o stdlib.cma $(OBJS)

cslheader: header.c ../Makefile.config
	if $(SHARPBANGSCRIPTS); \
	then echo "#!$(BINDIR)/cslrun" > cslheader; \
	else $(CC) $(CCCOMPOPTS) $(CCLINKOPTS) header.c -o cslheader; \
	     strip cslheader; fi

pervasives.cmi: pervasives.mli
	$(CAMLC) -nopervasives -c pervasives.mli

pervasives.cmo: pervasives.ml
	$(CAMLC) -nopervasives -c pervasives.ml

.SUFFIXES: .mli .ml .cmi .cmo

.mli.cmi:
	$(CAMLC) $(COMPFLAGS) -c $<

.ml.cmo:
	$(CAMLC) $(COMPFLAGS) -c $<

$(OBJS): pervasives.cmi

$(OBJS): $(COMPILER)
$(OBJS:.cmo=.cmi): $(COMPILER)

clean:
	rm -f *.cm[ioa]
	rm -f *~

include .depend

depend:
	$(CAMLDEP) *.mli *.ml > .depend