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-05-30 snapshot.
11 PTHREADS = ..\pthreads-snap-1999-05-30
12 PTHREAD_LIB = $(PTHREADS)\pthread.lib
13 PTHREAD_INC = -I $(PTHREADS)
15 ################################################################
17 # Nothing much configurable below
29 # cl -? describes the options
30 CC = cl -G5 -GF $(OPTIMIZE) -W3 -nologo
32 # No general LDFLAGS needed
33 LDFLAGS = /link $(LINKDEBUG)
36 GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
38 CFLAGS = -I. -DHAVE_CONFIG_H
43 glib-$(GLIB_VER).dll \
44 gmodule\gmoduleconf.h \
45 gmodule-$(GLIB_VER).dll \
46 gthread-$(GLIB_VER).dll \
53 $(INSTALL) glib-$(GLIB_VER).dll $(BIN)
54 $(INSTALL) gmodule-$(GLIB_VER).dll $(BIN)
55 $(INSTALL) gthread-$(GLIB_VER).dll $(BIN)
86 glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
87 $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
89 glibconfig.h: glibconfig.h.win32
90 copy glibconfig.h.win32 glibconfig.h
92 config.h: config.h.win32
93 copy config.h.win32 config.h
96 $(CC) $(CFLAGS) -GD -c -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $<
101 gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule\gmodule.def
102 $(CC) $(CFLAGS) -LD -Fegmodule-$(GLIB_VER).dll $(gmodule_OBJECTS) glib-$(GLIB_VER).lib $(LDFLAGS) /def:gmodule\gmodule.def
104 gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c
105 $(CC) $(CFLAGS) -GD -Igmodule -c -DG_LOG_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c
107 gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
108 copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
113 gthread-$(GLIB_VER).dll : $(gthread_OBJECTS) gthread\gthread.def
114 $(CC) $(CFLAGS) -LD -Fegthread-$(GLIB_VER).dll $(gthread_OBJECTS) glib-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS) /def:gthread\gthread.def
116 gthread-impl.obj : gthread\gthread-impl.c gthread\gthread-posix.c
117 $(CC) $(CFLAGS) -GD $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread\gthread-impl.c
119 testglib.exe : glib-$(GLIB_VER).dll testglib.obj
120 $(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
122 testglib.obj : testglib.c
123 $(CC) -c $(CFLAGS) testglib.c
125 testgdate.exe : glib-$(GLIB_VER).dll testgdate.obj
126 $(CC) $(CFLAGS) -Fetestgdate.exe testgdate.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
128 testgdate.obj : testgdate.c
129 $(CC) -c $(CFLAGS) testgdate.c
131 testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.obj
132 $(CC) $(CFLAGS) -Fetestgdateparser.exe testgdateparser.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
134 testgdateparser.obj : testgdateparser.c
135 $(CC) -c $(CFLAGS) testgdateparser.c
137 testgmodule.exe : glib-$(GLIB_VER).dll gmodule-$(GLIB_VER).dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll
138 $(CC) $(CFLAGS) testgmodule.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
140 testgmodule.obj : gmodule\testgmodule.c
141 $(CC) $(CFLAGS) -Igmodule -c gmodule\testgmodule.c
143 libgplugin_a.dll : libgplugin_a.obj
144 $(CC) $(CFLAGS) -LD libgplugin_a.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS)
146 libgplugin_a.obj : gmodule\libgplugin_a.c
147 $(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_a.c
149 libgplugin_b.dll : libgplugin_b.obj
150 $(CC) $(CFLAGS) -LD libgplugin_b.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS)
152 libgplugin_b.obj : gmodule\libgplugin_b.c
153 $(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_b.c
158 del gmodule\gmoduleconf.h