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)
87 glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
88 $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
90 glibconfig.h: glibconfig.h.win32
91 copy glibconfig.h.win32 glibconfig.h
93 config.h: config.h.win32
94 copy config.h.win32 config.h
97 $(CC) $(CFLAGS) -GD -c -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $<
100 $(CC) $(CFLAGS) -GD -E -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $< >$@
105 gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule\gmodule.def
106 $(CC) $(CFLAGS) -LD -Fegmodule-$(GLIB_VER).dll $(gmodule_OBJECTS) glib-$(GLIB_VER).lib $(LDFLAGS) /def:gmodule\gmodule.def
108 gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c
109 $(CC) $(CFLAGS) -GD -Igmodule -c -DG_LOG_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c
111 gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
112 copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
117 gthread-$(GLIB_VER).dll : $(gthread_OBJECTS) gthread\gthread.def
118 $(CC) $(CFLAGS) -LD -Fegthread-$(GLIB_VER).dll $(gthread_OBJECTS) glib-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS) /def:gthread\gthread.def
120 gthread-impl.obj : gthread\gthread-impl.c gthread\gthread-posix.c
121 $(CC) $(CFLAGS) -GD $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread\gthread-impl.c
123 testglib.exe : glib-$(GLIB_VER).dll testglib.obj
124 $(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
126 testglib.obj : testglib.c
127 $(CC) -c $(CFLAGS) testglib.c
129 testgdate.exe : glib-$(GLIB_VER).dll testgdate.obj
130 $(CC) $(CFLAGS) -Fetestgdate.exe testgdate.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
132 testgdate.obj : testgdate.c
133 $(CC) -c $(CFLAGS) testgdate.c
135 testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.obj
136 $(CC) $(CFLAGS) -Fetestgdateparser.exe testgdateparser.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
138 testgdateparser.obj : testgdateparser.c
139 $(CC) -c $(CFLAGS) testgdateparser.c
141 testgmodule.exe : glib-$(GLIB_VER).dll gmodule-$(GLIB_VER).dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll
142 $(CC) $(CFLAGS) testgmodule.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
144 testgmodule.obj : gmodule\testgmodule.c
145 $(CC) $(CFLAGS) -Igmodule -c gmodule\testgmodule.c
147 libgplugin_a.dll : libgplugin_a.obj
148 $(CC) $(CFLAGS) -LD libgplugin_a.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS)
150 libgplugin_a.obj : gmodule\libgplugin_a.c
151 $(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_a.c
153 libgplugin_b.dll : libgplugin_b.obj
154 $(CC) $(CFLAGS) -LD libgplugin_b.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS)
156 libgplugin_b.obj : gmodule\libgplugin_b.c
157 $(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_b.c
162 del gmodule\gmoduleconf.h