glib/makefile.msc
Tor Lillqvist 2aa1277d60 Support added for building using a GNU toolchain on Win32,
i.e. gcc -mno-cygwin on cygwin (a.k.a. mingw32, using egcs-1.1.2).

	* README.win32: Updated.
	* build-dll makefile.cygwin tests/makefile.cygwin: New files.
	* glib.h glib.def glibconfig.h.win32 makefile.msc: Slight updates.
	* gmain.c: No need to include <fcntl.h> and <io.h> on Win32.
	* gmain.c gutils.c testglib.c tests/string-test.c: Test for
	NATIVE_WIN32, not _MSC_VER.
	* gmutex.c: Must declare g_thread_functions_for_glib_use as
	exported (using the GUTILS_C_VAR macro).
	* gutils.c gmodule/libgplugin_[ab].c: LibMain not needed.
	* gmodule/gmoduleconf.h.win32: Need underscore with gcc.
	* gthread/gthread.c: With gcc on Win32, must use memcpy to assign
	value of g_thread_functions_for_glib_use (?).
	* makefile.msc tests/makefile.msc: Cosmetics.
1999-04-24 13:52:51 +00:00

168 lines
4.6 KiB
Plaintext

## Makefile for building the GLib, gmodule and gthread dlls with Microsoft C
## Use: nmake -f makefile.msc install
# Change this to wherever you want to install the DLLs. This directory
# should be in your PATH.
BIN = C:\bin
# This is the location of pthreads for Win32,
# see http://sourceware.cygnus.com/pthreads-win32/
PTHREADS = ..\pthreads-snap-1999-04-07
PTHREAD_LIB = $(PTHREADS)\pthread.lib
PTHREAD_INC = -I $(PTHREADS)
################################################################
# Nothing much configurable below
# cl -? described the options
CC = cl -G5 -GF -Ox -W3 -MD -nologo
# No general LDFLAGS needes
LDFLAGS = /link
INSTALL = copy
GLIB_VER = 1.3
CFLAGS = -I. -DHAVE_CONFIG_H
all : \
glibconfig.h \
config.h \
glib-$(GLIB_VER).dll \
gmodule\gmoduleconf.h \
gmodule-$(GLIB_VER).dll \
gthread-$(GLIB_VER).dll \
testglib.exe \
testgmodule.exe \
testgdate.exe \
testgdateparser.exe \
testgthread.exe
install : all
$(INSTALL) glib-$(GLIB_VER).dll $(BIN)
$(INSTALL) gmodule-$(GLIB_VER).dll $(BIN)
$(INSTALL) gthread-$(GLIB_VER).dll $(BIN)
glib_OBJECTS = \
garray.obj \
gcache.obj \
gcompletion.obj \
gdataset.obj \
gdate.obj \
gerror.obj \
ghook.obj \
ghash.obj \
giochannel.obj \
giowin32.obj \
glist.obj \
gmain.obj \
gmem.obj \
gmessages.obj \
gmutex.obj \
gnode.obj \
gprimes.obj \
gqueue.obj \
grand.obj \
gslist.obj \
gstack.obj \
gtimer.obj \
gtree.obj \
grel.obj \
gstring.obj \
gstrfuncs.obj \
gscanner.obj \
gutils.obj
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
$(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
glibconfig.h: glibconfig.h.win32
copy glibconfig.h.win32 glibconfig.h
config.h: config.h.win32
copy config.h.win32 config.h
.c.obj :
$(CC) $(CFLAGS) -GD -c -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $<
gmodule_OBJECTS = \
gmodule.obj
gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule\gmodule.def
$(CC) $(CFLAGS) -LD -Fegmodule-$(GLIB_VER).dll $(gmodule_OBJECTS) glib-$(GLIB_VER).lib $(LDFLAGS) /def:gmodule\gmodule.def
gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c
$(CC) $(CFLAGS) -GD -Igmodule -c -DG_LOG_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c
gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
gthread_OBJECTS = \
gthread.obj
gthread-$(GLIB_VER).dll : $(gthread_OBJECTS) gthread\gthread.def
$(CC) $(CFLAGS) -LD -Fegthread-$(GLIB_VER).dll $(gthread_OBJECTS) glib-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS) /def:gthread\gthread.def
gthread.obj : gthread\gthread.c gthread\gthread-posix.c
$(CC) $(CFLAGS) -GD $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread\gthread.c
testglib.exe : glib-$(GLIB_VER).dll testglib.obj
$(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
testglib.obj : testglib.c
$(CC) -c $(CFLAGS) testglib.c
testgdate.exe : glib-$(GLIB_VER).dll testgdate.obj
$(CC) $(CFLAGS) -Fetestgdate.exe testgdate.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
testgdate.obj : testgdate.c
$(CC) -c $(CFLAGS) testgdate.c
testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.obj
$(CC) $(CFLAGS) -Fetestgdateparser.exe testgdateparser.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
testgdateparser.obj : testgdateparser.c
$(CC) -c $(CFLAGS) testgdateparser.c
testgmodule.exe : glib-$(GLIB_VER).dll gmodule-$(GLIB_VER).dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll
$(CC) $(CFLAGS) testgmodule.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
testgmodule.obj : gmodule\testgmodule.c
$(CC) $(CFLAGS) -Igmodule -c gmodule\testgmodule.c
libgplugin_a.dll : libgplugin_a.obj
$(CC) $(CFLAGS) -LD libgplugin_a.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS)
libgplugin_a.obj : gmodule\libgplugin_a.c
$(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_a.c
libgplugin_b.dll : libgplugin_b.obj
$(CC) $(CFLAGS) -LD libgplugin_b.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS)
libgplugin_b.obj : gmodule\libgplugin_b.c
$(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_b.c
testgthread.exe : glib-$(GLIB_VER).dll gthread-$(GLIB_VER).dll testgthread.obj
$(CC) $(CFLAGS) testgthread.obj glib-$(GLIB_VER).lib gthread-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS) /subsystem:console
testgthread.obj : gthread\testgthread.c
$(CC) $(CFLAGS) $(PTHREAD_INC) -c gthread\testgthread.c
clean:
del config.h
del glibconfig.h
del gmodule\gmoduleconf.h
del *.exe
del *.obj
del *.dll
del *.lib
del *.err
del *.map
del *.sym
del *.exp
del *.lk1
del *.mk1
del *.pdb
del *.ilk