Bugzilla Bug 303508: enhanced the makefile rule for $(MAPFILE). Added
authorwtchang%redhat.com
Fri, 16 Sep 2005 17:09:23 +0000
changeset 6110 f841975ff2cdf9cb6f4128b6c199e1b21949a3dd
parent 6109 6437f553c55aafb006c4ce3104933a1c2590337f
child 6111 60841b5cd524509a9ef0da262328445bff62639d
push idunknown
push userunknown
push dateunknown
bugs303508
Bugzilla Bug 303508: enhanced the makefile rule for $(MAPFILE). Added the new variable MAPFILE_SOURCE instead of the hardcoded $(LIBRARY_NAME).def to represent the "source" mapfile, and use $< to refer to the "source" mapfile (prerequisite of the target) in PROCESS_MAP_FILE. r=nelsonb. Modified Files: AIX.mk BSD_OS.mk Darwin.mk FreeBSD.mk HP-UX.mk IRIX.mk Linux.mk Linux2.1.mk Linux2.2.mk Linux2.4.mk Linux2.5.mk Linux2.6.mk NCR3.0.mk NEC4.2.mk NetBSD.mk OS2.mk OSF1.mk OpenUNIX.mk OpenVMS.mk ReliantUNIX.mk SCO_SV3.2.mk SunOS5.mk UNIXWARE2.1.mk WIN16.mk WIN32.mk WINCE.mk rules.mk ruleset.mk
security/coreconf/AIX.mk
security/coreconf/BSD_OS.mk
security/coreconf/Darwin.mk
security/coreconf/FreeBSD.mk
security/coreconf/HP-UX.mk
security/coreconf/IRIX.mk
security/coreconf/Linux.mk
security/coreconf/Linux2.1.mk
security/coreconf/Linux2.2.mk
security/coreconf/Linux2.4.mk
security/coreconf/Linux2.5.mk
security/coreconf/Linux2.6.mk
security/coreconf/NCR3.0.mk
security/coreconf/NEC4.2.mk
security/coreconf/NetBSD.mk
security/coreconf/OS2.mk
security/coreconf/OSF1.mk
security/coreconf/OpenUNIX.mk
security/coreconf/OpenVMS.mk
security/coreconf/ReliantUNIX.mk
security/coreconf/SCO_SV3.2.mk
security/coreconf/SunOS5.mk
security/coreconf/UNIXWARE2.1.mk
security/coreconf/WIN16.mk
security/coreconf/WIN32.mk
security/coreconf/WINCE.mk
security/coreconf/rules.mk
security/coreconf/ruleset.mk
--- a/security/coreconf/AIX.mk
+++ b/security/coreconf/AIX.mk
@@ -79,17 +79,17 @@ AIX_WRAP	= $(DIST)/lib/aixwrap.o
 AIX_TMP		= $(OBJDIR)/_aix_tmp.o
 
 ifdef MAPFILE
 DSO_LDOPTS	+= -bexport:$(MAPFILE)
 else
 DSO_LDOPTS	+= -bexpall
 endif
 
-PROCESS_MAP_FILE = grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
+PROCESS_MAP_FILE = grep -v ';+' $< | grep -v ';-' | \
                 sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' > $@
 
 ifdef BUILD_OPT
 	OPTIMIZER += -qmaxmem=-1
 endif
 
 ifeq ($(USE_64), 1)
 	OS_CFLAGS	+= -DAIX_64BIT
--- a/security/coreconf/BSD_OS.mk
+++ b/security/coreconf/BSD_OS.mk
@@ -79,13 +79,13 @@ ifdef LIBRUNPATH
 DSO_LDOPTS		+= -Wl,-R$(LIBRUNPATH)
 endif
 
 MKSHLIB			= $(CC) $(DSO_LDOPTS)
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 G++INCLUDES		= -I/usr/include/g++
 
 INCLUDES		+= -I/usr/X11R6/include
--- a/security/coreconf/Darwin.mk
+++ b/security/coreconf/Darwin.mk
@@ -99,12 +99,12 @@ endif
 ARCH		= darwin
 
 DSO_CFLAGS	= -fPIC
 # May override this with -bundle to create a loadable module.
 DSO_LDOPTS	= -dynamiclib -compatibility_version 1 -current_version 1 -install_name @executable_path/$(notdir $@) -headerpad_max_install_names $(DARWIN_SDK_LDFLAGS)
 
 MKSHLIB		= $(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS)
 DLL_SUFFIX	= dylib
-PROCESS_MAP_FILE = grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
+PROCESS_MAP_FILE = grep -v ';+' $< | grep -v ';-' | \
                 sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,^,_,' > $@
 
 G++INCLUDES	= -I/usr/include/g++
--- a/security/coreconf/FreeBSD.mk
+++ b/security/coreconf/FreeBSD.mk
@@ -73,13 +73,13 @@ else
 DLL_SUFFIX		= so.1.0
 endif
 
 MKSHLIB			= $(CC) $(DSO_LDOPTS)
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 G++INCLUDES		= -I/usr/include/g++
 
 INCLUDES		+= -I/usr/X11R6/include
--- a/security/coreconf/HP-UX.mk
+++ b/security/coreconf/HP-UX.mk
@@ -66,16 +66,16 @@ ifdef PTHREADS_USER
 endif
 
 LDFLAGS			= -z -Wl,+s
 
 MKSHLIB			= $(LD) $(DSO_LDOPTS)
 ifdef MAPFILE
 MKSHLIB += -c $(MAPFILE)
 endif
-PROCESS_MAP_FILE = grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
+PROCESS_MAP_FILE = grep -v ';+' $< | grep -v ';-' | \
          sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,^,+e ,' > $@
 
 DSO_LDOPTS		= -b +h $(notdir $@)
 DSO_LDFLAGS		=
 
 # +Z generates position independent code for use in shared libraries.
 DSO_CFLAGS = +Z
--- a/security/coreconf/IRIX.mk
+++ b/security/coreconf/IRIX.mk
@@ -102,17 +102,17 @@ ifeq ($(USE_N32),1)
 	SHLIB_LD_OPTS	+= -n32 -mips3
 endif
 
 MKSHLIB     += $(LD) $(SHLIB_LD_OPTS) -shared -soname $(@:$(OBJDIR)/%.so=%.so)
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 DSO_LDOPTS	= -elf -shared -all
 
 ifdef DSO_BACKEND
 	DSO_LDOPTS += -soname $(DSO_NAME)
 endif
 
 #
--- a/security/coreconf/Linux.mk
+++ b/security/coreconf/Linux.mk
@@ -138,17 +138,17 @@ endif
 LIBC_TAG		= _glibc
 
 ifeq ($(OS_RELEASE),2.0)
 	OS_REL_CFLAGS	+= -DLINUX2_0
 	MKSHLIB		= $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
 	ifdef MAPFILE
 		MKSHLIB += -Wl,--version-script,$(MAPFILE)
 	endif
-	PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
+	PROCESS_MAP_FILE = grep -v ';-' $< | \
          sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 endif
 
 ifdef BUILD_OPT
 	OPTIMIZER	= -O2
 endif
 
 ifeq ($(USE_PTHREADS),1)
--- a/security/coreconf/Linux2.1.mk
+++ b/security/coreconf/Linux2.1.mk
@@ -37,12 +37,12 @@
 
 include $(CORE_DEPTH)/coreconf/Linux.mk
 ifeq ($(OS_RELEASE),2.1)
         OS_REL_CFLAGS   += -DLINUX2_1
         MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
 	ifdef MAPFILE
 		MKSHLIB += -Wl,--version-script,$(MAPFILE)
 	endif
-	PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
+	PROCESS_MAP_FILE = grep -v ';-' $< | \
        	 sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 endif
 
--- a/security/coreconf/Linux2.2.mk
+++ b/security/coreconf/Linux2.2.mk
@@ -38,11 +38,11 @@
 include $(CORE_DEPTH)/coreconf/Linux.mk
 
 OS_REL_CFLAGS   += -DLINUX2_1
 MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
 
 ifdef MAPFILE
 	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 endif
-PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
+PROCESS_MAP_FILE = grep -v ';-' $< | \
         sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 
--- a/security/coreconf/Linux2.4.mk
+++ b/security/coreconf/Linux2.4.mk
@@ -38,11 +38,11 @@
 include $(CORE_DEPTH)/coreconf/Linux.mk
 
 OS_REL_CFLAGS   += -DLINUX2_1
 MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
 
 ifdef MAPFILE
 	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 endif
-PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
+PROCESS_MAP_FILE = grep -v ';-' $< | \
         sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 
--- a/security/coreconf/Linux2.5.mk
+++ b/security/coreconf/Linux2.5.mk
@@ -38,11 +38,11 @@
 include $(CORE_DEPTH)/coreconf/Linux.mk
 
 OS_REL_CFLAGS   += -DLINUX2_1
 MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
 
 ifdef MAPFILE
 	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 endif
-PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
+PROCESS_MAP_FILE = grep -v ';-' $< | \
         sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 
--- a/security/coreconf/Linux2.6.mk
+++ b/security/coreconf/Linux2.6.mk
@@ -38,11 +38,11 @@
 include $(CORE_DEPTH)/coreconf/Linux.mk
 
 OS_REL_CFLAGS   += -DLINUX2_1
 MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
 
 ifdef MAPFILE
 	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 endif
-PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
+PROCESS_MAP_FILE = grep -v ';-' $< | \
         sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 
--- a/security/coreconf/NCR3.0.mk
+++ b/security/coreconf/NCR3.0.mk
@@ -67,17 +67,17 @@ endif
 
 MKSHLIB     += $(LD) $(DSO_LDOPTS)
 #DSO_LDOPTS += -G -z defs
 DSO_LDOPTS += -G
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 CPU_ARCH    = x86
 ARCH        = ncr
 
 NOSUCHFILE  = /solaris-rm-f-sucks
 
 # now take care of default GCC (rus@5/5/97)
  
--- a/security/coreconf/NEC4.2.mk
+++ b/security/coreconf/NEC4.2.mk
@@ -50,17 +50,17 @@ OS_CFLAGS		= -Xa -KGnum=0 -KOlimit=4000
 CCC			= g++
 endif
 
 MKSHLIB			= $(LD) $(DSO_LDOPTS)
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 RANLIB			= /bin/true
 
 OS_CFLAGS		+= $(ODD_CFLAGS) -DSVR4 -D__SVR4 -DNEC -Dnec_ews -DHAVE_STRERROR
 OS_LIBS			= -lsocket -lnsl -ldl $(LDOPTIONS)
 LDOPTIONS		= -lc -L/usr/ucblib -lucb
 
 NOSUCHFILE		= /nec-rm-f-sucks
--- a/security/coreconf/NetBSD.mk
+++ b/security/coreconf/NetBSD.mk
@@ -75,14 +75,14 @@ ifdef LIBRUNPATH
 DSO_LDOPTS		+= -Wl,-R$(LIBRUNPATH)
 endif
 
 MKSHLIB			= $(CC) $(DSO_LDOPTS)
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 
 G++INCLUDES		= -I/usr/include/g++
 
 INCLUDES		+= -I/usr/X11R6/include
--- a/security/coreconf/OS2.mk
+++ b/security/coreconf/OS2.mk
@@ -96,17 +96,17 @@ ifdef MAPFILE
 MKSHLIB += $(MAPFILE)
 endif
 PROCESS_MAP_FILE = \
 	echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@; \
 	echo PROTMODE >> $@; \
 	echo CODE    LOADONCALL MOVEABLE DISCARDABLE >> $@; \
 	echo DATA    PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@; \
 	echo EXPORTS >> $@; \
-	grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
+	grep -v ';+' $< | grep -v ';-' | \
 	sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \
 	awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@
 
 endif   #NO_SHARED_LIB
 
 OS_CFLAGS          = -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Zomf -DDEBUG -DTRACING -g
 
 ifdef BUILD_OPT
@@ -163,17 +163,17 @@ ifdef MAPFILE
 MKSHLIB += $(MAPFILE)
 endif
 PROCESS_MAP_FILE = \
 	echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@; \
 	echo PROTMODE >> $@; \
 	echo CODE    LOADONCALL MOVEABLE DISCARDABLE >> $@; \
 	echo DATA    PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@; \
 	echo EXPORTS >> $@; \
-	grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
+	grep -v ';+' $< | grep -v ';-' | \
 	sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' >> $@
 endif   #NO_SHARED_LIB
 
 OS_CFLAGS          = /Q /qlibansi /Gd /Gm /Su4 /Mp /Tl-
 INCLUDES        += -I$(CORE_DEPTH)/../dist/include
 DEFINES         += -DXP_OS2_VACPP -DTCPV40HDRS
 
 DLLFLAGS    = /DLL /O:$@ /INC:_dllentry /MAP:$(@:.dll=.map)
--- a/security/coreconf/OSF1.mk
+++ b/security/coreconf/OSF1.mk
@@ -63,12 +63,12 @@ ifeq ($(USE_PTHREADS),1)
 	OS_CFLAGS += -pthread
 endif
 
 # The command to build a shared library on OSF1.
 MKSHLIB    += ld -shared -expect_unresolved "*" -soname $(notdir $@)
 ifdef MAPFILE
 MKSHLIB += -hidden -input $(MAPFILE)
 endif
-PROCESS_MAP_FILE = grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
+PROCESS_MAP_FILE = grep -v ';+' $< | grep -v ';-' | \
  sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,^,-exported_symbol ,' > $@
 
 DSO_LDOPTS += -shared
--- a/security/coreconf/OpenUNIX.mk
+++ b/security/coreconf/OpenUNIX.mk
@@ -74,17 +74,17 @@ TW_LOCALE    = zh
 I2_LOCALE    = i2
 LOC_LIB_DIR  = /usr/lib/X11
 NOSUCHFILE   = /solaris-rm-f-sucks
 BSDECHO      = /bin/echo
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 #
 # These defines are for building unix plugins
 #
 BUILD_UNIX_PLUGINS  = 1
 #DSO_LDOPTS         += -b elf -G -z defs
 DSO_LDOPTS         += -G
 DSO_LDFLAGS        += -nostdlib -L/lib -L/usr/lib -lXm -lXt -lX11 -lgen
--- a/security/coreconf/OpenVMS.mk
+++ b/security/coreconf/OpenVMS.mk
@@ -61,15 +61,15 @@ XCFLAGS                        += $(OPTI
 
 DSO_LDOPTS	= -shared -auto_symvec
 MKSHLIB		= $(CC) $(OPTIMIZER) $(LDFLAGS) $(DSO_LDOPTS)
 
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 
 #
 # Always set CPU_TAG on Linux, OpenVMS, WINCE.
 #
 CPU_TAG = _$(CPU_ARCH)
--- a/security/coreconf/ReliantUNIX.mk
+++ b/security/coreconf/ReliantUNIX.mk
@@ -66,17 +66,17 @@ else
 	MKSHLIB     = $(CC)
 	MKSHLIB    += -G -h $(@:$(OBJDIR)/%.so=%.so)
 	DSO_LDOPTS += -G -W l,-Blargedynsym
 endif
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 NOSUCHFILE  = /sni-rm-f-sucks
 ODD_CFLAGS += -DSVR4 -DSNI -DRELIANTUNIX
 CPU_ARCH    = mips
 RANLIB      = /bin/true
 
 # For purify
 NOMD_OS_CFLAGS += $(ODD_CFLAGS)
--- a/security/coreconf/SCO_SV3.2.mk
+++ b/security/coreconf/SCO_SV3.2.mk
@@ -74,17 +74,17 @@ TW_LOCALE    = zh
 I2_LOCALE    = i2
 LOC_LIB_DIR  = /usr/lib/X11
 NOSUCHFILE   = /solaris-rm-f-sucks
 BSDECHO      = /bin/echo
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 #
 # These defines are for building unix plugins
 #
 BUILD_UNIX_PLUGINS  = 1
 #DSO_LDOPTS         += -b elf -G -z defs
 DSO_LDOPTS         += -b elf -G
 DSO_LDFLAGS        += -nostdlib -L/lib -L/usr/lib -lXm -lXt -lX11 -lgen
--- a/security/coreconf/SunOS5.mk
+++ b/security/coreconf/SunOS5.mk
@@ -145,17 +145,17 @@ ifdef GCC_USE_GNU_LD
     MKSHLIB += -Wl,--version-script,$(MAPFILE)
 else
     MKSHLIB += -Wl,-M,$(MAPFILE)
 endif
 else
     MKSHLIB += -M $(MAPFILE)
 endif
 endif
-PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
+PROCESS_MAP_FILE = grep -v ';-' $< | \
          sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 
 
 
 
 # ld options:
 # -G: produce a shared object
 # -z defs: no unresolved symbols allowed
--- a/security/coreconf/UNIXWARE2.1.mk
+++ b/security/coreconf/UNIXWARE2.1.mk
@@ -52,10 +52,10 @@ MKSHLIB    += $(DSO_LDOPTS)
 DSO_LDOPTS += -G
 CPU_ARCH    = x86
 ARCH        = sco
 NOSUCHFILE  = /solaris-rm-f-sucks
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
--- a/security/coreconf/WIN16.mk
+++ b/security/coreconf/WIN16.mk
@@ -112,17 +112,17 @@ OS_LIB_FLAGS   = -c -iro
 OS_DLL_OPTION = CASEEXACT
 OS_DLLFLAGS  =
 OS_LIBS      =
 W16_EXPORTS  = #
 ifdef MAPFILE
 # Add LD options to restrict exported symbols to those in the map file
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = copy $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = copy $< $@
 
 
 #
 #  The following is NOT needed for the NSPR 2.0 library.
 #
 
 OS_CFLAGS += -d_WINDOWS -d_MSC_VER=700
 
--- a/security/coreconf/WIN32.mk
+++ b/security/coreconf/WIN32.mk
@@ -152,17 +152,17 @@ endif # NS_USE_GCC
 
 DEFINES += -DWIN32
 ifdef MAPFILE
 ifndef NS_USE_GCC
 DLLFLAGS += -DEF:$(MAPFILE)
 endif
 endif
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 
 #
 #  The following is NOT needed for the NSPR 2.0 library.
 #
 
 DEFINES += -D_WINDOWS
 
--- a/security/coreconf/WINCE.mk
+++ b/security/coreconf/WINCE.mk
@@ -106,17 +106,17 @@ endif
 
 # DEFINES += -DWIN32
 
 ifdef MAPFILE
     DLLFLAGS += -DEF:$(MAPFILE)
 endif
 
 # Change PROCESS to put the mapfile in the correct format for this platform
-PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
+PROCESS_MAP_FILE = cp $< $@
 
 #
 #  The following is NOT needed for the NSPR 2.0 library.
 #
 
 DEFINES += -D_WINDOWS
 
 # override default, which is ASFLAGS = CFLAGS
--- a/security/coreconf/rules.mk
+++ b/security/coreconf/rules.mk
@@ -368,17 +368,17 @@ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
 ifdef NS_USE_GCC
 	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
 else
 	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
 endif
 	@echo $(RES) finished
 endif
 
-$(MAPFILE): $(LIBRARY_NAME).def
+$(MAPFILE): $(MAPFILE_SOURCE)
 	@$(MAKE_OBJDIR)
 	$(PROCESS_MAP_FILE)
 
 
 $(OBJDIR)/$(PROG_PREFIX)%$(PROG_SUFFIX): $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX)
 	@$(MAKE_OBJDIR)
 ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
 	$(MKPROG) $< -Fe$@ -link \
--- a/security/coreconf/ruleset.mk
+++ b/security/coreconf/ruleset.mk
@@ -118,16 +118,19 @@ endif
 
 ifdef LIBRARY_NAME
     ifndef LIBRARY
 	LIBRARY        = $(OBJDIR)/$(LIB_PREFIX)$(LIBRARY_NAME).$(LIB_SUFFIX)
     endif
     ifndef SHARED_LIBRARY
 	SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(JDK_DEBUG_SUFFIX).$(DLL_SUFFIX)
     endif
+    ifndef MAPFILE_SOURCE
+	MAPFILE_SOURCE = $(LIBRARY_NAME).def
+    endif
 endif
 
 #
 # Common rules used by lots of makefiles...
 #
 
 ifdef PROGRAM
     PROGRAM := $(addprefix $(OBJDIR)/, $(PROGRAM)$(JDK_DEBUG_SUFFIX)$(PROG_SUFFIX))