diff -u -w -b -r -P make/ChangeLog make_new/ChangeLog
--- make/ChangeLog	Fri Aug  6 10:35:43 2004
+++ make_new/ChangeLog	Fri Aug  6 09:53:55 2004
@@ -1,3 +1,52 @@
+2004-08-05  Javier Ferrer Gomez <javi.ferrer@tragnarion.com>
+
+	* common.make (GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS): New variable, used for build .exe
+	files exporting symbols in Windows systems.
+	(GNUSTEP_WIN32_CREATE_VCLIB): New variable, used for create a usable Visual Studio
+	library if the option vclib=yes is passed to the make command line.
+	* rules.make: Get the variable vclib from command line.
+	* Instance/Shared/module.make (MODULE_EXP_FILE): New rule. Generates a
+	.exp file for build win32 executables exporting	symbols. 
+	Fixed the repeated symbols problem when generate subprojects .def.
+	(LIBRARY_MSVC): New rule. Build a usable Visual Studio library (.lib).
+	* Instance/application.make: A .exp file is used if the application 
+	needs to export symbols.
+	* Instance/subproject.make: Instead of make a -subproject.inp we create
+	a -subproject-inp.def that will be used for the gcc to build the final
+	library.
+	* Instance/bundle.make: Use gcc instead of dllwrap.
+	* Instance/framework.make: Use gcc instead of dllwrap.
+	* Instance/palette.make: Use gcc instead of dllwrap. Use PALETTE_OBJ_EXT
+	as extension of	NSExecutable variable in .plist file.
+	* Instance/library.make: Use gcc instead of dllwrap.
+	(LIBRARY_MSVC): Set the place where Visual Studio file will placed.
+ 	* Instance/Shared/bundle.make: Dont care about .svn directories.
+	* Instance/gswbundle.make: Dont care about .svn directories.
+	* target.make: EXTRACT_CLASS_NAMES_COMMAND personalized for mingw32.
+
+2004-08-05 Marc Ordinas i Llopis <marc.ordinas@tragnarion.com>
+
+	* GNUmakefile.in: Added Instance/Shared/module.make to list of
+	files to install.
+	* Instance/Shared/modules.make: Added to contain rules common to
+	all binary modules such as bundles, libraries, tools, etc. Right
+	now has only code to create list of classes and, on Win32, exports
+	definition file.
+	* Instance/bundle.make: Changed to use Instance/Shared/module.make
+	to create the exports file on Win32.
+	* Instance/library.make: Changed to use Instance/Shared/module.make
+	to create the exports file on Win32. No longer add _d to debug
+	DLLs on Win32 as this confuses the objc runtime.
+	* Instance/rules.make: Now subprojects keep their exports file in
+	the owning project $(DERIVED_SOURCES_DIR).
+	* Instance/subproject.make:  Changed to use Instance/Shared/module.make
+	to create the exports file on Win32.
+	* Master/bundle.make, Master/library.make: Remove
+	$(DERIVED_SOURCES_DIR) on clean.
+	* Master/rules.make: Pass a new variable, GNUSTEP_OWNING_INSTANCE
+	to subprojects. This is necessary to correctly compile exports
+	with -DBUILD_$(CLEAN_MODULE_NAME)_DLL in subprojects.
+
 2004-07-31  Adam Fedor  <fedor@gnu.org>
 
 	* configure.ac: Add checks for specific Apple compiler flags.
diff -u -w -b -r -P make/ChangeLog.1 make_new/ChangeLog.1
--- make/ChangeLog.1	Fri Aug  6 10:35:43 2004
+++ make_new/ChangeLog.1	Fri Aug  6 09:53:55 2004
@@ -1156,7 +1156,7 @@
 Tue Mar  5 14:37:58 2002  Nicola Pero  <n.pero@mi.flashnet.it>
 
 	* GNUstep.sh.in (GNUSTEP_USER_ROOT): Fixed setting in case
-	GNUSTEP_FLATTENED (Suggestion from Marcus M¤ller
+	GNUSTEP_FLATTENED (Suggestion from Marcus MWller
 	<znek@mulle-kybernetik.com>).
 	* GNUstep.csh.in: Idem.
 	
diff -u -w -b -r -P make/GNUmakefile.in make_new/GNUmakefile.in
--- make/GNUmakefile.in	Fri Aug  6 10:35:43 2004
+++ make_new/GNUmakefile.in	Fri Aug  6 09:53:56 2004
@@ -97,7 +97,8 @@
         test-library.make test-tool.make tool.make
 
 INSTANCE_SHARED_MAKE_FILES = bundle.make headers.make java.make \
-                             stamp-string.make strings.make
+                             stamp-string.make strings.make \
+                             module.make
 
 INSTANCE_DOC_MAKE_FILES = autogsdoc.make gsdoc.make install_files.make \
                           javadoc.make latex.make texi.make
@@ -124,7 +125,7 @@
 endif
 
 move_obsolete:
-	$(EC)(echo "Moving paths from old heirarchy: "; \
+	$(EC)(echo "Moving paths from old hierarchy: "; \
 	 $(srcdir)/move_obsolete_paths.sh $(GNUSTEP_SYSTEM_ROOT) $(GNUSTEP_LOCAL_ROOT) $(GNUSTEP_USER_ROOT))
 
 install: all @GNUSTEP_MOVE_OBSOLETE@
diff -u -w -b -r -P make/Instance/Shared/bundle.make make_new/Instance/Shared/bundle.make
--- make/Instance/Shared/bundle.make	Fri Aug  6 10:35:44 2004
+++ make_new/Instance/Shared/bundle.make	Fri Aug  6 09:53:56 2004
@@ -364,7 +364,7 @@
 # this feature, but it was requested by some of our users.
 shared-instance-bundle-install:: $(GNUSTEP_SHARED_BUNDLE_INSTALL_DIR)
 	$(ECHO_INSTALLING_BUNDLE)rm -rf $(GNUSTEP_SHARED_BUNDLE_INSTALL_DIR)/$(GNUSTEP_SHARED_BUNDLE_MAIN_PATH); \
-	(cd $(GNUSTEP_BUILD_DIR); $(TAR) chf - $(GNUSTEP_SHARED_BUNDLE_MAIN_PATH)) \
+	(cd $(GNUSTEP_BUILD_DIR); $(TAR) chf - $(GNUSTEP_SHARED_BUNDLE_MAIN_PATH) --exclude=".svn" --exclude=CVS) \
 	  | (cd $(GNUSTEP_SHARED_BUNDLE_INSTALL_DIR); $(TAR) xf -)$(END_ECHO)
 ifneq ($(CHOWN_TO),)
 	$(ECHO_CHOWNING)$(CHOWN) -R $(CHOWN_TO) \
@@ -373,7 +373,7 @@
 
 shared-instance-bundle-copy_into_dir::
 	$(ECHO_COPYING_BUNDLE_INTO_DIR)rm -rf $(COPY_INTO_DIR)/$(GNUSTEP_SHARED_BUNDLE_MAIN_PATH); \
-	(cd $(GNUSTEP_BUILD_DIR); $(TAR) chf - $(GNUSTEP_SHARED_BUNDLE_MAIN_PATH)) \
+	(cd $(GNUSTEP_BUILD_DIR); $(TAR) chf - $(GNUSTEP_SHARED_BUNDLE_MAIN_PATH) --exclude=".svn" --exclude=CVS) \
 	  | (cd $(COPY_INTO_DIR); $(TAR) xf -)$(END_ECHO)
 
 shared-instance-bundle-uninstall::
diff -u -w -b -r -P make/Instance/Shared/module.make make_new/Instance/Shared/module.make
--- make/Instance/Shared/module.make	Thu Jan  1 01:00:00 1970
+++ make_new/Instance/Shared/module.make	Fri Aug  6 09:53:56 2004
@@ -0,0 +1,175 @@
+#   -*-makefile-*-
+#   Shared/module.make
+#
+#   Makefile fragment with rules to deal with common stuff
+#	for all modules: bundles, libraries, frameworks, etc.
+#
+#   Copyright (C) 2002 Free Software Foundation, Inc.
+#
+#   Author:  Marc Ordinas i Llopis <marc.ordinas@tragnarion.com>
+#
+#   This file is part of the GNUstep Makefile Package.
+#
+#   This library is free software; you can redistribute it and/or
+#   modify it under the terms of the GNU General Public License
+#   as published by the Free Software Foundation; either version 2
+#   of the License, or (at your option) any later version.
+#   
+#   You should have received a copy of the GNU General Public
+#   License along with this library; see the file COPYING.LIB.
+#   If not, write to the Free Software Foundation,
+#   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#
+# input variables:
+# 
+#  $(BUILD_DLL) : Whether we are building a DLL.
+#  $(MODULE_CLASSLIST_FILE) : If it is required, this will be the
+#  name of a file containing the list of classes in the module.
+#  $(CLEAN_MODULE_NAME) : The name of the module as it should be
+#  passed defined to files as BUILD_$(CLEAN_MODULE_NAME)_DLL. If not
+#  set, it's generated from $(GNUSTEP_INSTANCE).
+#  $(MODULE_ADDITIONAL_DEF_FILES) : Files containing additional
+#  exported symbols not declared with _declspec(dllexport) and not
+#  class names.
+#  $(MODULE_DEF_FILE) : The final DEF file, generated if not present.
+#  $(MODULE_EXP_FILE) : The final EXP file, generated if not present
+#  and GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS is enable.
+#  $(GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS) : If we are building an EXE exporting symbols
+#
+# public targets:
+# 
+# $(DERIVED_SOURCES_DIR) : A directory where derived sources are kept.
+# $(MODULE_CLASSLIST_FILE)
+# $(MODULE_DEF_FILE)
+
+# The directory where tmp sources are kept.
+$(DERIVED_SOURCES_DIR):
+	$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
+
+# We only set the file name if it's not set already.
+ifeq ($(MODULE_CLASSLIST_FILE),)
+MODULE_CLASSLIST_FILE = $(DERIVED_SOURCES_DIR)/$(GNUSTEP_INSTANCE)-class-list
+endif
+
+# To get the list of all classes, we run 'nm' on the object files, and
+# retrieve all symbols of the form __objc_class_name_NSObject which
+# are not 'U' (undefined) ... an __objc_class_name_NSObject is defined
+# in the module implementing the class, and referenced by all other
+# modules needing to use the class.  So if we have an
+# __objc_class_name_XXX which is not 'U' (which would be a reference
+# to a class implemented elsewhere), it must be a class implemented in
+# this module.
+#
+# The 'sed' command parses a set of lines, and extracts lines starting
+# with __objc_class_name_XXXX Y, where XXXX is a string of characters
+# from A-Za-z_. and Y is not 'U'.  It then replaces the whole line
+# with XXXX, and prints the result. '-n' disables automatic printing
+# for portability, so we are sure we only print what we want on all
+# platforms.
+#
+$(MODULE_CLASSLIST_FILE): $(DERIVED_SOURCES_DIR) \
+                          $(OBJ_FILES_TO_LINK)
+	$(ECHO_CREATING) classes=""; \
+	for f in $(OBJ_FILES_TO_LINK) __dummy__; do \
+	  if [ "$$f" != "__dummy__" ]; then \
+	    sym=`$(EXTRACT_CLASS_NAMES_COMMAND)`; \
+	    classes="$$classes $$sym"; \
+	  fi; \
+	done; \
+	classlist=""; \
+	for f in $$classes __dummy__ ; do \
+	  if [ "$$f" != "__dummy__" ]; then \
+	    if [ "$$classlist" = "" ]; then \
+	      classlist="$$f"; \
+	    else \
+	      classlist="$$classlist\n$$f"; \
+	    fi; \
+	  fi; \
+	done; \
+	echo -e "$$classlist" > $(MODULE_CLASSLIST_FILE);$(END_ECHO)
+
+
+# For win32 systems, sometimes is needed that the EXE of an application
+# export symbols, in this case is treated as a DLL
+ifeq ($(GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS),yes)
+BUILD_DLL = yes
+endif
+
+ifeq ($(BUILD_DLL),yes)
+
+# Pass -DBUILD_lib{library_name}_DLL=1 to the preprocessor.  The
+# library header files can use this preprocessor define to know that
+# they are included during compilation of the library itself, and can
+# then use __declspec(dllexport) to export symbols
+ifeq ($(CLEAN_MODULE_NAME),)
+CLEAN_MODULE_NAME = $(shell echo $(GNUSTEP_INSTANCE)|tr '-' '_')
+endif
+SHARED_CFLAGS += -DBUILD_$(CLEAN_MODULE_NAME)_DLL=1
+
+# The name of the DLL with .exe extension if 
+# its an applications exporting symbols
+ifeq ($(MODULE_DLL_NAME),) # MODULE_DLL_NAME
+ifeq ($(GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS),yes)
+MODULE_DLL_NAME = $(GNUSTEP_INSTANCE)$(EXEEXT)
+else
+MODULE_DLL_NAME = $(GNUSTEP_INSTANCE)$(DLL_LIBEXT)
+endif
+endif # MODULE_DLL_NAME
+
+# General def file.
+ifeq ($(MODULE_INP_DEF_FILE),)
+MODULE_INP_DEF_FILE = $(DERIVED_SOURCES_DIR)/$(GNUSTEP_INSTANCE)-inp.def
+endif
+
+MODULE_ADDITIONAL_DEF_FILES = $($(GNUSTEP_INSTANCE)_DLL_DEF) \
+                              $(SUBPROJECT_DEF_FILES)
+
+
+$(MODULE_INP_DEF_FILE): $(MODULE_CLASSLIST_FILE)
+	$(ECHO_CREATING)echo -e "LIBRARY $(MODULE_DLL_NAME)\nEXPORTS" > $@$(END_ECHO)
+ifneq ($(strip $(MODULE_CLASSLIST_FILE)),)
+	$(ECHO_NOTHING)cat $(MODULE_CLASSLIST_FILE) | sed -n -e '/[A-Za-z_][A-Za-z0-9_]*/ {s/\([A-Za-z_][0-9A-Za-z_]*\)/__objc_class_name_\1/p;}' >> $@$(END_ECHO)
+endif
+ifneq ($(strip $(MODULE_ADDITIONAL_DEF_FILES)),)
+# Clear the .def subproject files and join this with the principal project inp file
+# The final inp file will be the def file passed to the linker
+	$(ECHO_NOTHING)cat $(MODULE_ADDITIONAL_DEF_FILES) | sed -e "s/ @.*//g" | sort | uniq >> $@; \
+	cat $@ | sort | uniq > $@.tmp; \
+	echo -e "LIBRARY $(MODULE_DLL_NAME)\nEXPORTS" > $@; \
+	cat $@.tmp | sed -e 's/;.*\|.*EXPORTS.*\|.*LIBRARY.*//g' | sed -e '/^$$/d' >> $@; \
+	rm $@.tmp$(END_ECHO)
+endif
+
+# The final DEF file
+ifeq ($(MODULE_DEF_FILE),)
+MODULE_DEF_FILE = $(DERIVED_SOURCES_DIR)/$(GNUSTEP_INSTANCE).def
+endif
+
+# Export symbols in EXE file when needed
+ifeq ($(GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS),yes) #GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS
+ifeq ($(MODULE_EXP_FILE),) #MODULE_EXP_FILE
+# The final EXP file, used for export symbols in EXE files
+MODULE_EXP_FILE =$(DERIVED_SOURCES_DIR)/$(GNUSTEP_INSTANCE).exp
+endif #MODULE_EXP_FILE
+MODULE_DLL_EXP_FLAG = --output-exp $(MODULE_EXP_FILE)
+endif #GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS
+
+$(MODULE_DEF_FILE): $(MODULE_INP_DEF_FILE) $(OBJ_FILES_TO_LINK) 
+	$(ECHO_NOTHING)$(DLLTOOL) --dllname $(MODULE_DLL_NAME) --output-def $@ \
+	--input-def $(MODULE_INP_DEF_FILE) $(OBJ_FILES_TO_LINK)$(END_ECHO)
+
+ifeq ($(GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS),yes)
+$(MODULE_EXP_FILE): $(MODULE_DEF_FILE)
+	$(ECHO_NOTHING)$(DLLTOOL) --dllname $(MODULE_DLL_NAME) --input-def $(MODULE_DEF_FILE) \
+	--output-exp $@ --output-lib $(DERIVED_SOURCES_DIR)/lib$(GNUSTEP_INSTANCE)App.a \
+       	$(OBJ_FILES_TO_LINK)$(END_ECHO)
+endif
+
+# Create a .lib for visual studio if requested
+ifneq ($(LIBRARY_MSVC), )
+$(GNUSTEP_OBJ_DIR)/$(LIBRARY_MSVC): $(MODULE_DEF_FILE) $(LIBRARY_FILE)
+	$(ECHO_LINKING)LIB  /DEF:$< /out:$@  /name:$(MODULE_DLL_NAME)  $(END_ECHO)
+endif
+
+endif # BUILD_DLL
diff -u -w -b -r -P make/Instance/application.make make_new/Instance/application.make
--- make/Instance/application.make	Fri Aug  6 10:35:43 2004
+++ make_new/Instance/application.make	Fri Aug  6 09:53:56 2004
@@ -101,9 +101,19 @@
 # Internal targets
 #
 
+# We can build with or without export symbols in EXE files
+ifeq ($(GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS),yes)
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/module.make
+
+$(APP_FILE): $(OBJ_FILES_TO_LINK) $(MODULE_EXP_FILE)
+	$(ECHO_LINKING)$(LD) $(ALL_LDFLAGS) -o $(LDOUT)$@ $(MODULE_EXP_FILE) \
+	      $(OBJ_FILES_TO_LINK) $(ALL_GUI_LIBS)$(END_ECHO)
+else
 $(APP_FILE): $(OBJ_FILES_TO_LINK)
 	$(ECHO_LINKING)$(LD) $(ALL_LDFLAGS) -o $(LDOUT)$@ $(OBJ_FILES_TO_LINK)\
 	      $(ALL_GUI_LIBS)$(END_ECHO)
+endif
+
 ifneq ($(FOUNDATION_LIB), apple)
 	$(ECHO_NOTHING)$(TRANSFORM_PATHS_SCRIPT) $(subst -L,,$(ALL_LIB_DIRS)) \
 	        >$(APP_DIR)/$(GNUSTEP_TARGET_LDIR)/library_paths.openapp$(END_ECHO)
diff -u -w -b -r -P make/Instance/bundle.make make_new/Instance/bundle.make
--- make/Instance/bundle.make	Fri Aug  6 10:35:43 2004
+++ make_new/Instance/bundle.make	Fri Aug  6 09:53:56 2004
@@ -165,10 +165,14 @@
 	$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
 
 ifeq ($(WITH_DLL),yes)
-
-$(BUNDLE_FILE) : $(OBJ_FILES_TO_LINK)
-	$(ECHO_LINKING)$(DLLWRAP) --driver-name $(CC) \
-		-o $(LDOUT)$(BUNDLE_FILE) \
+# Library generated by the compiler
+MODULE_DLL_EXP_LIB  = $(GNUSTEP_OBJ_DIR)/lib$(GNUSTEP_INSTANCE)$(BUNDLE_NAME_SUFFIX)$(SHARED_LIBEXT)
+#Common code to all module files
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/module.make
+$(BUNDLE_FILE) : $(OBJ_FILES_TO_LINK) $(MODULE_INP_DEF_FILE)                   
+	$(ECHO_NOTHING)$(CC) -shared \
+	$(SHARED_LD_PREFLAGS) \
+	-o $@ $(MODULE_INP_DEF_FILE) \
 		$(OBJ_FILES_TO_LINK) \
 		$(ALL_LDFLAGS) \
 		$(ALL_BUNDLE_LIBS)$(END_ECHO)
diff -u -w -b -r -P make/Instance/framework.make make_new/Instance/framework.make
--- make/Instance/framework.make	Fri Aug  6 10:35:43 2004
+++ make_new/Instance/framework.make	Fri Aug  6 09:53:56 2004
@@ -117,6 +117,17 @@
 # HEADER_FILES_INSTALL_DIR are going to be undefined!
 include $(GNUSTEP_MAKEFILES)/Instance/Shared/headers.make
 
+# On windows, this is unfortunately required.
+ifeq ($(WITH_DLL), yes)
+  LINK_FRAMEWORK_AGAINST_ALL_LIBS = yes
+endif
+
+ifeq ($(LINK_FRAMEWORK_AGAINST_ALL_LIBS), yes)
+FRAMEWORK_LIBS += $(ADDITIONAL_GUI_LIBS) $(AUXILIARY_GUI_LIBS) $(BACKEND_LIBS) \
+   $(GUI_LIBS) $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \
+   $(FND_LIBS) $(ADDITIONAL_OBJC_LIBS) $(AUXILIARY_OBJC_LIBS) $(OBJC_LIBS) \
+   $(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS)
+endif
 # FIXME - do we really want to link the framework against all libs ?
 # That easily makes problems when the framework is loaded as a bundle,
 # doesn't it ?
@@ -141,19 +152,6 @@
   DUMMY_FRAMEWORK_FILE = $(DERIVED_SOURCES_DIR)/$(DUMMY_FRAMEWORK).m
   DUMMY_FRAMEWORK_OBJ_FILE = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(DUMMY_FRAMEWORK).o)
 
-  # The following file will hold the list of classes compiled into the
-  # framework, ready to be included in the .plist file.  We include the
-  # list of classes twice, in the object file itself (for when the
-  # framework is loaded) and in the .plist (for tools which let you
-  # browse in frameworks on disk and see lists of classes).  Please note
-  # that reading the class list from the .plist requires gnustep-base to
-  # have properly located the framework bundle on disk, while reading
-  # the list from the object file itself does not (and so it's more
-  # likely to work in a portable way), which is why we still save the
-  # list in the object file rather than only putting it in the .plist.
-  # Maybe this point should be discarded, and we should only store the class
-  # list in the .plist file.
-  DUMMY_FRAMEWORK_CLASS_LIST = $(DERIVED_SOURCES_DIR)/$(GNUSTEP_INSTANCE)-class-list
 endif
 
 FRAMEWORK_HEADER_FILES := $(addprefix $(FRAMEWORK_VERSION_DIR)/Headers/,$(HEADER_FILES))
@@ -186,16 +184,25 @@
 
 else # BUILD_DLL
 
-FRAMEWORK_FILE_NAME = $(GNUSTEP_INSTANCE)$(FRAMEWORK_NAME_SUFFIX)$(DLL_LIBEXT)
-FRAMEWORK_FILE      = $(GNUSTEP_BUILD_DIR)/$(FRAMEWORK_FILE_NAME)
-DLL_NAME         = $(shell echo $(LIBRARY_FILE)|cut -b 4-)
-DLL_EXP_LIB      = $(GNUSTEP_INSTANCE)$(FRAMEWORK_NAME_SUFFIX)$(SHARED_LIBEXT)
-DLL_EXP_DEF      = $(GNUSTEP_INSTANCE)$(FRAMEWORK_NAME_SUFFIX).def
+FRAMEWORK_FILE_NAME = $(GNUSTEP_INSTANCE)$(DLL_LIBEXT)
+FRAMEWORK_FILE      = $(GNUSTEP_OBJ_DIR)/$(FRAMEWORK_FILE_NAME)
+MODULE_DLL_NAME     = $(FRAMEWORK_FILE_NAME)
+MODULE_DLL_EXP_LIB  = $(GNUSTEP_OBJ_DIR)/lib$(GNUSTEP_INSTANCE)$(FRAMEWORK_NAME_SUFFIX)$(SHARED_LIBEXT)
 
 ifeq ($(DLL_INSTALLATION_DIR),)
   DLL_INSTALLATION_DIR = $(GNUSTEP_TOOLS)/$(GNUSTEP_TARGET_LDIR)
 endif
 
+# This is the directory where the libs get installed.  This should *not*
+# include the target arch, os directory or library_combo.
+ifneq ($($(GNUSTEP_INSTANCE)_INSTALL_DIR),)
+  LIBRARY_INSTALL_DIR = $($(GNUSTEP_INSTANCE)_INSTALL_DIR)
+endif
+
+ifeq ($(LIBRARY_INSTALL_DIR),)
+  LIBRARY_INSTALL_DIR = $(GNUSTEP_LIBRARIES)
+endif
+
 endif # BUILD_DLL
 
 ifeq ($(WITH_DLL),yes)
@@ -237,6 +244,7 @@
 
 GNUSTEP_SHARED_BUNDLE_RESOURCE_PATH = $(FRAMEWORK_VERSION_DIR)/Resources
 include $(GNUSTEP_MAKEFILES)/Instance/Shared/bundle.make
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/module.make
 
 internal-framework-all_:: $(GNUSTEP_OBJ_DIR) \
                           build-framework
@@ -244,14 +252,13 @@
 internal-framework-build-headers:: build-framework-dirs \
                                    $(FRAMEWORK_HEADER_FILES)
 
-
 ifeq ($(MAKE_CURRENT_VERSION),yes)
 # A target to build/reset the Current symlink to point to the newly
 # compiled framework.  Only executed if MAKE_CURRENT_VERSION is yes.
 UPDATE_CURRENT_SYMLINK_RULE = update-current-symlink
 update-current-symlink:: $(FRAMEWORK_VERSION_DIR)
 	$(ECHO_NOTHING)cd $(FRAMEWORK_DIR)/Versions; \
-	rm -f Current; \
+	$(RM_LN_S) Current; \
 	$(LN_S) $(CURRENT_VERSION_NAME) Current$(END_ECHO)
 
 else
@@ -268,17 +275,17 @@
                        $(UPDATE_CURRENT_SYMLINK_RULE)
 	$(ECHO_NOTHING)cd $(FRAMEWORK_DIR); \
 	  if [ ! -h "Resources" ]; then \
-	    rm -f Resources; \
+	    $(RM_LN_S) Resources; \
 	    $(LN_S) Versions/Current/Resources Resources; \
 	  fi; \
 	  if [ ! -h "Headers" ]; then \
-	    rm -f Headers; \
+	    $(RM_LN_S) Headers; \
 	    $(LN_S) Versions/Current/Headers Headers; \
 	  fi$(END_ECHO)
 ifneq ($(HEADER_FILES),)
 	$(ECHO_NOTHING)cd $(DERIVED_SOURCES_DIR); \
 	  if [ ! -h "$(HEADER_FILES_INSTALL_DIR)" ]; then \
-	    rm -f ./$(HEADER_FILES_INSTALL_DIR); \
+	    $(RM_LN_S) ./$(HEADER_FILES_INSTALL_DIR); \
 	    $(LN_S) ../$(FRAMEWORK_DIR_NAME)/Headers \
                     ./$(HEADER_FILES_INSTALL_DIR); \
 	  fi$(END_ECHO)
@@ -290,9 +297,6 @@
 $(FRAMEWORK_VERSION_DIR)/Headers:
 	$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
 
-$(DERIVED_SOURCES_DIR):
-	$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
-
 # Need to share this code with the headers code ... but how.
 $(FRAMEWORK_HEADER_FILES):: $(HEADER_FILES)
 ifneq ($(HEADER_FILES),)
@@ -304,8 +308,6 @@
 	done$(END_ECHO)
 endif
 
-OBJC_OBJ_FILES_TO_INSPECT = $(OBJC_OBJ_FILES) $(SUBPROJECT_OBJ_FILES)
-
 # FIXME - We should not depend on GNUmakefile - rather we should use
 # Instance/Shared/stamp-string.make if we need to depend on the value
 # of some make variables.  That would also detect a change in
@@ -347,7 +349,6 @@
 	  classlist="$$classlist, NULL"; \
 	  classarray="$$classarray)"; \
 	fi; \
-	echo "$$classarray" > $(DUMMY_FRAMEWORK_CLASS_LIST); \
 	if [ "$(findstring $(GNUSTEP_SYSTEM_ROOT), $(FRAMEWORK_INSTALL_DIR))" = $(GNUSTEP_SYSTEM_ROOT) ]; then \
 	  fw_env="@\"GNUSTEP_SYSTEM_ROOT\""; \
 	elif [ "$(findstring $(GNUSTEP_LOCAL_ROOT), $(FRAMEWORK_INSTALL_DIR))" = $(GNUSTEP_LOCAL_ROOT) ]; then \
@@ -404,7 +405,7 @@
 $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework/$(GNUSTEP_INSTANCE):
 ifeq ($(MAKE_CURRENT_VERSION),yes)
 	$(ECHO_NOTHING)cd $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).framework; \
-	rm -f $(GNUSTEP_INSTANCE); \
+	$(RM_LN_S) $(GNUSTEP_INSTANCE); \
 	$(LN_S) Versions/Current/$(GNUSTEP_TARGET_LDIR)/$(GNUSTEP_INSTANCE) $(GNUSTEP_INSTANCE)$(END_ECHO)
 endif
 
@@ -422,12 +423,16 @@
 
 ifeq ($(WITH_DLL),yes)
 
-$(FRAMEWORK_FILE) : $(DUMMY_FRAMEWORK_OBJ_FILE) $(OBJ_FILES_TO_LINK)
-	$(ECHO_LINKING)$(DLLWRAP) --driver-name $(CC) \
-		-o $(LDOUT)$(FRAMEWORK_FILE) \
+$(FRAMEWORK_FILE) : $(DUMMY_FRAMEWORK_OBJ_FILE) $(OBJ_FILES_TO_LINK) \
+                    $(MODULE_INP_DEF_FILE)
+	$(ECHO_NOTHING)$(CC) -shared \
+	$(SHARED_LD_PREFLAGS) \
+	-o $@ $(MODULE_INP_DEF_FILE) \
 		$(OBJ_FILES_TO_LINK) \
 		$(ALL_LDFLAGS) \
-		$(ALL_FRAMEWORK_LIBS)$(END_ECHO)
+	$(ALL_FRAMEWORK_LIBS) \
+	$(INTERNAL_LIBRARIES_DEPEND_UPON) $(TARGET_SYSTEM_LIBS) \
+	$(SHARED_LD_POSTFLAGS)$(END_ECHO)
 
 else # without DLL
 
@@ -435,7 +440,7 @@
 	$(ECHO_LINKING) \
 	$(LIB_LINK_CMD); \
 	(cd $(LIB_LINK_OBJ_DIR); \
-	  rm -f $(GNUSTEP_INSTANCE); \
+	  $(RM_LN_S) $(GNUSTEP_INSTANCE); \
 	  $(LN_S) $(LIB_LINK_FILE) $(GNUSTEP_INSTANCE)) \
 	$(END_ECHO)
 
@@ -463,9 +468,9 @@
 	  echo "  NSExecutable = \"$(GNUSTEP_INSTANCE)${FRAMEWORK_OBJ_EXT}\";"; \
 	  echo "  NSMainNibFile = \"$(MAIN_MODEL_FILE)\";"; \
 	  echo "  NSPrincipalClass = \"$(PRINCIPAL_CLASS)\";"; \
-	  echo "  Classes = "; \
-	  cat $(DUMMY_FRAMEWORK_CLASS_LIST); \
-	  echo "  ;"; \
+	  echo "  Classes = ("; \
+	  cat $(MODULE_CLASSLIST_FILE) | sed -n -e '/[A-Za-z_][A-Za-z0-9_]*/ {s/\([A-Za-z_][0-9A-Za-z_]*\)/\1,/p;}'; \
+	  echo "  );"; \
 	  echo "}") >$@$(END_ECHO)
 	$(ECHO_NOTHING)if [ -r "$(GNUSTEP_INSTANCE)Info.plist" ]; then \
 	   plmerge $@ $(GNUSTEP_INSTANCE)Info.plist; \
@@ -488,7 +493,7 @@
 endif
 	$(ECHO_INSTALLING_HEADERS)cd $(GNUSTEP_HEADERS); \
 	if [ "$(HEADER_FILES)" != "" ]; then \
-	  rm -f $(HEADER_FILES_INSTALL_DIR); \
+	  $(RM_LN_S) $(HEADER_FILES_INSTALL_DIR); \
 	  $(LN_S) `$(REL_PATH_SCRIPT) $(GNUSTEP_HEADERS) $(FRAMEWORK_INSTALL_DIR)/$(FRAMEWORK_DIR_NAME)/Headers` $(HEADER_FILES_INSTALL_DIR); \
 	fi;$(END_ECHO)
 ifneq ($(CHOWN_TO),)
@@ -498,9 +503,9 @@
 	fi$(END_ECHO)
 endif
 	$(ECHO_NOTHING)cd $(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR); \
-	rm -f $(FRAMEWORK_LIBRARY_FILE); \
-	rm -f $(SONAME_FRAMEWORK_FILE); \
-	rm -f $(VERSION_FRAMEWORK_LIBRARY_FILE); \
+	$(RM_LN_S) $(FRAMEWORK_LIBRARY_FILE); \
+	$(RM_LN_S) $(SONAME_FRAMEWORK_FILE); \
+	$(RM_LN_S) $(VERSION_FRAMEWORK_LIBRARY_FILE); \
 	$(LN_S) `$(REL_PATH_SCRIPT) $(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR) $(FRAMEWORK_INSTALL_DIR)/$(FRAMEWORK_CURRENT_LIBRARY_DIR_NAME)/$(FRAMEWORK_LIBRARY_FILE)` $(FRAMEWORK_LIBRARY_FILE); \
 	if test -r "$(FRAMEWORK_INSTALL_DIR)/$(FRAMEWORK_CURRENT_LIBRARY_DIR_NAME)/$(SONAME_FRAMEWORK_FILE)"; then \
 	  $(LN_S) `$(REL_PATH_SCRIPT) $(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR) $(FRAMEWORK_INSTALL_DIR)/$(FRAMEWORK_CURRENT_LIBRARY_DIR_NAME)/$(SONAME_FRAMEWORK_FILE)` $(SONAME_FRAMEWORK_FILE); \
@@ -563,11 +568,14 @@
 endif
 	$(ECHO_NOTHING)cd $(DLL_INSTALLATION_DIR); \
 	if test -r "$(FRAMEWORK_FILE_NAME)"; then \
-	  rm -f $(FRAMEWORK_FILE_NAME); \
+	  $(RM_LN_S) $(FRAMEWORK_FILE_NAME); \
 	fi$(END_ECHO)
 	$(ECHO_NOTHING)$(INSTALL_PROGRAM) -m 0755 $(FRAMEWORK_FILE) \
           $(DLL_INSTALLATION_DIR)/$(FRAMEWORK_FILE_NAME)$(END_ECHO)
-
+	$(ECHO_INSTALLING)if [ -f $(MODULE_DLL_EXP_LIB) ]; then \
+	  $(INSTALL_PROGRAM) $(MODULE_DLL_EXP_LIB) \
+	                     $(LIBRARY_INSTALL_DIR) ; \
+	fi$(END_ECHO)
 endif
 
 $(DLL_INSTALLATION_DIR)::
@@ -596,14 +604,29 @@
 	  done; \
 	fi; \
 	if [ -n "$(HEADER_FILES)" ]; then \
-	  rm -f $(GNUSTEP_HEADERS)/$(HEADER_FILES_INSTALL_DIR) ; \
+	  $(RM_LN_S) $(GNUSTEP_HEADERS)/$(HEADER_FILES_INSTALL_DIR) ; \
 	fi; \
 	rm -rf $(FRAMEWORK_INSTALL_DIR)/$(FRAMEWORK_DIR_NAME) ; \
+	$(END_ECHO)
+
+ifeq ($(BUILD_DLL),yes)
+
+internal-framework-uninstall_::
+	$(ECHO_UNINSTALLING) \
+	rm -rf $(LIBRARY_INSTALL_DIR)/lib$(GNUSTEP_INSTANCE)$(FRAMEWORK_NAME_SUFFIX)$(SHARED_LIBEXT) ; \
+	rm -rf $(DLL_INSTALLATION_DIR)/$(GNUSTEP_INSTANCE)$(DLL_LIBEXT) ; \
+	$(END_ECHO)
+
+else
+
+internal-framework-uninstall_::
+	$(ECHO_UNINSTALLING) \
 	cd $(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR); \
-	rm -f $(FRAMEWORK_LIBRARY_FILE); \
-	rm -f $(SONAME_FRAMEWORK_FILE); \
-	rm -f $(VERSION_FRAMEWORK_LIBRARY_FILE); \
+	$(RM_LN_S) $(FRAMEWORK_LIBRARY_FILE); \
+	$(RM_LN_S) $(SONAME_FRAMEWORK_FILE); \
+	$(RM_LN_S) $(VERSION_FRAMEWORK_LIBRARY_FILE); \
 	$(END_ECHO)
+endif # BUILD_DLL
 
 #
 # Cleaning targets
diff -u -w -b -r -P make/Instance/gswbundle.make make_new/Instance/gswbundle.make
--- make/Instance/gswbundle.make	Fri Aug  6 10:35:43 2004
+++ make_new/Instance/gswbundle.make	Fri Aug  6 09:53:56 2004
@@ -252,7 +252,7 @@
 
 internal-gswbundle-install_:: $(GSWBUNDLE_INSTALL_DIR) shared-instance-headers-install
 	$(ECHO_INSTALLING)rm -rf $(GSWBUNDLE_INSTALL_DIR)/$(GSWBUNDLE_DIR_NAME); \
-	(cd $(GNUSTEP_BUILD_DIR); $(TAR) ch --exclude=CVS --to-stdout $(GSWBUNDLE_DIR_NAME)) | (cd $(GSWBUNDLE_INSTALL_DIR); $(TAR) xf -)$(END_ECHO)
+	(cd $(GNUSTEP_BUILD_DIR); $(TAR) ch --exclude=CVS --exclude=".svn" --to-stdout $(GSWBUNDLE_DIR_NAME)) | (cd $(GSWBUNDLE_INSTALL_DIR); $(TAR) xf -)$(END_ECHO)
 ifneq ($(CHOWN_TO),)
 	$(ECHO_CHOWNING)$(CHOWN) -R $(CHOWN_TO) $(GSWBUNDLE_INSTALL_DIR)/$(GSWBUNDLE_DIR_NAME)$(END_ECHO)
 endif
diff -u -w -b -r -P make/Instance/library.make make_new/Instance/library.make
--- make/Instance/library.make	Fri Aug  6 10:35:43 2004
+++ make_new/Instance/library.make	Fri Aug  6 09:53:56 2004
@@ -162,11 +162,10 @@
 
 else # BUILD_DLL
 
-LIBRARY_FILE     = $(LIBRARY_NAME_WITH_LIB)$(LIBRARY_NAME_SUFFIX)$(DLL_LIBEXT)
+LIBRARY_FILE     = $(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(DLL_LIBEXT)
 LIBRARY_FILE_EXT = $(DLL_LIBEXT)
-DLL_NAME         = $(shell echo $(LIBRARY_FILE)|cut -b 4-)
-DLL_EXP_LIB      = $(LIBRARY_NAME_WITH_LIB)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)
-DLL_EXP_DEF      = $(LIBRARY_NAME_WITH_LIB)$(LIBRARY_NAME_SUFFIX).def
+MODULE_DLL_NAME         = $(GNUSTEP_INSTANCE)$(DLL_LIBEXT)
+MODULE_DLL_EXP_LIB      = $(GNUSTEP_OBJ_DIR)/$(LIBRARY_NAME_WITH_LIB)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)
 
 ifeq ($(DLL_INSTALLATION_DIR),)
   DLL_INSTALLATION_DIR = $(GNUSTEP_TOOLS)/$(GNUSTEP_TARGET_LDIR)
@@ -195,6 +194,16 @@
 LIB_LINK_INSTALL_DIR = $(FINAL_LIBRARY_INSTALL_DIR)
 
 #
+# lib file for visual studio, only usefull for win32 systems
+#
+ifeq ($(GNUSTEP_WIN32_CREATE_VCLIB), yes) 
+  LIBRARY_MSVC  = $(LIBRARY_NAME_WITH_LIB)$(LIBRARY_NAME_SUFFIX).lib
+endif
+
+# Include code common to all module-type projects.
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/module.make
+
+#
 # Internal targets
 #
 
@@ -203,56 +212,26 @@
 #
 
 ifeq ($(BUILD_DLL),yes)
-
-DLL_DEF = $($(GNUSTEP_INSTANCE)_DLL_DEF)
-DLL_DEF_FILES = $(SUBPROJECT_DEF_FILES) $(DLL_DEF)
-
-ifneq ($(strip $(DLL_DEF_FILES)),)
-DLL_DEF_INP = $(DERIVED_SOURCES_DIR)/$(LIBRARY_NAME_WITH_LIB).inp
-
-$(DLL_DEF_INP): $(DLL_DEF_FILES)
-	cat $(DLL_DEF_FILES) > $@
-
-DLL_DEF_FLAG = --input-def $(DLL_DEF_INP)
-endif
-
-# Pass -DBUILD_lib{library_name}_DLL=1 to the preprocessor.  The
-# library header files can use this preprocessor define to know that
-# they are included during compilation of the library itself, and can
-# then use __declspec(dllexport) to export symbols
-CLEAN_library_NAME = $(shell echo $(LIBRARY_NAME_WITH_LIB)|tr '-' '_')
-SHARED_CFLAGS += -DBUILD_$(CLEAN_library_NAME)_DLL=1
-
+# The final .lib file
+MODULE_DLL_EXP_LIB  = $(GNUSTEP_OBJ_DIR)/$(LIBRARY_NAME_WITH_LIB)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)
 internal-library-all_:: \
 	$(GNUSTEP_OBJ_DIR)			\
-	$(DERIVED_SOURCES_DIR)			\
-	$(DLL_DEF_INP)				\
-	$(DERIVED_SOURCES_DIR)/$(LIBRARY_NAME_WITH_LIB).def	\
-	$(GNUSTEP_OBJ_DIR)/$(DLL_NAME)		\
-	$(GNUSTEP_OBJ_DIR)/$(DLL_EXP_LIB)
-
-internal-library-clean::
-	$(ECHO_NOTHING)rm -rf $(DERIVED_SOURCES_DIR)$(END_ECHO)
-
-$(DERIVED_SOURCES_DIR):
-	$(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO)
-
-$(DERIVED_SOURCES_DIR)/$(LIBRARY_NAME_WITH_LIB).def: $(OBJ_FILES_TO_LINK) $(DLL_DEF_INP)
-	$(ECHO_NOTHING)$(DLLTOOL) $(DLL_DEF_FLAG) --output-def $@ $(OBJ_FILES_TO_LINK)$(END_ECHO)
-
-$(GNUSTEP_OBJ_DIR)/$(DLL_EXP_LIB): $(DERIVED_SOURCES_DIR)/$(LIBRARY_NAME_WITH_LIB).def
-	$(ECHO_NOTHING)$(DLLTOOL) --dllname $(DLL_NAME) --def $< --output-lib $@$(END_ECHO)
-
-$(GNUSTEP_OBJ_DIR)/$(DLL_NAME): $(OBJ_FILES_TO_LINK) \
-                               $(DERIVED_SOURCES_DIR)/$(LIBRARY_NAME_WITH_LIB).def
-	$(ECHO_LINKING)$(DLLWRAP) --driver-name $(CC) \
+	$(LIBRARY_FILE)
+$(LIBRARY_FILE): $(OBJ_FILES_TO_LINK) $(MODULE_INP_DEF_FILE)
+	$(ECHO_LINKING)$(CC) -shared \
+	-Wl,--output-def,$(MODULE_DEF_FILE) \
+	-Wl,--out-implib,$(MODULE_DLL_EXP_LIB) \
 	  $(SHARED_LD_PREFLAGS) \
-	  --def $(DERIVED_SOURCES_DIR)/$(LIBRARY_NAME_WITH_LIB).def \
-	  -o $@ $(OBJ_FILES_TO_LINK) \
+ 	 -o $@ $(MODULE_INP_DEF_FILE) $(OBJ_FILES_TO_LINK) \
 	  $(ALL_LDFLAGS) \
 	  $(INTERNAL_LIBRARIES_DEPEND_UPON) $(TARGET_SYSTEM_LIBS) \
 	  $(SHARED_LD_POSTFLAGS)$(END_ECHO)
 
+# Create the visual studio .lib file if it was requested
+ifeq ($(GNUSTEP_WIN32_CREATE_VCLIB), yes)
+internal-library-all_:: $(GNUSTEP_OBJ_DIR)/$(LIBRARY_MSVC)
+endif
+
 else # BUILD_DLL
 
 internal-library-all_:: $(GNUSTEP_OBJ_DIR) \
@@ -285,14 +264,24 @@
 ifeq ($(BUILD_DLL),yes)
 
 internal-install-lib::
-	$(ECHO_INSTALLING)if [ -f $(GNUSTEP_OBJ_DIR)/$(DLL_NAME) ]; then \
-	  $(INSTALL_PROGRAM) $(GNUSTEP_OBJ_DIR)/$(DLL_NAME) \
+	$(ECHO_INSTALLING)if [ -f $(LIBRARY_FILE) ]; then \
+	  $(INSTALL_PROGRAM) $(LIBRARY_FILE) \
 	                     $(DLL_INSTALLATION_DIR) ; \
 	fi; \
-	if [ -f $(GNUSTEP_OBJ_DIR)/$(DLL_EXP_LIB) ]; then \
-	  $(INSTALL_PROGRAM) $(GNUSTEP_OBJ_DIR)/$(DLL_EXP_LIB) \
+	if [ -f $(MODULE_DLL_EXP_LIB) ]; then \
+	  $(INSTALL_PROGRAM) $(MODULE_DLL_EXP_LIB) \
+	                     $(FINAL_LIBRARY_INSTALL_DIR) ; \
+	fi$(END_ECHO)
+
+ifneq ($(LIBRARY_MSVC), )
+internal-install-lib::
+	$(ECHO_INSTALLING)
+	if [ -f $(GNUSTEP_OBJ_DIR)/$(LIBRARY_MSVC) ]; then \
+	  $(INSTALL_PROGRAM)$(GNUSTEP_OBJ_DIR)/$(LIBRARY_MSVC) \
 	                     $(FINAL_LIBRARY_INSTALL_DIR) ; \
 	fi$(END_ECHO)
+endif
+
 
 else
 
@@ -308,8 +297,12 @@
 ifeq ($(BUILD_DLL),yes)
 
 internal-library-uninstall_:: shared-instance-headers-uninstall
-	$(ECHO_UNINSTALLING)rm -f $(DLL_INSTALLATION_DIR)/$(DLL_NAME) \
-	      $(FINAL_LIBRARY_INSTALL_DIR)/$(DLL_EXP_LIB)$(END_ECHO)
+	$(ECHO_UNINSTALLING)rm -f $(DLL_INSTALLATION_DIR)/$(GNUSTEP_INSTANCE)$(DLL_LIBEXT) \
+	      $(FINAL_LIBRARY_INSTALL_DIR)/$(LIBRARY_NAME_WITH_LIB)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)$(END_ECHO)
+ifneq ($(LIBRARY_MSVC), )
+internal-library-uninstall_::
+	$(ECHO_UNINSTALLING)rm -f $(FINAL_LIBRARY_INSTALL_DIR)/$(LIBRARY_MSVC)$(END_ECHO)
+endif
 
 else
 
diff -u -w -b -r -P make/Instance/palette.make make_new/Instance/palette.make
--- make/Instance/palette.make	Fri Aug  6 10:35:43 2004
+++ make_new/Instance/palette.make	Fri Aug  6 09:53:56 2004
@@ -116,7 +116,7 @@
 ifeq ($(WITH_DLL),yes)
 
 $(PALETTE_FILE) : $(OBJ_FILES_TO_LINK)
-	$(ECHO_LINKING)$(DLLWRAP) --driver-name $(CC) \
+	$(ECHO_NOTHING)$(CC) -shared \
 		-o $(LDOUT)$(PALETTE_FILE) \
 		$(OBJ_FILES_TO_LINK) \
 		$(ALL_LDFLAGS) \
@@ -146,7 +146,7 @@
 
 $(PALETTE_DIR)/Resources/Info-gnustep.plist: $(PALETTE_DIR)/Resources
 	$(ECHO_CREATING)(echo "{"; echo '  NOTE = "Automatically generated, do not edit!";'; \
-	  echo "  NSExecutable = \"$(GNUSTEP_INSTANCE)\";"; \
+	  echo "  NSExecutable = \"$(GNUSTEP_INSTANCE)${PALETTE_OBJ_EXT}\";"; \
 	  if [ -r "$(GNUSTEP_INSTANCE)Info.plist" ]; then \
 	    cat $(GNUSTEP_INSTANCE)Info.plist; \
 	  fi; \
diff -u -w -b -r -P make/Instance/rules.make make_new/Instance/rules.make
--- make/Instance/rules.make	Fri Aug  6 10:35:43 2004
+++ make_new/Instance/rules.make	Fri Aug  6 09:53:56 2004
@@ -187,7 +187,7 @@
 
 ifneq ($($(GNUSTEP_INSTANCE)_SUBPROJECTS),)
 SUBPROJECT_DEF_FILES = $(foreach d, $($(GNUSTEP_INSTANCE)_SUBPROJECTS), \
-    $(addprefix $(GNUSTEP_BUILD_DIR)/$(d)/, subproject.def))
+    $(addprefix $(GNUSTEP_BUILD_DIR)/$(DERIVED_SOURCES)/$(d), -subproject.def))
 endif
 
 OBJC_OBJS = $(patsubst %.m,%$(OEXT),$($(GNUSTEP_INSTANCE)_OBJC_FILES))
diff -u -w -b -r -P make/Instance/subproject.make make_new/Instance/subproject.make
--- make/Instance/subproject.make	Fri Aug  6 10:35:44 2004
+++ make_new/Instance/subproject.make	Fri Aug  6 09:53:56 2004
@@ -31,31 +31,21 @@
 #
 # Compilation targets
 #
-internal-subproject-all_:: $(GNUSTEP_OBJ_DIR) \
-                           $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT)
+internal-subproject-all_:: $(GNUSTEP_OBJ_DIR)    
 
 ifeq ($(BUILD_DLL),yes)
 
-DLL_DEF = $($(GNUSTEP_INSTANCE)_DLL_DEF)
-DLL_DEF_FILES = $(SUBPROJECT_DEF_FILES) $(DLL_DEF)
-
-ifneq ($(strip $(DLL_DEF_FILES)),)
-DLL_DEF_INP = $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_INSTANCE).inp
-
-$(DLL_DEF_INP): $(DLL_DEF_FILES)
-	$(ECHO_CREATING)cat $(DLL_DEF_FILES) > $@$(END_ECHO)
-
-DLL_DEF_FLAG = --input-def $(DLL_DEF_INP)
-endif
+MODULE_DLL_NAME := $(GNUSTEP_OWNING_INSTANCE)$(DLL_LIBEXT)
+CLEAN_MODULE_NAME = $(shell echo $(GNUSTEP_OWNING_INSTANCE)|tr '-' '_')
+MODULE_CLASSLIST_FILE = $(DERIVED_SOURCES_DIR)/$(GNUSTEP_INSTANCE)-subproject-class-list
+MODULE_INP_DEF_FILE = $(DERIVED_SOURCES_DIR)/$(GNUSTEP_INSTANCE)-subproject-inp.def
+MODULE_DEF_FILE = $(DERIVED_SOURCES_DIR)/$(GNUSTEP_INSTANCE)-subproject.def
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/module.make
 
 internal-subproject-clean::
-	$(ECHO_NOTHING)rm -rf $(DLL_DEF_INP)$(END_ECHO)
-
-internal-subproject-all_:: $(GNUSTEP_BUILD_DIR)/subproject.def
+	$(ECHO_NOTHING)rm -rf $(MODULE_INP_DEF_FILE) $(MODULE_CLASSLIST_FILE) $(MODULE_DEF_FILE)$(END_ECHO)
 
-$(GNUSTEP_BUILD_DIR)/subproject.def: $(OBJ_FILES_TO_LINK) $(DLL_DEF) \
-                                     $(DLL_DEF_INP)
-	$(ECHO_NOTHING)$(DLLTOOL) $(DLL_DEF_FLAG) --output-def $@ $(OBJ_FILES_TO_LINK)$(END_ECHO)
+internal-subproject-all_:: $(MODULE_DEF_FILE) $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT)
 
 endif
 
diff -u -w -b -r -P make/Master/application.make make_new/Master/application.make
--- make/Master/application.make	Fri Aug  6 10:35:44 2004
+++ make_new/Master/application.make	Fri Aug  6 09:53:57 2004
@@ -45,11 +45,11 @@
 ifeq ($(GNUSTEP_FLATTENED),)
 	(cd $(GNUSTEP_BUILD_DIR); \
 	rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES) \
-	  $(_PLIST_INFO_FILES) *.$(APP_EXTENSION)/$(GNUSTEP_TARGET_LDIR))
+	  $(_PLIST_INFO_FILES) $(DERIVED_SOURCES_DIR) *.$(APP_EXTENSION)/$(GNUSTEP_TARGET_LDIR))
 else
 	(cd $(GNUSTEP_BUILD_DIR); \
 	rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES) \
-	  $(_PLIST_INFO_FILES) *.$(APP_EXTENSION))
+	  $(DERIVED_SOURCES_DIR) $(_PLIST_INFO_FILES) *.$(APP_EXTENSION))
 endif
 
 internal-distclean::
diff -u -w -b -r -P make/Master/bundle.make make_new/Master/bundle.make
--- make/Master/bundle.make	Fri Aug  6 10:35:44 2004
+++ make_new/Master/bundle.make	Fri Aug  6 09:53:57 2004
@@ -39,6 +39,7 @@
 internal-clean::
 	(cd $(GNUSTEP_BUILD_DIR); \
 	rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES) \
+	       $(DERIVED_SOURCES_DIR) \
 	       $(addsuffix $(BUNDLE_EXTENSION),$(BUNDLE_NAME)))
 
 internal-distclean::
diff -u -w -b -r -P make/Master/clibrary.make make_new/Master/clibrary.make
--- make/Master/clibrary.make	Fri Aug  6 10:35:44 2004
+++ make_new/Master/clibrary.make	Fri Aug  6 09:53:57 2004
@@ -38,7 +38,7 @@
 
 internal-clean::
 	(cd $(GNUSTEP_BUILD_DIR); \
-	rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES))
+	rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES) $(DERIVED_SOURCES_DIR))
 
 internal-distclean::
 	(cd $(GNUSTEP_BUILD_DIR); \
diff -u -w -b -r -P make/Master/library.make make_new/Master/library.make
--- make/Master/library.make	Fri Aug  6 10:35:44 2004
+++ make_new/Master/library.make	Fri Aug  6 09:53:57 2004
@@ -38,7 +38,8 @@
 
 internal-clean::
 	(cd $(GNUSTEP_BUILD_DIR); \
-	rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES))
+	rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES) \
+	       $(DERIVED_SOURCES_DIR))
 
 internal-distclean::
 	(cd $(GNUSTEP_BUILD_DIR); \
diff -u -w -b -r -P make/Master/rules.make make_new/Master/rules.make
--- make/Master/rules.make	Fri Aug  6 10:35:44 2004
+++ make_new/Master/rules.make	Fri Aug  6 09:53:57 2004
@@ -269,6 +269,10 @@
   ABS_GNUSTEP_BUILD_DIR = $(strip $(GNUSTEP_BUILD_DIR))
 endif
 
+ifeq ($(GNUSTEP_OWNING_INSTANCE),)
+GNUSTEP_OWNING_INSTANCE=$(basename $(basename $*))
+endif
+
 # If you change the subprojects code here, make sure to update the
 # %.subprojects rule below too!  The code from the %.subprojects rule
 # below is 'inlined' here for speed (so that we don't run a separate
@@ -307,6 +311,7 @@
           OWNING_PROJECT_HEADER_DIR_NAME="$${owning_project_header_dir}" \
           DERIVED_SOURCES="../$(DERIVED_SOURCES)" \
           GNUSTEP_BUILD_DIR="$$gsbuild" \
+          GNUSTEP_OWNING_INSTANCE="$(GNUSTEP_OWNING_INSTANCE)" \
         ; then \
         :; \
       else exit $$?; \
@@ -322,6 +327,7 @@
     GNUSTEP_OPERATION=$$operation \
     INTERNAL_$${type}_NAME=$$instance \
     TARGET=$$instance \
+    GNUSTEP_OWNING_INSTANCE="$(GNUSTEP_OWNING_INSTANCE)" \
     GNUSTEP_BUILD_DIR="$${abs_build_dir}"
 
 #
@@ -372,6 +378,7 @@
           OWNING_PROJECT_HEADER_DIR_NAME="$${owning_project_header_dir}" \
           DERIVED_SOURCES="../$(DERIVED_SOURCES)" \
           GNUSTEP_BUILD_DIR="$$gsbuild" \
+          GNUSTEP_OWNING_INSTANCE="$(GNUSTEP_OWNING_INSTANCE)" \
         ; then \
         :; \
       else exit $$?; \
diff -u -w -b -r -P make/common.make make_new/common.make
--- make/common.make	Fri Aug  6 10:35:43 2004
+++ make_new/common.make	Fri Aug  6 09:53:56 2004
@@ -183,6 +183,16 @@
 # Make it public and available to all submakes invocations
 export GNUSTEP_INSTALLATION_DIR
 
+# If EXE_EXPORT_SYMBOLS is set to yes the executable file export symbols
+ifeq ($(GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS), yes) 
+  export GNUSTEP_WIN32_EXE_EXPORT_SYMBOLS
+endif
+
+# GNUSTEP_WIN32_CREATE_VCLIB is used for create a .lib file usable by Microsoft Visual Studio
+ifeq ($(vclib),yes)
+  export GNUSTEP_WIN32_CREATE_VCLIB := yes
+endif
+
 #
 # Variables specifying the installation directory paths
 #
diff -u -w -b -r -P make/config.make.in make_new/config.make.in
--- make/config.make.in	Fri Aug  6 10:35:43 2004
+++ make_new/config.make.in	Fri Aug  6 09:53:56 2004
@@ -43,6 +43,7 @@
 LIBEXT = .a
 
 LN_S = @LN_S@
+RM_LN_S = rm -f
 
 # This is the best we can do given the current autoconf, which only
 # returns LN_S
@@ -52,6 +53,8 @@
 
 ifeq (@target_os@,mingw32)
   HAS_LN_S = no
+  LN_S = cp -ar
+  RM_LN_S = rm -rf
 endif
 
 LD = $(CC)
diff -u -w -b -r -P make/rules.make make_new/rules.make
--- make/rules.make	Fri Aug  6 10:35:44 2004
+++ make_new/rules.make	Fri Aug  6 09:53:57 2004
@@ -64,6 +64,8 @@
   export INSTALL_AS_GROUP
 endif
 
+# When this variables is set, a .lib usable by Visual Studio is created
+GNUSTEP_WIN32_CREATE_VCLIB = $(vclib)
 
 # In subprojects, will be set by the recursive make invocation on the
 # make command line to be [../../]../derived_src
diff -u -w -b -r -P make/target.make make_new/target.make
--- make/target.make	Fri Aug  6 10:35:44 2004
+++ make_new/target.make	Fri Aug  6 09:53:57 2004
@@ -863,6 +863,9 @@
 OBJ_MERGE_CMD = \
 	$(CC) -nostdlib -r $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
 
+# The output of nm is slightly different
+EXTRACT_CLASS_NAMES_COMMAND = nm -Pg $$object_file | sed -n -e '/^_\{2,3\}objc_class_name_[A-Za-z0-9_.]* [^U]/ {s/^_\{2,3\}objc_class_name_\([A-Za-z0-9_.]*\) [^U].*/\1/p;}'
+
 HAVE_BUNDLES   = yes
 BUNDLE_LD      = $(CC)
 BUNDLE_LDFLAGS += -nodefaultlibs -Xlinker -r
diff -u -w -b -r -P make/user_home.c make_new/user_home.c
--- make/user_home.c	Fri Aug  6 10:35:44 2004
+++ make_new/user_home.c	Fri Aug  6 09:53:57 2004
@@ -160,12 +160,34 @@
 #else
   home[0] = '\0';
   /*
+   * For developers: First look if HOME exists and has no
+   * spaces.
+   */
+  len0 = GetEnvironmentVariable( "HOME", buf0, 1024 );
+  if( len0 > 0 && len0 < 1024 )
+	{
+	  buf0[len0] = '\0';
+	  int i;
+	  for( i = 0; i <= len0; i++ )
+		{
+		  if( isspace( buf0[i] ) )
+			{
+			  home[0] = '\0';
+			  break;
+			} else {
+			  home[i] = buf0[i];
+			}
+		}
+	}
+  /*
    * The environment variable HOMEPATH holds the home directory
    * for the user on Windows NT; Win95 has no concept of home.
    * For OPENSTEP compatibility (and because USERPROFILE is usually
    * unusable because it contains spaces), we use HOMEPATH in
    * preference to USERPROFILE.
    */
+  if( home[0] == '\0' )
+	{
   len0 = GetEnvironmentVariable("HOMEPATH", buf0, 1024);
   if (len0 > 0 && len0 < 1024)
     {
@@ -187,7 +209,8 @@
 	    }
 	}
     }
-  else
+	}
+  if( home[0] == '\0' )
     {
       /* The environment variable USERPROFILE may hold the home directory
 	 for the user on modern versions of windoze. */
