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

4 5
# Change this to wherever you want to install the DLLs. This directory
# should be in your PATH.
6 7
BIN = C:\bin

8
TOP = ..
9

10
!INCLUDE $(TOP)\build\win32\make.msc
11

12 13
# Possibly override GLib version in build\win32\module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
14

15
################################################################
16

17
# Nothing much configurable below
18

19 20 21
INCLUDES = -I .
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib
DEPCFLAGS = $(LIBICONV_CFLAGS)
22

23 24 25 26 27
DLLS_TO_BUILD = \
 	glib-$(GLIB_VER).dll \
	sub-gmodule \
	sub-gthread \
	sub-gobject
28 29

all : \
30
	config.h	\
31 32
	glibconfig.h	\
	$(DLLS_TO_BUILD) \
33
	gspawn-win32-helper.exe \
34
	testglib.exe	\
35
	testgdate.exe	\
36
	testgdateparser.exe
37 38

install : all
39
	copy glib-$(GLIB_VER).dll $(BIN)
40 41 42

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

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

84 85 86
config.h: config.h.win32
	copy config.h.win32 config.h

87 88 89
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 >$@
90

91
################ glib
92

93 94
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
	$(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) $(LIBICONV_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
95

96
gspawn-win32-helper.exe : gspawn-win32.c glib-$(GLIB_VER).dll
97
	$(CC) $(CFLAGS) -Fe$@ -DGSPAWN_HELPER -DG_LOG_DOMAIN=\"gspawn-win32-helper\" gspawn-win32.c glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:windows user32.lib
98

99
################ subdirectories
100

101 102 103 104
sub-gmodule :
	cd gmodule
	-$(MAKE) -f makefile.msc all
	cd ..
105

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

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

116
################ test progs
117

118 119
testglib.obj : testglib.c
	$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" testglib.c
120

121
testglib.exe : glib-$(GLIB_VER).dll testglib.obj
122
	$(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
123

124 125
testgdate.obj : testgdate.c
	$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdate\" testgdate.c
126

127 128 129
testgdate.exe : glib-$(GLIB_VER).dll testgdate.obj
	$(CC) $(CFLAGS) -Fetestgdate.exe testgdate.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console

130 131
testgdateparser.obj : testgdateparser.c
	$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" testgdateparser.c
132 133 134 135

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

136
################ other stuff
137

138
clean::
139 140
	del config.h
	del glibconfig.h
141 142 143 144 145 146 147 148 149
	cd gmodule
	$(MAKE) -f makefile.msc clean
	cd ..
	cd gthread
	$(MAKE) -f makefile.msc clean
	cd ..
	cd gobject
	$(MAKE) -f makefile.msc clean
	cd ..