2 # Makefile for lablgtk.
5 TARGETS = var2conv var2def lablgtk$(EXE) lablgtk_t$(EXE) \
6 lablgtkrun$(EXE) config.make
14 COMPILER = $(CAMLC) $(MLFLAGS) -w s -labels -c
15 LINKER = $(CAMLC) $(MLFLAGS)
16 COMPOPT = $(CAMLOPT) $(MLFLAGS) -w s -labels -c
17 LINKOPT = $(CAMLOPT) $(MLFLAGS)
19 TOPLEVEL = ocamlmktop $(MLFLAGS)
20 ### How to invoke the librarian
21 MKLIB=lib /nologo /debugtype:CV /out:
23 !include config.make.nt
25 INSTALLDIR = $(LIBDIR:/=\)\lablgtk
26 BINDIR = $(LIBDIR:/=\)\..\bin
27 LABLGLDIR = $(LIBDIR)/lablGL
29 CFLAGS = -O -DGTK_NO_CHECK_CASTS -DGTK_DISABLE_COMPAT_H $(GTKCFLAGS)
33 THLIBS = unix.cma threads.cma
36 CCOMPILER = $(CC) -c -I$(LIBDIR) $(CFLAGS)
38 CCOMPILER = ocamlc -c -ccopt "$(CFLAGS)"
42 MLFLAGS = $(MLFLAGS) -I $(LIBDIR)/lablGL
43 GLLINK = -I $(LABLGLDIR) lablgl.cma -cclib -lgtkgl
49 .SUFFIXES: .ml .mli .cmo .cmi .cmx .c .obj .var .h .opt .def
59 ocamlrun ./var2def < $< > $@
61 ocamlrun ./var2conv < $< > $@
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 \
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)
80 lablgtk$(EXE): liblablgtk.lib lablgtk.cma $(INITOBJS)
81 $(TOPLEVEL) -custom -o $@ unix.cma str.cma $(GLLINK) \
82 lablgtk.cma $(INITOBJS)
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)
88 lablgtkrun$(EXE): liblablgtk.lib lablgtk.cma
89 $(LINKER) -o $@ -make-runtime $(GLLINK) lablgtk.cma
91 lablgtkopt: liblablgtk.lib lablgtk.cmxa gtkInit.cmx
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)
103 liblablgtk.lib: $(COBJS)
106 lablgtk.cma: $(MLOBJS)
107 $(LINKER) -a -custom -o $@ $(MLOBJS) \
108 -cclib -llablgtk $(GTKLIBS)
110 lablgtk.cmxa: $(MLOBJS:.cmo=.cmx)
111 $(LINKOPT) -a -o $@ $(MLOBJS:.cmo=.cmx) \
112 -cclib -llablgtk $(GTKLIBS)
114 gtkThread.cmo: gtkThread.ml
115 $(COMPILER) $(THFLAGS) gtkThread.ml
117 threadObj.cmo: threadObj.ml
118 $(COMPILER) $(THFLAGS) threadObj.ml
120 gtkThread.cmx: gtkThread.ml
121 $(COMPOPT) $(THFLAGS) gtkThread.ml
123 threadObj.cmx: threadObj.ml
124 $(COMPOPT) $(THFLAGS) threadObj.ml
126 var2conv: var2conv.cmo
127 $(LINKER) -o $@ var2conv.cmo
131 $(LINKER) -o $@ var2def.cmo
135 rm -f *.cm* *.obj *.lib *_tags.[ch] $(TARGETS)
137 config.make: config.make.nt
138 cp config.make.nt config.make
141 ocamldep *.ml *.mli > .depend
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