1 ## Makefile for building the GLib, gmodule and gthread dlls with Microsoft C
2 ## Use: nmake -f makefile.msc install
4 # Change this to wherever you want to install the DLLs. This directory
5 # should be in your PATH.
8 # This is the location of pthreads for Win32,
9 # see http://sourceware.cygnus.com/pthreads-win32/
10 # We want the 1999-04-07 snapshot.
11 PTHREADS = ..\pthreads-snap-1999-04-07
12 PTHREAD_LIB = $(PTHREADS)\pthread.lib
13 PTHREAD_INC = -I$(PTHREADS)
15 ################################################################
17 # Nothing much configurable below
19 # cl -? describes the options
20 CC = cl -G5 -GF -Ox -W3 -MD -nologo
22 # No general LDFLAGS needed
26 GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
28 CFLAGS = -I. -DHAVE_CONFIG_H
33 glib-$(GLIB_VER).dll \
34 gmodule\gmoduleconf.h \
35 gmodule-$(GLIB_VER).dll \
36 gthread-$(GLIB_VER).dll \
44 $(INSTALL) glib-$(GLIB_VER).dll $(BIN)
45 $(INSTALL) gmodule-$(GLIB_VER).dll $(BIN)
46 $(INSTALL) gthread-$(GLIB_VER).dll $(BIN)
75 glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
76 $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
78 glibconfig.h: glibconfig.h.win32
79 copy glibconfig.h.win32 glibconfig.h
81 config.h: config.h.win32
82 copy config.h.win32 config.h
85 $(CC) $(CFLAGS) -GD -c -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $<
90 gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS)
91 $(CC) $(CFLAGS) -LD -Fegmodule-$(GLIB_VER).dll $(gmodule_OBJECTS) glib-$(GLIB_VER).lib $(LDFLAGS) /def:gmodule\gmodule.def
93 gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c
94 $(CC) $(CFLAGS) -GD -Igmodule -c -DG_LOG_DOMAIN=\"GModule\" gmodule\gmodule.c
96 gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
97 copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
102 gthread-$(GLIB_VER).dll : $(gthread_OBJECTS)
103 $(CC) $(CFLAGS) -LD -Fegthread-$(GLIB_VER).dll $(gthread_OBJECTS) glib-$(GLIB_VER).lib $(PTHREAD_LIB) glib-$(GLIB_VER).lib $(LDFLAGS) /def:gthread\gthread.def
105 gthread.obj : gthread\gthread.c gthread\gthread-posix.c
106 $(CC) $(CFLAGS) -GD $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread\gthread.c
108 testglib.exe : glib-$(GLIB_VER).dll testglib.obj
109 $(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
111 testglib.obj : testglib.c
112 $(CC) -c $(CFLAGS) testglib.c
114 testgdate.exe : glib-$(GLIB_VER).dll testgdate.obj
115 $(CC) $(CFLAGS) -Fetestgdate.exe testgdate.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
117 testgdate.obj : testgdate.c
118 $(CC) -c $(CFLAGS) testgdate.c
120 testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.obj
121 $(CC) $(CFLAGS) -Fetestgdateparser.exe testgdateparser.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
123 testgdateparser.obj : testgdateparser.c
124 $(CC) -c $(CFLAGS) testgdateparser.c
126 testgmodule.exe : glib-$(GLIB_VER).dll gmodule-$(GLIB_VER).dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll
127 $(CC) $(CFLAGS) testgmodule.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
129 testgmodule.obj : gmodule\testgmodule.c
130 $(CC) $(CFLAGS) -Igmodule -c gmodule\testgmodule.c
132 libgplugin_a.dll : libgplugin_a.obj
133 $(CC) $(CFLAGS) -LD libgplugin_a.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS)
135 libgplugin_a.obj : gmodule\libgplugin_a.c
136 $(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_a.c
138 libgplugin_b.dll : libgplugin_b.obj
139 $(CC) $(CFLAGS) -LD libgplugin_b.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS)
141 libgplugin_b.obj : gmodule\libgplugin_b.c
142 $(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_b.c
144 testgthread.exe : glib-$(GLIB_VER).dll gthread-$(GLIB_VER).dll testgthread.obj
145 $(CC) $(CFLAGS) testgthread.obj glib-$(GLIB_VER).lib gthread-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS) /subsystem:console
147 testgthread.obj : gthread\testgthread.c
148 $(CC) $(CFLAGS) $(PTHREAD_INC) -c gthread\testgthread.c
153 del gmodule\gmoduleconf.h