2 # Makefile for lablgtk.
4 TARGETS = var2conv var2def lablgtktop lablgtktop_t lablgtkrun lablgtk
12 @$(MAKE) --no-print-directory -f configure.mk
16 @$(MAKE) --no-print-directory -f configure.mk .depend
19 @$(MAKE) --no-print-directory -f configure.mk
21 COMPILER = $(CAMLC) $(MLFLAGS) -w s -labels -c
22 LINKER = $(CAMLC) $(MLFLAGS)
23 COMPOPT = $(CAMLOPT) $(MLFLAGS) -w s -labels -c
24 LINKOPT = $(CAMLOPT) $(MLFLAGS)
25 TOPLEVEL = ocamlmktop $(MLFLAGS)
29 INSTALLDIR = $(LIBDIR)/lablgtk
30 LABLGLDIR = $(LIBDIR)/lablGL
34 MLLINK = unix.cma str.cma
37 CFLAGS = -g $(GTKCFLAGS)
38 MLLINK += -cclib -lcamlrund
41 CFLAGS = -O -DGTK_NO_CHECK_CASTS -DGTK_DISABLE_COMPAT_H $(GTKCFLAGS)
45 THLINK = unix.cma threads.cma
48 CCOMPILER = $(CC) -c -I$(LIBDIR) $(CFLAGS)
50 CCOMPILER = ocamlc -c -ccopt "$(CFLAGS)"
54 MLFLAGS += -I $(LABLGLDIR)
56 MLLIBS += lablgtkgl.cma
57 CLIBS += liblablgtkgl.a
58 GLLINK = -cclib -llablgtkgl -cclib -lgtkgl
65 MLLIBS += lablgnome.cma
66 CLIBS += liblablgnome.a
67 GNOMEMLOBJS = gtkXmHTML.cmo gHtml.cmo
68 GNOMECOBJS = ml_gtkxmhtml.o
72 .SUFFIXES: .ml .mli .cmo .cmi .cmx .c .o .var .h .opt .def
87 COBJS = ml_gtk.o ml_gdk.o ml_glib.o wrappers.o
88 MLOBJS = gaux.cmo gpointer.cmo glib.cmo gdk.cmo gdkEvent.cmo gdkKeysyms.cmo \
89 gtk.cmo gtkArgv.cmo gtkSignal.cmo \
90 gtkData.cmo gtkBase.cmo gtkPack.cmo gtkButton.cmo \
91 gtkMenu.cmo gtkMisc.cmo gtkWindow.cmo gtkTree.cmo gtkList.cmo \
92 gtkBin.cmo gtkEdit.cmo gtkRange.cmo gtkMain.cmo gtkNew.cmo \
94 gObj.cmo gMain.cmo gData.cmo gContainer.cmo gPack.cmo gButton.cmo \
95 gMenu.cmo gMisc.cmo gWindow.cmo gTree.cmo gList.cmo gBin.cmo \
96 gEdit.cmo gRange.cmo gUtil.cmo
97 THOBJS = gtkThread.cmo
98 INITOBJS = gtkInit.cmo
99 THINITOBJS = gtkThInit.cmo
100 ALLOBJS = $(MLOBJS) $(GLMLOBJS) $(GNOMEMLOBJS) $(THOBJS) \
101 $(INITOBJS) $(THINITOBJS)
103 lablgtktop: $(CLIBS) $(MLLIBS) $(INITOBJS)
104 $(TOPLEVEL) -o $@ $(MLLINK) -ccopt -L. $(MLLIBS) $(INITOBJS)
106 lablgtktop_t: $(CLIBS) $(MLLIBS) $(THOBJS) $(INITOBJS) $(THINITOBJS)
107 $(TOPLEVEL) $(THFLAGS) -o $@ $(THLINK) $(MLLINK) \
108 -ccopt -L. $(MLLIBS) $(THOBJS) $(INITOBJS) $(THINITOBJS)
110 lablgtk: Makefile config.make lablgtk.in
111 sed -e "s|@INSTALLDIR@|$(INSTALLDIR)|g" \
112 -e "s|@LABLGLDIR@|$(LABLGLDIR)|g" \
113 -e "s|@LIBDIR@|$(LIBDIR)|g" \
117 lablgtkrun: $(CLIBS) $(MLLIBS)
118 $(LINKER) -o $@ -make-runtime $(MLLINK) -ccopt -L. $(MLLIBS)
120 lablgtkopt: $(CLIBS) $(MLLIBS:.cma=.cmxa) $(INITOBJS:.cmo=.cmx) \
124 if test -d $(INSTALLDIR); then : ; else mkdir -p $(INSTALLDIR); fi
125 cp $(ALLOBJS:.cmo=.cmi) $(INSTALLDIR)
126 cp *.mli $(INSTALLDIR)
128 cp $(ALLOBJS:.cmo=.ml) $(INSTALLDIR)
129 cp $(MLLIBS) $(THOBJS) $(INITOBJS) $(THINITOBJS) $(INSTALLDIR)
130 cp $(CLIBS) $(INSTALLDIR)
131 cp lablgtktop lablgtktop_t $(INSTALLDIR)
132 cp lablgtk lablgtkrun $(BINDIR)
133 if test -f lablgtk.cmxa; then \
134 cp $(MLLIBS:.cma=.cmxa) $(MLLIBS:.cma=.a) \
135 $(INITOBJS:.cmo=.cmx) $(INITOBJS:.cmo=.o) $(INSTALLDIR); fi
136 if test -f gtkThread.cmx; then \
137 cp $(THOBJS:.cmo=.cmx) $(THOBJS:.cmo=.o) $(INSTALLDIR); fi
139 liblablgtk.a: $(COBJS)
142 lablgtk.cma: $(MLOBJS)
143 $(LINKER) -a -custom -o $@ $(MLOBJS) \
144 -cclib -llablgtk $(GTKLIBS)
145 lablgtk.cmxa: $(MLOBJS:.cmo=.cmx)
146 $(LINKOPT) -a -o $@ $(MLOBJS:.cmo=.cmx) \
147 -cclib -llablgtk $(GTKLIBS)
149 liblablgtkgl.a: $(GLCOBJS)
152 lablgtkgl.cma: $(GLMLOBJS)
153 $(LINKER) -a -custom -o $@ $(GLLINK) $(GLMLOBJS)
154 lablgtkgl.cmxa: $(GLMLOBJS:.cmo=.cmx)
155 $(LINKOPT) -a -o $@ $(GLLINK) $(GLMLOBJS:.cmo=.cmx)
157 liblablgnome.a: $(GNOMECOBJS)
158 ar rc $@ $(GNOMECOBJS)
160 lablgnome.cma: $(GNOMEMLOBJS)
161 $(LINKER) -a -custom -o $@ $(GNOMEMLOBJS) \
162 -cclib -llablgnome $(GNOMELIBS)
163 lablgnome.cmxa: $(GNOMEMLOBJS:.cmo=.cmx)
164 $(LINKOPT) -a -o $@ $(GNOMEMLOBJS:.cmo=.cmx) \
165 -cclib -llablgnome $(GNOMELIBS)
167 gtkThread.cmo: gtkThread.ml
168 $(COMPILER) $(THFLAGS) gtkThread.ml
170 gtkThread.cmx: gtkThread.ml
171 if test -f $(LIBDIR)/libthreadsnat.a; then \
172 $(COMPOPT) $(THFLAGS) gtkThread.ml; fi
174 var2conv: var2conv.cmo
175 $(LINKER) -o $@ var2conv.cmo
179 $(LINKER) -o $@ var2def.cmo
183 rm -f *.cm* *.o *.a *_tags.[ch] $(TARGETS)
185 ml_gtk.o: gtk_tags.c gtk_tags.h ml_gtk.h ml_gdk.h wrappers.h
186 ml_gdk.o: gdk_tags.c gdk_tags.h ml_gdk.h wrappers.h
187 ml_gtkgl.o: gtkgl_tags.c gtkgl_tags.h ml_gtk.h ml_gdk.h wrappers.h
188 ml_gtkxmhtml.o: gtkxmhtml_tags.c gtkxmhtml_tags.h ml_gtk.h ml_gdk.h wrappers.h