6ae721404b50b7b111dd7a7b5658abe3f1dfa62b
[platform/upstream/glib.git] / gmodule / makefile.mingw.in
1 ## Makefile for building the gmodule DLL with gcc for mingw. The build
2 ## uses tools running on cygwin, however.
3
4 ## Use: make -f makefile.mingw
5
6 GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
7
8 TOP = ../..
9
10 include ../build/win32/make.mingw
11
12 ################################################################
13
14 # Nothing much configurable below
15
16 INCLUDES = -I .. -I .
17 DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=g_log_domain_gmodule
18
19 BUILD_DLL = ../build-dll
20
21 all : \
22         gmoduleconf.h \
23         gmodule-$(GLIB_VER).dll \
24         testgmodule.exe
25
26 makefile.mingw: makefile.mingw.in
27         sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
28             -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
29
30 gmodule_OBJECTS = \
31         gmodule.o
32
33 gmoduleconf.h: gmoduleconf.h.win32
34         cp $< $@
35
36
37 gmodule-win32res.o : gmodule.rc gmodule-build.tmp
38
39 gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule.def
40         $(BUILD_DLL) gmodule $(GLIB_VER) gmodule.def $(gmodule_OBJECTS) gmodule-win32res.o -L .. -lglib-$(GLIB_VER)
41
42 ################ test prog
43
44 testgmodule.exe : gmodule-$(GLIB_VER).dll testgmodule.o libgplugin_a.dll libgplugin_b.dll
45 # Wow, do we really have to do it like this to get some symbols
46 # exported from a .exe? Apparently yes. Does the __declspec(dllexport) 
47 # actually do anything in gcc?
48         $(CC) $(CFLAGS) -Wl,--base-file,testgmodule.base -o testgmodule.exe testgmodule.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER) $(LDFLAGS)
49         $(DLLTOOL) --base-file testgmodule.base --output-exp testgmodule.exp testgmodule.o
50         $(CC) $(CFLAGS) -Wl,--base-file,testgmodule.base,testgmodule.exp -o testgmodule.exe testgmodule.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER) $(LDFLAGS)
51         $(DLLTOOL) --base-file testgmodule.base --output-exp testgmodule.exp testgmodule.o
52         $(CC) $(CFLAGS) -Wl,testgmodule.exp -o testgmodule.exe testgmodule.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER) $(LDFLAGS)
53
54 libgplugin_a.dll : libgplugin_a.o
55         $(BUILD_DLL) libgplugin_a - - libgplugin_a.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER)
56
57 libgplugin_b.dll : libgplugin_b.o
58         $(BUILD_DLL) libgplugin_b - - libgplugin_b.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER)