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)
92 glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
93 $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
95 glibconfig.h: glibconfig.h.win32
96 copy glibconfig.h.win32 glibconfig.h
98 config.h: config.h.win32
99 copy config.h.win32 config.h
102 $(CC) $(CFLAGS) -GD -c -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $<
105 $(CC) $(CFLAGS) -GD -E -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $< >$@
110 gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule\gmodule.def
111 $(CC) $(CFLAGS) -LD -Fegmodule-$(GLIB_VER).dll $(gmodule_OBJECTS) glib-$(GLIB_VER).lib $(LDFLAGS) /def:gmodule\gmodule.def
113 gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c
114 $(CC) $(CFLAGS) -GD -Igmodule -c -DG_LOG_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c
116 gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
117 copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
122 gthread-$(GLIB_VER).dll : $(gthread_OBJECTS) gthread\gthread.def
123 $(CC) $(CFLAGS) -LD -Fegthread-$(GLIB_VER).dll $(gthread_OBJECTS) glib-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS) /def:gthread\gthread.def
125 gthread-impl.obj : gthread\gthread-impl.c gthread\gthread-posix.c
126 $(CC) $(CFLAGS) -GD $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread\gthread-impl.c
128 testglib.exe : glib-$(GLIB_VER).dll testglib.obj
129 $(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
131 testglib.obj : testglib.c
132 $(CC) -c $(CFLAGS) testglib.c
134 testgdate.exe : glib-$(GLIB_VER).dll testgdate.obj
135 $(CC) $(CFLAGS) -Fetestgdate.exe testgdate.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
137 testgdate.obj : testgdate.c
138 $(CC) -c $(CFLAGS) testgdate.c
140 testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.obj
141 $(CC) $(CFLAGS) -Fetestgdateparser.exe testgdateparser.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
143 testgdateparser.obj : testgdateparser.c
144 $(CC) -c $(CFLAGS) testgdateparser.c
146 testgmodule.exe : glib-$(GLIB_VER).dll gmodule-$(GLIB_VER).dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll
147 $(CC) $(CFLAGS) testgmodule.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
149 testgmodule.obj : gmodule\testgmodule.c
150 $(CC) $(CFLAGS) -Igmodule -c gmodule\testgmodule.c
152 libgplugin_a.dll : libgplugin_a.obj
153 $(CC) $(CFLAGS) -LD libgplugin_a.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS)
155 libgplugin_a.obj : gmodule\libgplugin_a.c
156 $(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_a.c
158 libgplugin_b.dll : libgplugin_b.obj
159 $(CC) $(CFLAGS) -LD libgplugin_b.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS)
161 libgplugin_b.obj : gmodule\libgplugin_b.c
162 $(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_b.c
167 del gmodule\gmoduleconf.h