2 # Makefile for lablgtk.
4 TARGETS = varcc 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
85 GTKOBJS = ml_gtk.o ml_gtkbin.o ml_gtkbutton.o ml_gtkedit.o ml_gtklist.o \
86 ml_gtkmenu.o ml_gtkmisc.o ml_gtknew.o ml_gtkpack.o ml_gtkrange.o \
88 COBJS = ml_gdk.o ml_glib.o wrappers.o $(GTKOBJS)
89 MLOBJS = gaux.cmo gpointer.cmo glib.cmo gdk.cmo gdkEvent.cmo gdkKeysyms.cmo \
90 gtk.cmo gtkArgv.cmo gtkSignal.cmo \
91 gtkData.cmo gtkBase.cmo gtkPack.cmo gtkButton.cmo \
92 gtkMenu.cmo gtkMisc.cmo gtkWindow.cmo gtkTree.cmo gtkList.cmo \
93 gtkBin.cmo gtkEdit.cmo gtkRange.cmo gtkMain.cmo gtkNew.cmo \
95 gObj.cmo gMain.cmo gData.cmo gContainer.cmo gPack.cmo gButton.cmo \
96 gMenu.cmo gMisc.cmo gWindow.cmo gTree.cmo gList.cmo gBin.cmo \
97 gEdit.cmo gRange.cmo gUtil.cmo
98 THOBJS = gtkThread.cmo
99 INITOBJS = gtkInit.cmo
100 THINITOBJS = gtkThInit.cmo
101 ALLOBJS = $(MLOBJS) $(GLMLOBJS) $(GNOMEMLOBJS) $(THOBJS) \
102 $(INITOBJS) $(THINITOBJS)
104 lablgtktop: $(CLIBS) $(MLLIBS) $(INITOBJS)
105 $(TOPLEVEL) -o $@ $(MLLINK) -ccopt -L. $(MLLIBS) $(INITOBJS)
107 lablgtktop_t: $(CLIBS) $(MLLIBS) $(THOBJS) $(INITOBJS) $(THINITOBJS)
108 $(TOPLEVEL) $(THFLAGS) -o $@ $(THLINK) $(MLLINK) \
109 -ccopt -L. $(MLLIBS) $(THOBJS) $(INITOBJS) $(THINITOBJS)
111 lablgtk: Makefile config.make lablgtk.in
112 sed -e "s|@INSTALLDIR@|$(INSTALLDIR)|g" \
113 -e "s|@LABLGLDIR@|$(LABLGLDIR)|g" \
114 -e "s|@LIBDIR@|$(LIBDIR)|g" \
118 lablgtkrun: $(CLIBS) $(MLLIBS)
119 $(LINKER) -o $@ -make-runtime $(MLLINK) -ccopt -L. $(MLLIBS)
121 lablgtkopt: $(CLIBS) $(MLLIBS:.cma=.cmxa) $(INITOBJS:.cmo=.cmx) \
125 if test -d $(INSTALLDIR); then : ; else mkdir -p $(INSTALLDIR); fi
126 cp $(ALLOBJS:.cmo=.cmi) $(INSTALLDIR)
127 cp *.mli $(INSTALLDIR)
129 cp $(ALLOBJS:.cmo=.ml) $(INSTALLDIR)
130 cp $(MLLIBS) $(THOBJS) $(INITOBJS) $(THINITOBJS) $(INSTALLDIR)
131 cp $(CLIBS) $(INSTALLDIR)
132 cp lablgtktop lablgtktop_t $(INSTALLDIR)
133 cp lablgtk lablgtkrun $(BINDIR)
134 if test -f lablgtk.cmxa; then \
135 cp $(MLLIBS:.cma=.cmxa) $(MLLIBS:.cma=.a) \
136 $(INITOBJS:.cmo=.cmx) $(INITOBJS:.cmo=.o) $(INSTALLDIR); fi
137 if test -f gtkThread.cmx; then \
138 cp $(THOBJS:.cmo=.cmx) $(THOBJS:.cmo=.o) $(INSTALLDIR); fi
140 liblablgtk.a: $(COBJS)
143 lablgtk.cma: $(MLOBJS)
144 $(LINKER) -a -custom -o $@ $(MLOBJS) \
145 -cclib -llablgtk $(GTKLIBS)
146 lablgtk.cmxa: $(MLOBJS:.cmo=.cmx)
147 $(LINKOPT) -a -o $@ $(MLOBJS:.cmo=.cmx) \
148 -cclib -llablgtk $(GTKLIBS)
150 liblablgtkgl.a: $(GLCOBJS)
153 lablgtkgl.cma: $(GLMLOBJS)
154 $(LINKER) -a -custom -o $@ $(GLLINK) $(GLMLOBJS)
155 lablgtkgl.cmxa: $(GLMLOBJS:.cmo=.cmx)
156 $(LINKOPT) -a -o $@ $(GLLINK) $(GLMLOBJS:.cmo=.cmx)
158 liblablgnome.a: $(GNOMECOBJS)
159 ar rc $@ $(GNOMECOBJS)
161 lablgnome.cma: $(GNOMEMLOBJS)
162 $(LINKER) -a -custom -o $@ $(GNOMEMLOBJS) \
163 -cclib -llablgnome $(GNOMELIBS)
164 lablgnome.cmxa: $(GNOMEMLOBJS:.cmo=.cmx)
165 $(LINKOPT) -a -o $@ $(GNOMEMLOBJS:.cmo=.cmx) \
166 -cclib -llablgnome $(GNOMELIBS)
168 gtkThread.cmo: gtkThread.ml
169 $(COMPILER) $(THFLAGS) gtkThread.ml
171 gtkThread.cmx: gtkThread.ml
172 if test -f $(LIBDIR)/libthreadsnat.a; then \
173 $(COMPOPT) $(THFLAGS) gtkThread.ml; fi
176 $(LINKER) -o $@ varcc.cmo
177 rm -f *_tags.h *_tags.c
180 rm -f *.cm* *.o *.a *_tags.[ch] $(TARGETS)
182 $(GTKOBJS): gtk_tags.h ml_gtk.h ml_gdk.h wrappers.h
183 ml_gdk.o: gdk_tags.h ml_gdk.h wrappers.h
184 ml_gtkgl.o: gtkgl_tags.h ml_gtk.h ml_gdk.h wrappers.h
185 ml_gtkxmhtml.o: gtkxmhtml_tags.h ml_gtk.h ml_gdk.h wrappers.h