File: Makefile

package info (click to toggle)
ocamlpam 1.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 164 kB
  • ctags: 236
  • sloc: ansic: 1,011; ml: 204; makefile: 88
file content (50 lines) | stat: -rw-r--r-- 1,141 bytes parent folder | download | duplicates (2)
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
OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLMKLIB=ocamlmklib
OCAMLMKLIB_OPTS=-oc pam_stubs -lpam

VERSION=1.1
DISTNAME=ocamlpam-$(VERSION)

SOURCES=pam.mli pam.ml
BASENAME=pam_stubs
LIBNAME=lib$(BASENAME).a

DESTDIR=$(shell ocamlc -where)

.PHONY: all dist clean install

all: META byte opt

META: META.in
	sed 's/_VERSION_/$(VERSION)/' META.in > META

$(LIBNAME): pam_stubs.c
	$(OCAMLC) -c pam_stubs.c
	$(OCAMLMKLIB) $(OCAMLMKLIB_OPTS) pam_stubs.o

byte: $(LIBNAME) $(SOURCES)
	$(OCAMLC) -c pam.mli
	$(OCAMLC) -c pam.ml
	$(OCAMLMKLIB) $(OCAMLMKLIB_OPTS) -o pam pam.cmo

opt: $(LIBNAME) $(SOURCES)
	$(OCAMLOPT) -c pam.mli
	$(OCAMLOPT) -c pam.ml
	$(OCAMLMKLIB) $(OCAMLMKLIB_OPTS) -o pam pam.cmx

install:
	install -d $(DESTDIR)/pam
	install -m 644 -t $(DESTDIR)/pam META $(wildcard *.mli *.cmi *.cmx *.cma *.cmxa *.a)
	install -d $(DESTDIR)/stublibs
	install -m 644 -t $(DESTDIR)/stublibs dll$(BASENAME).so

dist: clean
	mkdir -p $(DISTNAME)
	-cp * $(DISTNAME)
	tar cvzf $(DISTNAME).tar.gz $(DISTNAME)
	zip -r $(DISTNAME).zip $(DISTNAME)
	rm -fr $(DISTNAME)

clean:
	-rm -fr *.cm* *.a *.o *.so *~ $(DISTNAME).tar.gz $(DISTNAME).zip $(DISTNAME) META