Revamp to be like makefile.mingw.in, make the MSVC build actually work
authorTor Lillqvist <tml@iki.fi>
Fri, 6 Oct 2000 21:32:59 +0000 (21:32 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 6 Oct 2000 21:32:59 +0000 (21:32 +0000)
2000-10-06  Tor Lillqvist  <tml@iki.fi>

* makefile.msc.in: Revamp to be like makefile.mingw.in, make
the MSVC build actually work again.

* gmodule/makefile.msc.in
* gobject/makefile.msc.in
* gthread/makefile.msc.in: New files, like their mingw counterparts.

* gmodule/Makefile.am
* gobject/Makefile.am
* gthread/Makefile.am: Make and distribute them.

* */makefile.mingw.in: Allow override of GLib version number from
the build/win32/module.defs file.

* glib.def: Add new entry point.

Fixes from Hans Breuer:

* glib.h (struct DIR): Keep the last readdir result cached inside
the DIR struct, to enable several DIRs being open simultaneously.

* gwin32.c (g_win32_readdir): Use the above instead of static.

* giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
MSVC happy.

30 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
giowin32.c
glib.def
glib.h
glib/giowin32.c
glib/glib.def
glib/glib.h
glib/gwin32.c
glib/makefile.mingw.in
glib/makefile.msc.in
gmodule/Makefile.am
gmodule/makefile.mingw.in
gmodule/makefile.msc.in [new file with mode: 0644]
gobject/Makefile.am
gobject/makefile.mingw.in
gobject/makefile.msc.in [new file with mode: 0644]
gthread/Makefile.am
gthread/makefile.mingw.in
gthread/makefile.msc.in [new file with mode: 0644]
gwin32.c
makefile.mingw.in
makefile.msc.in
tests/makefile.msc.in

index 7d32295..39a208d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2000-10-06  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.msc.in: Revamp to be like makefile.mingw.in, make
+       the MSVC build actually work again.
+       
+       * gmodule/makefile.msc.in
+       * gobject/makefile.msc.in
+       * gthread/makefile.msc.in: New files, like their mingw counterparts.
+
+       * gmodule/Makefile.am
+       * gobject/Makefile.am
+       * gthread/Makefile.am: Make and distribute them.
+       
+       * */makefile.mingw.in: Allow override of GLib version number from
+       the build/win32/module.defs file.
+       
+       * glib.def: Add new entry point.
+
+       Fixes from Hans Breuer:
+       
+       * glib.h (struct DIR): Keep the last readdir result cached inside
+       the DIR struct, to enable several DIRs being open simultaneously.
+
+       * gwin32.c (g_win32_readdir): Use the above instead of static.
+
+       * giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
+       MSVC happy.
+
 2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib.h: Changed alloca stuff a bit: when we have a working
index 7d32295..39a208d 100644 (file)
@@ -1,3 +1,31 @@
+2000-10-06  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.msc.in: Revamp to be like makefile.mingw.in, make
+       the MSVC build actually work again.
+       
+       * gmodule/makefile.msc.in
+       * gobject/makefile.msc.in
+       * gthread/makefile.msc.in: New files, like their mingw counterparts.
+
+       * gmodule/Makefile.am
+       * gobject/Makefile.am
+       * gthread/Makefile.am: Make and distribute them.
+       
+       * */makefile.mingw.in: Allow override of GLib version number from
+       the build/win32/module.defs file.
+       
+       * glib.def: Add new entry point.
+
+       Fixes from Hans Breuer:
+       
+       * glib.h (struct DIR): Keep the last readdir result cached inside
+       the DIR struct, to enable several DIRs being open simultaneously.
+
+       * gwin32.c (g_win32_readdir): Use the above instead of static.
+
+       * giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
+       MSVC happy.
+
 2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib.h: Changed alloca stuff a bit: when we have a working
index 7d32295..39a208d 100644 (file)
@@ -1,3 +1,31 @@
+2000-10-06  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.msc.in: Revamp to be like makefile.mingw.in, make
+       the MSVC build actually work again.
+       
+       * gmodule/makefile.msc.in
+       * gobject/makefile.msc.in
+       * gthread/makefile.msc.in: New files, like their mingw counterparts.
+
+       * gmodule/Makefile.am
+       * gobject/Makefile.am
+       * gthread/Makefile.am: Make and distribute them.
+       
+       * */makefile.mingw.in: Allow override of GLib version number from
+       the build/win32/module.defs file.
+       
+       * glib.def: Add new entry point.
+
+       Fixes from Hans Breuer:
+       
+       * glib.h (struct DIR): Keep the last readdir result cached inside
+       the DIR struct, to enable several DIRs being open simultaneously.
+
+       * gwin32.c (g_win32_readdir): Use the above instead of static.
+
+       * giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
+       MSVC happy.
+
 2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib.h: Changed alloca stuff a bit: when we have a working
index 7d32295..39a208d 100644 (file)
@@ -1,3 +1,31 @@
+2000-10-06  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.msc.in: Revamp to be like makefile.mingw.in, make
+       the MSVC build actually work again.
+       
+       * gmodule/makefile.msc.in
+       * gobject/makefile.msc.in
+       * gthread/makefile.msc.in: New files, like their mingw counterparts.
+
+       * gmodule/Makefile.am
+       * gobject/Makefile.am
+       * gthread/Makefile.am: Make and distribute them.
+       
+       * */makefile.mingw.in: Allow override of GLib version number from
+       the build/win32/module.defs file.
+       
+       * glib.def: Add new entry point.
+
+       Fixes from Hans Breuer:
+       
+       * glib.h (struct DIR): Keep the last readdir result cached inside
+       the DIR struct, to enable several DIRs being open simultaneously.
+
+       * gwin32.c (g_win32_readdir): Use the above instead of static.
+
+       * giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
+       MSVC happy.
+
 2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib.h: Changed alloca stuff a bit: when we have a working
index 7d32295..39a208d 100644 (file)
@@ -1,3 +1,31 @@
+2000-10-06  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.msc.in: Revamp to be like makefile.mingw.in, make
+       the MSVC build actually work again.
+       
+       * gmodule/makefile.msc.in
+       * gobject/makefile.msc.in
+       * gthread/makefile.msc.in: New files, like their mingw counterparts.
+
+       * gmodule/Makefile.am
+       * gobject/Makefile.am
+       * gthread/Makefile.am: Make and distribute them.
+       
+       * */makefile.mingw.in: Allow override of GLib version number from
+       the build/win32/module.defs file.
+       
+       * glib.def: Add new entry point.
+
+       Fixes from Hans Breuer:
+       
+       * glib.h (struct DIR): Keep the last readdir result cached inside
+       the DIR struct, to enable several DIRs being open simultaneously.
+
+       * gwin32.c (g_win32_readdir): Use the above instead of static.
+
+       * giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
+       MSVC happy.
+
 2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib.h: Changed alloca stuff a bit: when we have a working
index 7d32295..39a208d 100644 (file)
@@ -1,3 +1,31 @@
+2000-10-06  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.msc.in: Revamp to be like makefile.mingw.in, make
+       the MSVC build actually work again.
+       
+       * gmodule/makefile.msc.in
+       * gobject/makefile.msc.in
+       * gthread/makefile.msc.in: New files, like their mingw counterparts.
+
+       * gmodule/Makefile.am
+       * gobject/Makefile.am
+       * gthread/Makefile.am: Make and distribute them.
+       
+       * */makefile.mingw.in: Allow override of GLib version number from
+       the build/win32/module.defs file.
+       
+       * glib.def: Add new entry point.
+
+       Fixes from Hans Breuer:
+       
+       * glib.h (struct DIR): Keep the last readdir result cached inside
+       the DIR struct, to enable several DIRs being open simultaneously.
+
+       * gwin32.c (g_win32_readdir): Use the above instead of static.
+
+       * giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
+       MSVC happy.
+
 2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib.h: Changed alloca stuff a bit: when we have a working
index 7d32295..39a208d 100644 (file)
@@ -1,3 +1,31 @@
+2000-10-06  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.msc.in: Revamp to be like makefile.mingw.in, make
+       the MSVC build actually work again.
+       
+       * gmodule/makefile.msc.in
+       * gobject/makefile.msc.in
+       * gthread/makefile.msc.in: New files, like their mingw counterparts.
+
+       * gmodule/Makefile.am
+       * gobject/Makefile.am
+       * gthread/Makefile.am: Make and distribute them.
+       
+       * */makefile.mingw.in: Allow override of GLib version number from
+       the build/win32/module.defs file.
+       
+       * glib.def: Add new entry point.
+
+       Fixes from Hans Breuer:
+       
+       * glib.h (struct DIR): Keep the last readdir result cached inside
+       the DIR struct, to enable several DIRs being open simultaneously.
+
+       * gwin32.c (g_win32_readdir): Use the above instead of static.
+
+       * giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
+       MSVC happy.
+
 2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib.h: Changed alloca stuff a bit: when we have a working
index 7d32295..39a208d 100644 (file)
@@ -1,3 +1,31 @@
+2000-10-06  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.msc.in: Revamp to be like makefile.mingw.in, make
+       the MSVC build actually work again.
+       
+       * gmodule/makefile.msc.in
+       * gobject/makefile.msc.in
+       * gthread/makefile.msc.in: New files, like their mingw counterparts.
+
+       * gmodule/Makefile.am
+       * gobject/Makefile.am
+       * gthread/Makefile.am: Make and distribute them.
+       
+       * */makefile.mingw.in: Allow override of GLib version number from
+       the build/win32/module.defs file.
+       
+       * glib.def: Add new entry point.
+
+       Fixes from Hans Breuer:
+       
+       * glib.h (struct DIR): Keep the last readdir result cached inside
+       the DIR struct, to enable several DIRs being open simultaneously.
+
+       * gwin32.c (g_win32_readdir): Use the above instead of static.
+
+       * giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
+       MSVC happy.
+
 2000-10-05  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib.h: Changed alloca stuff a bit: when we have a working
index 4acdb16..89cdb0e 100644 (file)
@@ -897,7 +897,7 @@ g_io_channel_win32_make_pollfd (GIOChannel   *channel,
   if (win32_channel->data_avail_event == NULL)
     create_events (win32_channel);
   
-  fd->fd = win32_channel->data_avail_event;
+  fd->fd = (gint) win32_channel->data_avail_event;
   fd->events = condition;
 
   if (win32_channel->thread_id == 0)
index 826ab92..db9b5aa 100644 (file)
--- a/glib.def
+++ b/glib.def
@@ -244,6 +244,7 @@ EXPORTS
        g_node_first_sibling
        g_node_get_root
        g_node_insert
+       g_node_insert_after
        g_node_insert_before
        g_node_is_ancestor
        g_node_last_child
diff --git a/glib.h b/glib.h
index a59779c..42e9aca 100644 (file)
--- a/glib.h
+++ b/glib.h
@@ -3027,18 +3027,21 @@ typedef int pid_t;
 #    define closedir           g_win32_closedir
 #    define NAME_MAX 255
 
-struct DIR
-{
-  gchar    *dir_name;
-  gboolean  just_opened;
-  guint     find_file_handle;
-  gpointer  find_file_data;
-};
-typedef struct DIR DIR;
 struct dirent
 {
   gchar  d_name[NAME_MAX + 1];
 };
+
+struct DIR
+{
+  gchar        *dir_name;
+  gboolean     just_opened;
+  guint        find_file_handle;
+  gpointer     find_file_data;
+  struct dirent readdir_result;
+};
+typedef struct DIR DIR;
+
 /* emulation functions */
 extern int     g_win32_ftruncate       (gint            f,
                                         guint           size);
index 4acdb16..89cdb0e 100644 (file)
@@ -897,7 +897,7 @@ g_io_channel_win32_make_pollfd (GIOChannel   *channel,
   if (win32_channel->data_avail_event == NULL)
     create_events (win32_channel);
   
-  fd->fd = win32_channel->data_avail_event;
+  fd->fd = (gint) win32_channel->data_avail_event;
   fd->events = condition;
 
   if (win32_channel->thread_id == 0)
index 826ab92..db9b5aa 100644 (file)
@@ -244,6 +244,7 @@ EXPORTS
        g_node_first_sibling
        g_node_get_root
        g_node_insert
+       g_node_insert_after
        g_node_insert_before
        g_node_is_ancestor
        g_node_last_child
index a59779c..42e9aca 100644 (file)
@@ -3027,18 +3027,21 @@ typedef int pid_t;
 #    define closedir           g_win32_closedir
 #    define NAME_MAX 255
 
-struct DIR
-{
-  gchar    *dir_name;
-  gboolean  just_opened;
-  guint     find_file_handle;
-  gpointer  find_file_data;
-};
-typedef struct DIR DIR;
 struct dirent
 {
   gchar  d_name[NAME_MAX + 1];
 };
+
+struct DIR
+{
+  gchar        *dir_name;
+  gboolean     just_opened;
+  guint        find_file_handle;
+  gpointer     find_file_data;
+  struct dirent readdir_result;
+};
+typedef struct DIR DIR;
+
 /* emulation functions */
 extern int     g_win32_ftruncate       (gint            f,
                                         guint           size);
index 256fe02..90cddc4 100644 (file)
@@ -130,7 +130,6 @@ g_win32_opendir (const char *dirname)
 struct dirent*
 g_win32_readdir (DIR *dir)
 {
-  static struct dirent result;
   gchar *basename;
 
   g_return_val_if_fail (dir != NULL, NULL);
@@ -157,11 +156,11 @@ g_win32_readdir (DIR *dir)
   
   basename = g_path_get_basename (((LPWIN32_FIND_DATA) dir->find_file_data)->cFileName);
 
-  strcpy (result.d_name, basename);
+  strcpy (dir->readdir_result.d_name, basename);
 
   g_free (basename);
       
-  return &result;
+  return &dir->readdir_result;
 }
 
 void
index 6b7ad5b..8cc0cbd 100644 (file)
@@ -7,12 +7,13 @@
 # should be in your PATH.
 BIN = /bin
 
-GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
-
 TOP = ..
 
 include build/win32/make.mingw
 
+# Possibly override GLib version in build/win32/module.defs
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
 ################################################################
 
 # Nothing much configurable below
index 2b9223e..0bd252f 100644 (file)
@@ -1,67 +1,52 @@
-## Makefile for building the GLib, gmodule and gthread dlls with Microsoft C
+## Makefile for building the GLib 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/
-# We want the 1999-05-30 snapshot.
-PTHREADS = ..\pthreads-snap-1999-05-30
-PTHREAD_LIB = $(PTHREADS)\pthread.lib
-PTHREAD_INC = -I $(PTHREADS)
+TOP = ..
 
-################################################################
-
-# Nothing much configurable below
+!INCLUDE $(TOP)\build\win32\make.msc
 
-!IFNDEF DEBUG
-# Full optimization:
-OPTIMIZE = -Ox -MD
-LINKDEBUG =
-!ELSE
-# Debugging:
-OPTIMIZE = -Zi -MDd
-LINKDEBUG = /debug
-!ENDIF
+# Possibly override GLib version in build\win32\module.defs
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
 
-# cl -? describes the options
-CC = cl -G5 -GF $(OPTIMIZE) -W3 -nologo
+################################################################
 
-# No general LDFLAGS needed
-LDFLAGS = /link $(LINKDEBUG)
-INSTALL = copy
+# Nothing much configurable below
 
-GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+INCLUDES = -I .
+DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib
+DEPCFLAGS = $(LIBICONV_CFLAGS)
 
-CFLAGS = -I. -DHAVE_CONFIG_H
+DLLS_TO_BUILD = \
+       glib-$(GLIB_VER).dll \
+       sub-gmodule \
+       sub-gthread \
+       sub-gobject
 
 all : \
-       glibconfig.h    \
        config.h        \
-       glib-$(GLIB_VER).dll    \
-       gmodule\gmoduleconf.h \
-       gmodule-$(GLIB_VER).dll \
-       gthread-$(GLIB_VER).dll \
+       glibconfig.h    \
+       $(DLLS_TO_BUILD) \
        testglib.exe    \
-       testgmodule.exe \
        testgdate.exe   \
        testgdateparser.exe
 
 install : all
-       $(INSTALL) glib-$(GLIB_VER).dll $(BIN)
-       $(INSTALL) gmodule-$(GLIB_VER).dll $(BIN)
-       $(INSTALL) gthread-$(GLIB_VER).dll $(BIN)
+       copy glib-$(GLIB_VER).dll $(BIN)
 
 glib_OBJECTS = \
        garray.obj      \
        gasyncqueue.obj \
+       gbacktrace.obj  \
        gcache.obj      \
        gcompletion.obj \
        gdataset.obj    \
        gdate.obj       \
        gerror.obj      \
+       gconvert.obj    \
        ghash.obj       \
        ghook.obj       \
        giochannel.obj  \
@@ -89,91 +74,69 @@ glib_OBJECTS = \
        gutils.obj      \
        gwin32.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 $<
+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 >$@
 
-.c.i :
-       $(CC) $(CFLAGS) -GD -E -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $< >$@
+################ glib
 
-gmodule_OBJECTS = \
-       gmodule.obj
+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
 
-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
+################ subdirectories
 
-gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c
-       $(CC) $(CFLAGS) -GD -Igmodule -c -DG_LOG_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c
+sub-gmodule :
+       cd gmodule
+       -$(MAKE) -f makefile.msc all
+       cd ..
 
-gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
-       copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
+sub-gthread :
+       cd gthread
+       -$(MAKE) -f makefile.msc all
+       cd ..
 
-gthread_OBJECTS = \
-       gthread-impl.obj
+sub-gobject :
+       cd gobject
+       -$(MAKE) -f makefile.msc all
+       cd ..
 
-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
+################ test progs
 
-gthread-impl.obj : gthread\gthread-impl.c gthread\gthread-posix.c
-       $(CC) $(CFLAGS) -GD $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread\gthread-impl.c
+testglib.obj : testglib.c
+       $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" testglib.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.obj : testgdate.c
+       $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdate\" testgdate.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.obj : testgdateparser.c
+       $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" testgdateparser.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
+################ other stuff
 
-clean:
+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
+       cd gmodule
+       $(MAKE) -f makefile.msc clean
+       cd ..
+       cd gthread
+       $(MAKE) -f makefile.msc clean
+       cd ..
+       cd gobject
+       $(MAKE) -f makefile.msc clean
+       cd ..
index 4ac2ea1..659d00c 100644 (file)
@@ -6,6 +6,8 @@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gmodule \
 EXTRA_DIST =   \
                makefile.mingw  \
                makefile.mingw.in \
+               makefile.msc    \
+               makefile.msc.in \
                gmoduleconf.h.in \
                gmodule.def     \
                gmodule-dl.c    \
@@ -58,6 +60,9 @@ gmodule.rc: $(top_builddir)/config.status $(top_srcdir)/gmodule/gmodule.rc.in
 makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gmodule/makefile.mingw.in
        cd $(top_builddir) && CONFIG_FILES=gmodule/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
+makefile.msc: $(top_builddir)/config.status $(top_srcdir)/gmodule/makefile.msc.in
+       cd $(top_builddir) && CONFIG_FILES=gmodule/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
 .PHONY: files release
 
 files:
index e127c0f..f90a2ce 100644 (file)
@@ -3,12 +3,13 @@
 
 ## Use: make -f makefile.mingw
 
-GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
-
 TOP = ../..
 
 include ../build/win32/make.mingw
 
+# Possibly override GLib version in build\win32\module.defs
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
 ################################################################
 
 # Nothing much configurable below
diff --git a/gmodule/makefile.msc.in b/gmodule/makefile.msc.in
new file mode 100644 (file)
index 0000000..c9bfb17
--- /dev/null
@@ -0,0 +1,48 @@
+## Makefile for building the gmodule dll with Microsoft C
+## Use: nmake -f makefile.msc install
+
+TOP = ..\..
+
+!INCLUDE $(TOP)\build\win32\make.msc
+
+# Possibly override GLib version in build\win32\module.defs
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
+################################################################
+
+# Nothing much configurable below
+
+INCLUDES = -I .. -I .
+DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=g_log_domain_gmodule
+
+all : \
+       gmoduleconf.h \
+       gmodule-$(GLIB_VER).dll \
+       testgmodule.exe
+
+gmodule_OBJECTS = \
+       gmodule.obj
+
+gmoduleconf.h: gmoduleconf.h.win32
+       copy gmoduleconf.h.win32 gmoduleconf.h
+
+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 >$@
+
+gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule.def
+       $(CC) $(CFLAGS) -LD -Fegmodule-$(GLIB_VER).dll $(gmodule_OBJECTS) ..\glib-$(GLIB_VER).lib $(LDFLAGS) /def:gmodule.def
+
+################ test prog
+
+testgmodule.exe : gmodule-$(GLIB_VER).dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll
+       $(CC) $(CFLAGS) testgmodule.obj gmodule-$(GLIB_VER).lib ..\glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console 
+
+libgplugin_a.dll : libgplugin_a.obj
+       $(CC) $(CFLAGS) -LD libgplugin_a.obj gmodule-$(GLIB_VER).lib ..\glib-$(GLIB_VER).lib $(LDFLAGS)
+
+libgplugin_b.dll : libgplugin_b.obj
+       $(CC) $(CFLAGS) -LD libgplugin_b.obj gmodule-$(GLIB_VER).lib ..\glib-$(GLIB_VER).lib $(LDFLAGS)
+
+clean::
+       del gmoduleconf.h
index d847d81..c05591c 100644 (file)
@@ -83,6 +83,8 @@ gobject_query_LDADD = $(progs_LDADD)
 EXTRA_DIST +=                  \
        makefile.mingw          \
        makefile.mingw.in       \
+       makefile.msc            \
+       makefile.msc.in         \
        gobject.def             \
        gobject.rc              \
        gobject.rc.in
@@ -93,3 +95,5 @@ gobject.rc: $(top_builddir)/config.status $(top_srcdir)/gobject/gobject.rc.in
 makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gobject/makefile.mingw.in
        cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
+makefile.msc: $(top_builddir)/config.status $(top_srcdir)/gobject/makefile.msc.in
+       cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status
index fd6db17..7e9a87a 100644 (file)
@@ -3,12 +3,14 @@
 
 ## Use: make -f makefile.mingw
 
-GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
 
 TOP = ../..
 
 include ../build/win32/make.mingw
 
+# Possibly override GLib version in build/win32/module.defs
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
 ################################################################
 
 # Nothing much configurable below
diff --git a/gobject/makefile.msc.in b/gobject/makefile.msc.in
new file mode 100644 (file)
index 0000000..d6df9a8
--- /dev/null
@@ -0,0 +1,35 @@
+## Makefile for building the gobject dll with Microsoft C
+## Use: nmake -f makefile.msc install
+
+TOP = ..\..
+
+!INCLUDE $(TOP)\build\win32\make.msc
+
+# Possibly override GLib version in build\win32\object.defs
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
+################################################################
+
+# Nothing much configurable below
+
+INCLUDES = -I .. -I .
+DEFINES = -DHAVE_CONFIG_H -DGOBJECT_COMPILATION -DG_LOG_DOMAIN=g_log_domain_gobject
+
+all : \
+       gobject-$(GLIB_VER).dll
+
+gobject_OBJECTS = \
+       gvalue.obj \
+       gvaluetypes.obj \
+       gparam.obj \
+       gparamspecs.obj \
+       genums.obj \
+       gobject.obj \
+       gtype.obj
+
+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 >$@
+
+gobject-$(GLIB_VER).dll : $(gobject_OBJECTS) gobject.def
+       $(CC) $(CFLAGS) -LD -Fegobject-$(GLIB_VER).dll $(gobject_OBJECTS) ..\glib-$(GLIB_VER).lib $(LDFLAGS) /def:gobject.def
index 33db071..d80bafb 100644 (file)
@@ -6,6 +6,8 @@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gthread \
 EXTRA_DIST =                           \
                makefile.mingw          \
                makefile.mingw.in       \
+               makefile.msc            \
+               makefile.msc.in         \
                gthread-posix.c         \
                gthread-solaris.c       \
                gthread-none.c          \
@@ -31,3 +33,6 @@ gthread.rc: $(top_builddir)/config.status $(top_srcdir)/gthread/gthread.rc.in
 
 makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gthread/makefile.mingw.in
        cd $(top_builddir) && CONFIG_FILES=gthread/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+makefile.msc: $(top_builddir)/config.status $(top_srcdir)/gthread/makefile.msc.in
+       cd $(top_builddir) && CONFIG_FILES=gthread/$@ CONFIG_HEADERS= $(SHELL) ./config.status
index 7cfaa8d..d38ab6d 100644 (file)
@@ -3,12 +3,13 @@
 
 ## Use: make -f makefile.mingw
 
-GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
-
 TOP = ../..
 
 include ../build/win32/make.mingw
 
+# Possibly override GLib version in build/win32/module.defs
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
 ################################################################
 
 # Nothing much configurable below
diff --git a/gthread/makefile.msc.in b/gthread/makefile.msc.in
new file mode 100644 (file)
index 0000000..c000036
--- /dev/null
@@ -0,0 +1,32 @@
+## Makefile for building the gthread dll with Microsoft C
+## Use: nmake -f makefile.msc install
+
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
+TOP = ..\..
+
+!INCLUDE $(TOP)\build\win32\make.msc
+
+# Possibly override GLib version in build\win32\module.defs
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
+################################################################
+
+# Nothing much configurable below
+
+INCLUDES = -I .. -I .
+DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"GThread\"
+DEPCFLAGS = $(PTHREAD_CFLAGS)
+
+all : \
+       gthread-$(GLIB_VER).dll
+
+gthread_OBJECTS = \
+       gthread-impl.obj
+
+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 >$@
+
+gthread-$(GLIB_VER).dll : $(gthread_OBJECTS) gthread.def
+       $(CC) $(CFLAGS) -LD -Fegthread-$(GLIB_VER).dll $(gthread_OBJECTS) ..\glib-$(GLIB_VER).lib $(PTHREAD_LIBS) $(LDFLAGS) /def:gthread.def
index 256fe02..90cddc4 100644 (file)
--- a/gwin32.c
+++ b/gwin32.c
@@ -130,7 +130,6 @@ g_win32_opendir (const char *dirname)
 struct dirent*
 g_win32_readdir (DIR *dir)
 {
-  static struct dirent result;
   gchar *basename;
 
   g_return_val_if_fail (dir != NULL, NULL);
@@ -157,11 +156,11 @@ g_win32_readdir (DIR *dir)
   
   basename = g_path_get_basename (((LPWIN32_FIND_DATA) dir->find_file_data)->cFileName);
 
-  strcpy (result.d_name, basename);
+  strcpy (dir->readdir_result.d_name, basename);
 
   g_free (basename);
       
-  return &result;
+  return &dir->readdir_result;
 }
 
 void
index 6b7ad5b..8cc0cbd 100644 (file)
@@ -7,12 +7,13 @@
 # should be in your PATH.
 BIN = /bin
 
-GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
-
 TOP = ..
 
 include build/win32/make.mingw
 
+# Possibly override GLib version in build/win32/module.defs
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
 ################################################################
 
 # Nothing much configurable below
index 2b9223e..0bd252f 100644 (file)
@@ -1,67 +1,52 @@
-## Makefile for building the GLib, gmodule and gthread dlls with Microsoft C
+## Makefile for building the GLib 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/
-# We want the 1999-05-30 snapshot.
-PTHREADS = ..\pthreads-snap-1999-05-30
-PTHREAD_LIB = $(PTHREADS)\pthread.lib
-PTHREAD_INC = -I $(PTHREADS)
+TOP = ..
 
-################################################################
-
-# Nothing much configurable below
+!INCLUDE $(TOP)\build\win32\make.msc
 
-!IFNDEF DEBUG
-# Full optimization:
-OPTIMIZE = -Ox -MD
-LINKDEBUG =
-!ELSE
-# Debugging:
-OPTIMIZE = -Zi -MDd
-LINKDEBUG = /debug
-!ENDIF
+# Possibly override GLib version in build\win32\module.defs
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
 
-# cl -? describes the options
-CC = cl -G5 -GF $(OPTIMIZE) -W3 -nologo
+################################################################
 
-# No general LDFLAGS needed
-LDFLAGS = /link $(LINKDEBUG)
-INSTALL = copy
+# Nothing much configurable below
 
-GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+INCLUDES = -I .
+DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib
+DEPCFLAGS = $(LIBICONV_CFLAGS)
 
-CFLAGS = -I. -DHAVE_CONFIG_H
+DLLS_TO_BUILD = \
+       glib-$(GLIB_VER).dll \
+       sub-gmodule \
+       sub-gthread \
+       sub-gobject
 
 all : \
-       glibconfig.h    \
        config.h        \
-       glib-$(GLIB_VER).dll    \
-       gmodule\gmoduleconf.h \
-       gmodule-$(GLIB_VER).dll \
-       gthread-$(GLIB_VER).dll \
+       glibconfig.h    \
+       $(DLLS_TO_BUILD) \
        testglib.exe    \
-       testgmodule.exe \
        testgdate.exe   \
        testgdateparser.exe
 
 install : all
-       $(INSTALL) glib-$(GLIB_VER).dll $(BIN)
-       $(INSTALL) gmodule-$(GLIB_VER).dll $(BIN)
-       $(INSTALL) gthread-$(GLIB_VER).dll $(BIN)
+       copy glib-$(GLIB_VER).dll $(BIN)
 
 glib_OBJECTS = \
        garray.obj      \
        gasyncqueue.obj \
+       gbacktrace.obj  \
        gcache.obj      \
        gcompletion.obj \
        gdataset.obj    \
        gdate.obj       \
        gerror.obj      \
+       gconvert.obj    \
        ghash.obj       \
        ghook.obj       \
        giochannel.obj  \
@@ -89,91 +74,69 @@ glib_OBJECTS = \
        gutils.obj      \
        gwin32.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 $<
+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 >$@
 
-.c.i :
-       $(CC) $(CFLAGS) -GD -E -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $< >$@
+################ glib
 
-gmodule_OBJECTS = \
-       gmodule.obj
+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
 
-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
+################ subdirectories
 
-gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c
-       $(CC) $(CFLAGS) -GD -Igmodule -c -DG_LOG_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c
+sub-gmodule :
+       cd gmodule
+       -$(MAKE) -f makefile.msc all
+       cd ..
 
-gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
-       copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
+sub-gthread :
+       cd gthread
+       -$(MAKE) -f makefile.msc all
+       cd ..
 
-gthread_OBJECTS = \
-       gthread-impl.obj
+sub-gobject :
+       cd gobject
+       -$(MAKE) -f makefile.msc all
+       cd ..
 
-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
+################ test progs
 
-gthread-impl.obj : gthread\gthread-impl.c gthread\gthread-posix.c
-       $(CC) $(CFLAGS) -GD $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread\gthread-impl.c
+testglib.obj : testglib.c
+       $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" testglib.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.obj : testgdate.c
+       $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdate\" testgdate.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.obj : testgdateparser.c
+       $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" testgdateparser.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
+################ other stuff
 
-clean:
+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
+       cd gmodule
+       $(MAKE) -f makefile.msc clean
+       cd ..
+       cd gthread
+       $(MAKE) -f makefile.msc clean
+       cd ..
+       cd gobject
+       $(MAKE) -f makefile.msc clean
+       cd ..
index 27a757c..eecee8d 100644 (file)
@@ -1,19 +1,19 @@
 ## Makefile for building the GLib test programs with Microsoft C
 ## Use: nmake -f makefile.msc check
 
-################################################################
+TOP = ..\..
 
-# Nothing much configurable below
+!INCLUDE $(TOP)\build\win32\make.msc
 
-# cl -? describes the options
-CC = cl -G5 -GF -Ox -W3 -MD -nologo
+# Possibly override GLib version in build\win32\module.defs
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
 
-# No general LDFLAGS needed
-LDFLAGS = /link
+################################################################
 
-GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+# Nothing much configurable below
 
-CFLAGS = -I.. -DHAVE_CONFIG_H
+INCLUDES = -I..
+DEFINES =  -DHAVE_CONFIG_H
 
 TESTS = \
        array-test.exe  \
@@ -26,7 +26,7 @@ TESTS = \
        rand-test.exe   \
        relation-test.exe\
        slist-test.exe  \
-       strfunc-test.exe\
+#      strfunc-test.exe\
        string-test.exe \
        thread-test.exe \
        threadpool-test.exe\
@@ -35,20 +35,13 @@ TESTS = \
 
 all :  $(TESTS)
 
+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 >$@
+
 .c.exe :
        $(CC) $(CFLAGS) -c $<
-       $(CC) $(CFLAGS) -Fe$@ $< ..\glib-$(GLIB_VER).lib ..\gthread-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
+       $(CC) $(CFLAGS) -Fe$@ $< ..\glib-$(GLIB_VER).lib ..\gmodule\gmodule-$(GLIB_VER).lib ..\gthread\gthread-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
 
 check: all
        for %p in ($(TESTS)) do %p
-
-clean:
-       del *.exe
-       del *.obj
-       del *.dll
-       del *.lib
-       del *.err
-       del *.map
-       del *.sym
-       del *.exp
-       del *.pdb