File: Makefile

package info (click to toggle)
camlidl 1.05-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 872 kB
  • ctags: 1,131
  • sloc: ml: 4,894; ansic: 940; cpp: 897; makefile: 294; sh: 182
file content (65 lines) | stat: -rw-r--r-- 1,668 bytes parent folder | download | duplicates (6)
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
include ../config/Makefile

CAMLIDL=../compiler/camlidl
CAMLC=ocamlc -I ../lib
INCLUDES=-I.. -I$(OCAMLLIB)
CCPP=$(CC)
CPPFLAGS=$(CFLAGS)

TESTS=basics.idl arrays.idl structs.idl unions.idl typedefs.idl $(TESTS_$(OSTYPE))
TESTS_unix=unix.idl
COMLIBS=$(COMLIBS_$(OSTYPE))
COMLIBS_win32=advapi32.lib ole32.lib oleaut32.lib

all: ../caml/camlidlruntime.h $(TESTS:.idl=.$(OBJEXT)) testcomp

$(TESTS:.idl=.$(OBJEXT)) component.$(OBJEXT): $(CAMLIDL) ../runtime/camlidlruntime.h

unix.$(OBJEXT): unix.idl
	$(CAMLIDL) -no-include unix.idl
	$(CAMLC) -c unix.mli
	$(CAMLC) -c unix.ml
	$(CC) $(CFLAGS) $(INCLUDES) -c unix_stubs.c
	mv unix_stubs.$(OBJEXT) unix.$(OBJEXT)

testcomp: comcomp.$(OBJEXT) component.$(OBJEXT) component.cmo testcomponent.cmo \
          ../runtime/libcamlidl.$(LIBEXT)
	$(CAMLC) -cc $(CCPP) -custom -o testcomp \
                com.cmo comcomp.$(OBJEXT) component.$(OBJEXT) \
		component.cmo testcomponent.cmo \
                ../runtime/libcamlidl.$(LIBEXT) $(COMLIBS)

clean::
	rm -f testcomp

component.cmo testcomponent.cmo: component.cmi
component.cmo component.cmi: component.$(OBJEXT)

../caml/camlidlruntime.h:
	mkdir ../caml
	ln -s ../runtime/camlidlruntime.h ../caml

.SUFFIXES:
.SUFFIXES: .idl .$(OBJEXT) .cpp .ml .mli .cmo .cmi

.idl.$(OBJEXT):
	$(CAMLIDL) -header $*.idl
	$(CAMLC) -c $*.mli
	$(CAMLC) -c $*.ml
	$(CC) $(CFLAGS) $(INCLUDES) -c $*_stubs.c
	mv $*_stubs.$(OBJEXT) $*.$(OBJEXT)

.cpp.$(OBJEXT):
	$(CCPP) $(CPPFLAGS) $(INCLUDES) -c $*.cpp

.ml.cmo:
	$(CAMLC) -c $*.ml

.mli.cmi:
	$(CAMLC) -c $*.mli

clean::
	rm -f $(TESTS:.idl=.mli) $(TESTS:.idl=.ml) $(TESTS:.idl=.h) $(TESTS:.idl=_stubs.c)

clean::
	rm -f *.cm[io] *.$(OBJEXT)