include ../build/win32/make.mingw
-# Possibly override GLib version in build\win32\module.defs
-GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
-
################################################################
# Nothing much configurable below
-INCLUDES = -I .. -I .
-DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=g_log_domain_gmodule -DG_ENABLE_DEBUG
-
-BUILD_DLL = ../build-dll
+INCLUDES = -I .. -I ../glib -I .
+DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"GModule\" -DG_ENABLE_DEBUG
all : \
gmoduleconf.h \
- gmodule-$(GLIB_VER).dll \
- testgmodule.exe
-
-makefile.mingw: makefile.mingw.in
- sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
- -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
+ libgmodule-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.a \
+ testgmodule.exe \
+ libgplugin_a.dll libgplugin_b.dll
gmodule_OBJECTS = \
gmodule.o
gmoduleconf.h: gmoduleconf.h.win32
cp $< $@
-gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule.def
- $(BUILD_DLL) gmodule $(GLIB_VER) gmodule.def $(gmodule_OBJECTS) -L .. -lglib-$(GLIB_VER)
+################ The gmodule DLL
+
+libgmodule-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.a : $(gmodule_OBJECTS) gmodule.def gmodule-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.rc
+ $(BUILD_DLL) gmodule-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ @LT_CURRENT:@LT_REVISION@:@LT_AGE@ $(CFLAGS) gmodule.def $(gmodule_OBJECTS) -L ../glib -lglib-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
+gmodule-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.rc : gmodule.rc
+ cp $< $@
################ test prog
-testgmodule.exe : gmodule-$(GLIB_VER).dll testgmodule.o libgplugin_a.dll libgplugin_b.dll
-# Wow, do we really have to do it like this to get some symbols
-# exported from a .exe? Apparently yes. Does the __declspec(dllexport)
-# actually do anything in gcc?
- $(CC) $(CFLAGS) -Wl,--base-file,testgmodule.base -o testgmodule.exe testgmodule.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER) $(LDFLAGS)
- $(DLLTOOL) --base-file testgmodule.base --output-exp testgmodule.exp testgmodule.o
- $(CC) $(CFLAGS) -Wl,--base-file,testgmodule.base,testgmodule.exp -o testgmodule.exe testgmodule.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER) $(LDFLAGS)
- $(DLLTOOL) --base-file testgmodule.base --output-exp testgmodule.exp testgmodule.o
- $(CC) $(CFLAGS) -Wl,testgmodule.exp -o testgmodule.exe testgmodule.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER) $(LDFLAGS)
+testgmodule.exe : libgmodule-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.a testgmodule.o
+# We have to generate an .exp file separately with dlltool, and link
+# with that. Sigh.
+ dlltool --output-exp testgmodule.exp testgmodule.o
+ $(CC) $(CFLAGS) -o testgmodule.exe testgmodule.o testgmodule.exp -L ../glib -lglib-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ -L . -lgmodule-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ $(LFLAGS)
libgplugin_a.dll : libgplugin_a.o
- $(BUILD_DLL) libgplugin_a - - libgplugin_a.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER)
+ $(BUILD_DLL) libgplugin_a - libgplugin_a.o -L ../glib -lglib-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ -L . -lgmodule-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
libgplugin_b.dll : libgplugin_b.o
- $(BUILD_DLL) libgplugin_b - - libgplugin_b.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER)
+ $(BUILD_DLL) libgplugin_b - libgplugin_b.o -L ../glib -lglib-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ -L . -lgmodule-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
+################ Other stuff
+
+clean::
+ -rm gmoduleconf.h