makefile.msc.in 3.5 KB
Newer Older
1
## Makefile for building the GLib dlls with Microsoft C
2
## Use: nmake -f makefile.msc
3

4
TOP = ..
5

Hans Breuer's avatar
updated  
Hans Breuer committed
6
!INCLUDE $(TOP)\build\win32\make.msc
7

8 9
# Possibly override GLib version in build\win32\module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
10

11
################################################################
12

13
# Nothing much configurable below
14

15
INCLUDES = -I .
16
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib -DG_ENABLE_DEBUG
17
DEPCFLAGS = $(INTL_CFLAGS) $(LIBICONV_CFLAGS)
18

Tor Lillqvist's avatar
Tor Lillqvist committed
19
DLLS_TO_BUILD =			\
20
	glib-$(GLIB_VER).dll	\
Tor Lillqvist's avatar
Tor Lillqvist committed
21 22
	sub-gmodule		\
	sub-gthread		\
23
	sub-gobject
24

Tor Lillqvist's avatar
Tor Lillqvist committed
25 26 27
all :				\
	config.h		\
	glibconfig.h		\
28
	glib-$(GLIB_VER)s.lib \
Tor Lillqvist's avatar
Tor Lillqvist committed
29 30 31 32
	$(DLLS_TO_BUILD)	\
	gspawn-win32-helper.exe	\
	testglib.exe		\
	testgdate.exe		\
33
	testgdateparser.exe
34

Tor Lillqvist's avatar
Tor Lillqvist committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
glib_OBJECTS =			\
	garray.obj		\
	gasyncqueue.obj		\
	gbacktrace.obj		\
	gcache.obj		\
	gcompletion.obj		\
	gconvert.obj		\
	gdataset.obj		\
	gdate.obj		\
	gerror.obj		\
	gfileutils.obj		\
	ghash.obj		\
	ghook.obj		\
	giochannel.obj		\
	giowin32.obj		\
	glist.obj		\
	gmain.obj		\
Tor Lillqvist's avatar
Tor Lillqvist committed
52
	gmarkup.obj		\
Tor Lillqvist's avatar
Tor Lillqvist committed
53 54 55 56
	gmem.obj		\
	gmessages.obj		\
	gnode.obj		\
	gprimes.obj		\
Tor Lillqvist's avatar
Tor Lillqvist committed
57
	gqsort.obj		\
Tor Lillqvist's avatar
Tor Lillqvist committed
58
	gqueue.obj		\
Hans Breuer's avatar
updated  
Hans Breuer committed
59
	gpattern.obj	\
Tor Lillqvist's avatar
Tor Lillqvist committed
60 61 62 63 64 65 66 67 68 69 70 71
	grand.obj		\
	grel.obj		\
	gscanner.obj		\
	gshell.obj		\
	gslist.obj		\
	gspawn-win32.obj	\
	gstrfuncs.obj		\
	gstring.obj		\
	gthread.obj		\
	gthreadpool.obj		\
	gtimer.obj		\
	gtree.obj		\
72
	gunibreak.obj		\
Tor Lillqvist's avatar
Tor Lillqvist committed
73 74 75 76
	gunidecomp.obj		\
	guniprop.obj		\
	gutf8.obj		\
	gutils.obj		\
77
	gwin32.obj
78 79 80 81

glibconfig.h: glibconfig.h.win32
	copy glibconfig.h.win32 glibconfig.h

82 83 84
config.h: config.h.win32
	copy config.h.win32 config.h

85 86 87
makefile.msc: makefile.msc.in
	$(SED) -e s,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@, \
	       -e s,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@, <makefile.msc.in >$@
88

89
################ glib
90

91 92 93 94 95 96
# create a static libary
glib-$(GLIB_VER)s.lib : $(glib_OBJECTS)
	lib /out:glib-$(GLIB_VER)s.lib $(glib_OBJECTS)

# $(LIBICONV_LIBS) is a runtime dependency now

97
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
98
	$(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) $(INTL_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
99

Tor Lillqvist's avatar
Tor Lillqvist committed
100
gspawn-win32-helper.exe : gspawn-win32-helper.c glib-$(GLIB_VER).dll
101
	$(CC) $(CFLAGS) -Fe$@ -DG_LOG_DOMAIN=\"gspawn-win32-helper\" gspawn-win32-helper.c glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:windows user32.lib
102

103
################ subdirectories
104

105 106 107 108
sub-gmodule :
	cd gmodule
	-$(MAKE) -f makefile.msc all
	cd ..
109

110 111 112 113
sub-gthread :
	cd gthread
	-$(MAKE) -f makefile.msc all
	cd ..
114

115 116 117 118
sub-gobject :
	cd gobject
	-$(MAKE) -f makefile.msc all
	cd ..
119

120
################ test progs
121

122 123
testglib.obj : testglib.c
	$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" testglib.c
124

125
testglib.exe : glib-$(GLIB_VER).dll testglib.obj
126
	$(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
127

128 129
testgdate.obj : testgdate.c
	$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdate\" testgdate.c
130

131 132 133
testgdate.exe : glib-$(GLIB_VER).dll testgdate.obj
	$(CC) $(CFLAGS) -Fetestgdate.exe testgdate.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console

134 135
testgdateparser.obj : testgdateparser.c
	$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" testgdateparser.c
136 137 138 139

testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.obj
	$(CC) $(CFLAGS) -Fetestgdateparser.exe testgdateparser.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console

140
################ other stuff
141

142
clean::
143 144
	del config.h
	del glibconfig.h
145 146 147 148 149 150 151 152 153
	cd gmodule
	$(MAKE) -f makefile.msc clean
	cd ..
	cd gthread
	$(MAKE) -f makefile.msc clean
	cd ..
	cd gobject
	$(MAKE) -f makefile.msc clean
	cd ..