File: Makefile

package info (click to toggle)
extlib 1.7.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 632 kB
  • sloc: ml: 6,980; makefile: 128; sh: 42; ansic: 31
file content (67 lines) | stat: -rw-r--r-- 1,669 bytes parent folder | download
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
# Makefile contributed by Alain Frisch

# the list is topologically sorted
MODULES := \
 extBytes enum bitSet dynArray extArray extHashtbl extList extString extBuffer \
 global IO option pMap std uChar uTF8 base64 unzip refList optParse dllist extLib

ifdef minimal
MODULES := $(filter-out unzip uChar uTF8, $(MODULES))
endif

CPPO_ARGS := $(shell ocaml configure.ml -cppo-args)
CPPO := cppo $(CPPO_ARGS)

OCAML_ARGS := -pp "$(CPPO)" -g
OCAML_ARGS += $(shell ocaml configure.ml -compile-args)

OCAMLC = ocamlfind ocamlc $(OCAML_ARGS)
OCAMLOPT = ocamlfind ocamlopt $(OCAML_ARGS)
OCAMLDOC = ocamldoc -pp "$(CPPO)"

MLI = $(filter-out extLib.mli, $(MODULES:=.mli))
CMI = $(MODULES:=.cmi)
CMO = $(MODULES:=.cmo)
CMX = $(MODULES:=.cmx)
CMT = $(MODULES:=.cmt)
CMTI = $(MODULES:=.cmti)

.NOTPARALLEL:
.SUFFIXES:
.PHONY: build all opt cmxs doc install uninstall clean release

build: all opt cmxs

all: extLib.cma
opt: extLib.cmxa
cmxs: extLib.cmxs

doc: $(MLI)
	$(OCAMLC) -c $(MLI)
	$(OCAMLDOC) -sort -html -d doc/ $(MLI) extLib.ml

extLib.cma: $(CMO)
	$(OCAMLC) -a -o $@ $^
extLib.cmxa: $(CMX)
	$(OCAMLOPT) -a -o $@ $^
%.cmxs: %.cmxa
	$(OCAMLOPT) -shared -linkall $< -o $@
%.cmo: %.mli %.ml
	$(OCAMLC) -c $^
%.cmx: %.mli %.ml
	$(OCAMLOPT) -c $^
extLib.cmo: extLib.ml
	$(OCAMLC) -c $<
extLib.cmx: extLib.ml
	$(OCAMLOPT) -c $<
extBytes.mli: extBytes.ml
	$(OCAMLC) -i $< > $@

install:
	ocamlfind install -patch-version $(VERSION) extlib META extLib.cma $(MLI) $(CMI) -optional extLib.cmxa $(CMX) extLib.cmxs extLib.a extLib.lib $(CMT) $(CMTI)

uninstall:
	ocamlfind remove extlib

clean:
	rm -f *.cmo *.cmx *.o *.obj *.cmi *.cma *.cmxa *.cmxs *.a *.lib doc/*.html extBytes.mli