File: Makefile

package info (click to toggle)
cothreads 0.10-7
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 500 kB
  • sloc: ml: 1,963; makefile: 216
file content (63 lines) | stat: -rw-r--r-- 1,545 bytes parent folder | download | duplicates (4)
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
include ../../Makefile.template

INCLUDES= -I  threads -I ..

BACKEND = threads

AUXMOD = libext
AUXMODBYT = $(AUXMOD:%=%.cmo)
ifeq ($(NATIVE),yes)
AUXMODNAT = $(AUXMOD:%=%.cmx)
endif

COMMONMOD = thread mutex condition event
ifeq ($(NATIVE),yes)
COMMONMODNAT =  $(COMMONMOD:%=%.cmx)
COMMONMODNATA = $(COMMONMOD:%=%.o)
endif

EXTRAMOD = cothread stm
EXTRAMODBYT = $(EXTRAMOD:%=%.cmo)
ifeq ($(NATIVE),yes)
EXTRAMODNAT = $(EXTRAMOD:%=%.cmx)
endif
EXTRAMODINTFSRC = $(EXTRAMOD:%=%.mli)
EXTRAMODINTFCOM = $(EXTRAMOD:%=%.cmi)
EXTRAMODINTF = $(EXTRAMODINTFSRC) $(EXTRAMODINTFCOM)

LIB = cothreads
LIBBYT = $(LIB:%=%.cma)
ifeq ($(NATIVE),yes)
LIBNAT = $(LIB:%=%.cmxa)
LIBNATA = $(LIB:%=%.a)
endif

INSTALLDIR = $(INSTALLLIBDIR)/$(BACKEND)
INSTALLFILES = $(EXTRAMODINTFCOM) $(EXTRAMODNAT) $(LIBBYT) $(LIBNAT) $(LIBNATA)

$(EXTRAMODINTF):%:../%
	@if [ ! -e $@ -a -e $< ]; then ln -s $< .; fi

$(COMMONMODNAT): %: $(OCAMLSTDLIBPATH)/threads/%
	@if [ ! -e $@ -a -e $< ]; then ln -s $< .; fi

$(COMMONMODNATA):$(OCAMLSTDLIBPATH)/threads/threads.a
	$(AR) -x $<

$(LIBBYT): $(EXTRAMODBYT)
	$(OCAMLC) -a -o $@ threads.cma $(AUXMODBYT) $ 
$(LIBNAT): $(COMMONMODNAT) $(COMMONMODNATA) $(EXTRAMODNAT) 
	$(OCAMLOPT) -a -o $@ $(COMMONMODNAT) $(AUXMODNAT) $(EXTRAMODNAT) -cclib -lthreadsnat -cclib -lunix -cclib -lpthread

.PHONY: all install clean uninstall

all: $(EXTRAMODINTF) $(LIBBYT) $(LIBNAT)

install: all
	$(MKDIR) $(INSTALLDIR)
	$(CP) $(INSTALLFILES) $(INSTALLDIR)

clean: ocamlclean

uninstall:
	for i in $(INSTALLFILES); do $(RM) $(INSTALLDIR)/$$i; done