]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/lablgtk/lablgtk_20000829-0.1.0/Makefile.nt
* implemented a more efficient selection to avoid flickering
[helm.git] / helm / DEVEL / lablgtk / lablgtk_20000829-0.1.0 / Makefile.nt
1 # $Id$
2 # Makefile for lablgtk.
3
4 EXE = .exe
5 TARGETS = var2conv var2def lablgtk$(EXE) lablgtk_t$(EXE) \
6         lablgtkrun$(EXE) config.make
7
8 all: $(TARGETS)
9
10 opt: lablgtkopt
11
12 CAMLC = ocamlc
13 CAMLOPT = ocamlopt
14 COMPILER = $(CAMLC) $(MLFLAGS) -w s -labels -c
15 LINKER = $(CAMLC) $(MLFLAGS)
16 COMPOPT = $(CAMLOPT) $(MLFLAGS) -w s -labels -c
17 LINKOPT = $(CAMLOPT) $(MLFLAGS)
18
19 TOPLEVEL = ocamlmktop $(MLFLAGS)
20 ### How to invoke the librarian
21 MKLIB=lib /nologo /debugtype:CV /out:
22
23 !include config.make.nt
24
25 INSTALLDIR = $(LIBDIR:/=\)\lablgtk
26 BINDIR = $(LIBDIR:/=\)\..\bin
27 LABLGLDIR = $(LIBDIR)/lablGL
28
29 CFLAGS = -O -DGTK_NO_CHECK_CASTS -DGTK_DISABLE_COMPAT_H $(GTKCFLAGS)
30 LDFLAGS = $(GTKLIBS)
31
32 THFLAGS = -thread
33 THLIBS = unix.cma threads.cma
34
35 !if $(USE_CC) == 1
36 CCOMPILER = $(CC) -c -I$(LIBDIR) $(CFLAGS)
37 !else
38 CCOMPILER = ocamlc -c -ccopt "$(CFLAGS)"
39 !endif
40
41 !if $(USE_GL) == 1
42 MLFLAGS = $(MLFLAGS) -I $(LIBDIR)/lablGL
43 GLLINK = -I $(LABLGLDIR) lablgl.cma -cclib -lgtkgl
44 GLMLOBJS = glGtk.cmo
45 GLCOBJS = ml_gtkgl.o
46 !endif
47
48 # Rules
49 .SUFFIXES: .ml .mli .cmo .cmi .cmx .c .obj .var .h .opt .def
50 .c.obj:
51         $(CCOMPILER) $<
52 .ml.cmo:
53         $(COMPILER) $<
54 .mli.cmi:
55         $(COMPILER) $<
56 .ml.cmx:
57         $(COMPOPT) $<
58 .var.h:
59         ocamlrun ./var2def < $< > $@
60 .var.c:
61         ocamlrun ./var2conv < $< > $@
62
63 # Targets
64 COBJS = ml_gtk.obj ml_gdk.obj ml_glib.obj wrappers.obj $(GLCOBJS)
65 OLDMLOBJS = misc.cmo glib.cmo gdk.cmo gtk.cmo gdkObj.cmo gtkObj.cmo gtkExt.cmo
66 MLOBJS = misc.cmo glib.cmo gdk.cmo gdkEvent.cmo gdkKeysyms.cmo \
67         gtk.cmo gtkArgv.cmo gtkSignal.cmo \
68         gtkData.cmo gtkBase.cmo gtkPack.cmo gtkButton.cmo \
69         gtkMenu.cmo gtkMisc.cmo gtkWindow.cmo gtkTree.cmo gtkList.cmo \
70         gtkFrame.cmo gtkEdit.cmo gtkRange.cmo gtkMain.cmo gtkNew.cmo \
71         gDraw.cmo \
72         gObj.cmo gMain.cmo gData.cmo gContainer.cmo gPack.cmo gButton.cmo \
73         gMenu.cmo gMisc.cmo gWindow.cmo gTree.cmo gList.cmo gFrame.cmo \
74         gEdit.cmo gRange.cmo gUtil.cmo $(GLMLOBJS)
75 THOBJS = gtkThread.cmo threadObj.cmo
76 INITOBJS = gtkInit.cmo
77 THINITOBJS = gtkThInit.cmo
78 ALLOBJS = $(MLOBJS) $(THOBJS) $(INITOBJS) $(THINITOBJS)
79
80 lablgtk$(EXE): liblablgtk.lib lablgtk.cma $(INITOBJS)
81         $(TOPLEVEL) -custom -o $@ unix.cma str.cma $(GLLINK) \
82             lablgtk.cma $(INITOBJS)
83
84 lablgtk_t$(EXE): liblablgtk.lib lablgtk.cma $(THOBJS) $(INITOBJS) $(THINITOBJS)
85         $(TOPLEVEL) -custom $(THFLAGS) -o $@ $(THLIBS) str.cma $(GLLINK) \
86             lablgtk.cma $(THOBJS) $(INITOBJS) $(THINITOBJS)
87
88 lablgtkrun$(EXE): liblablgtk.lib lablgtk.cma
89         $(LINKER) -o $@ -make-runtime $(GLLINK) lablgtk.cma
90
91 lablgtkopt: liblablgtk.lib lablgtk.cmxa gtkInit.cmx
92
93 install:
94         if not exist $(INSTALLDIR) mkdir $(INSTALLDIR)
95         cp $(ALLOBJS:.cmo=.cmi) $(INSTALLDIR)
96         cp *.mli $(INSTALLDIR)
97         cp $(ALLOBJS:.cmo=.ml) $(INSTALLDIR)
98         cp lablgtk.cma $(THOBJS) $(INITOBJS) $(THINITOBJS) $(INSTALLDIR)
99         cp liblablgtk.lib $(INSTALLDIR)
100         cp lablgtk$(EXE) lablgtk_t$(EXE) lablgtkrun$(EXE) $(BINDIR)
101         if exist lablgtk.cmxa cp lablgtk.cmxa lablgtk.lib gtkInit.cmx gtkInit.obj $(INSTALLDIR)
102
103 liblablgtk.lib: $(COBJS)
104         $(MKLIB)$@ $(COBJS)
105
106 lablgtk.cma: $(MLOBJS)
107         $(LINKER) -a -custom -o $@ $(MLOBJS) \
108           -cclib -llablgtk $(GTKLIBS)
109
110 lablgtk.cmxa: $(MLOBJS:.cmo=.cmx)
111         $(LINKOPT) -a -o $@ $(MLOBJS:.cmo=.cmx) \
112           -cclib -llablgtk $(GTKLIBS)
113
114 gtkThread.cmo: gtkThread.ml
115         $(COMPILER) $(THFLAGS) gtkThread.ml
116
117 threadObj.cmo: threadObj.ml
118         $(COMPILER) $(THFLAGS) threadObj.ml
119
120 gtkThread.cmx: gtkThread.ml
121         $(COMPOPT) $(THFLAGS) gtkThread.ml
122
123 threadObj.cmx: threadObj.ml
124         $(COMPOPT) $(THFLAGS) threadObj.ml
125
126 var2conv: var2conv.cmo
127         $(LINKER) -o $@ var2conv.cmo
128         rm -f *_tags.c
129
130 var2def: var2def.cmo
131         $(LINKER) -o $@ var2def.cmo
132         rm -f *_tags.h
133
134 clean:
135         rm -f *.cm* *.obj *.lib *_tags.[ch] $(TARGETS)
136
137 config.make: config.make.nt
138         cp config.make.nt config.make
139
140 depend .depend:
141         ocamldep *.ml *.mli > .depend
142
143 ml_gtk.obj: gtk_tags.c gtk_tags.h ml_gtk.h ml_gdk.h wrappers.h
144 ml_gdk.obj: gdk_tags.c gdk_tags.h ml_gdk.h wrappers.h
145 ml_gtkgl.obj: gtkgl_tags.c gtkgl_tags.h ml_gtk.h ml_gdk.h wrappers.h
146
147 !include .depend