makefile.msc.in 3.05 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
	testglib.exe	\
34
	testgdate.exe	\
35
	testgdateparser.exe
36 37

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

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

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

80 81 82
config.h: config.h.win32
	copy config.h.win32 config.h

83 84 85
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 >$@
86

87
################ glib
88

89 90
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
91

92
################ subdirectories
93

94 95 96 97
sub-gmodule :
	cd gmodule
	-$(MAKE) -f makefile.msc all
	cd ..
98

99 100 101 102
sub-gthread :
	cd gthread
	-$(MAKE) -f makefile.msc all
	cd ..
103

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

109
################ test progs
110

111 112
testglib.obj : testglib.c
	$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" testglib.c
113

114
testglib.exe : glib-$(GLIB_VER).dll testglib.obj
115
	$(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
116

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

120 121 122
testgdate.exe : glib-$(GLIB_VER).dll testgdate.obj
	$(CC) $(CFLAGS) -Fetestgdate.exe testgdate.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console

123 124
testgdateparser.obj : testgdateparser.c
	$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" testgdateparser.c
125 126 127 128

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

129
################ other stuff
130

131
clean::
132 133
	del config.h
	del glibconfig.h
134 135 136 137 138 139 140 141 142
	cd gmodule
	$(MAKE) -f makefile.msc clean
	cd ..
	cd gthread
	$(MAKE) -f makefile.msc clean
	cd ..
	cd gobject
	$(MAKE) -f makefile.msc clean
	cd ..