1 ## Makefile for building the gobject DLL with gcc for mingw. The build
2 ## uses tools running on cygwin, however.
4 ## Use: make -f makefile.mingw
8 include ../build/win32/make.mingw
10 # Possibly override GLib version in build/win32/module.defs
11 GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
13 ################################################################
15 # Nothing much configurable below
17 INCLUDES = -I .. -I ../glib -I .
18 DEFINES = -DHAVE_CONFIG_H -DGOBJECT_COMPILATION -DG_LOG_DOMAIN=g_log_domain_gruntime -DG_ENABLE_DEBUG
22 BUILD_DLL = ../build-dll
25 gobject-$(GLIB_VER).dll \
28 ifeq ($(wildcard makefile.mingw.in),makefile.mingw.in)
29 makefile.mingw: makefile.mingw.in
30 sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
31 -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' \
32 -e 's,@RE[B]UILD@,,' <$< >$@
52 gobject-$(GLIB_VER).dll : $(srcdir)/stamp-gmarshal.h gmarshal.c $(gobject_OBJECTS) gobject.def
53 $(BUILD_DLL) gobject $(GLIB_VER) gobject.def $(gobject_OBJECTS) -L .. -lglib-$(GLIB_VER)
55 glib-genmarshal.exe : glib-genmarshal.c
56 $(CC) -o $@ $(CFLAGS) -UGOBJECT_COMPILATION $< -L .. -lglib-$(GLIB_VER)
58 # Copied from Makefile.am:
59 # initial creation of the real stamp-* files
60 gmarshal.h: # never add deps here
61 test -f "$(srcdir)/$@" || touch $(srcdir)/$@
62 # normal autogeneration rules
63 # all autogenerated files need to be generated in the srcdir,
64 # so old versions get remade and are not confused with newer
65 # versions in the build dir. thus a development setup requires
66 # srcdir to be writable, passing --disable-rebuilds to
67 # ../configure will supress all autogeneration rules.
68 $(srcdir)/stamp-gmarshal.h: @REBUILD@ gmarshal.list gmarshal.h glib-genmarshal.exe
69 echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
70 && echo "#define __G_MARSHAL_H__" >> xgen-gmh \
71 && ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \
72 && echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
73 && (cmp -s xgen-gmh $(srcdir)/gmarshal.h || cp xgen-gmh $(srcdir)/gmarshal.h) \
74 && rm -f xgen-gmh xgen-gmh~ \
75 && echo timestamp > $@
76 $(srcdir)/gmarshal.c: @REBUILD@ $(srcdir)/stamp-gmarshal.h
77 ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --body >> xgen-gmc \
78 && cp xgen-gmc $(srcdir)/gmarshal.c \
79 && rm -f xgen-gmc xgen-gmc~
80 $(srcdir)/gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
81 grep '^[A-Z]' $(srcdir)/gmarshal.list \
82 | sed -e 's/^/"g_cclosure_marshal_/' -e 's/:/__/' -e 's/,/_/g' -e 's/$$/",/' > xgen-gms \
83 && cp xgen-gms $(srcdir)/gmarshal.strings \
84 && rm -f xgen-gms xgen-gms~
85 glib-genmarshal.o: gmarshal.strings
88 -rm gmarshal.h gmarshal.c stamp-gmarshal.h