Browse Source

Added library support, and smartlinking

michael 27 years ago
parent
commit
313eb0443e
1 changed files with 42 additions and 3 deletions
  1. 42 3
      rtl/linux/makefile

+ 42 - 3
rtl/linux/makefile

@@ -37,6 +37,22 @@ CPU=i386
 #CPU=m68k
 #CPU=m68k
 endif
 endif
 
 
+# Do you want smartlinking enabled (YES/NO) ?
+ifndef SMARTLINK
+SMARTLINK=YES
+endif
+
+# Name of library ?
+# If this is set, all units will be put in the same library.
+# If it is empty (default), the units will be left in separate files.
+LIBNAME=
+#LIBNAME=fpc
+
+# Should the library be shared or static (only if LIBNAME is set).
+# Set this to 'shared' or 'static'.
+# Setting this to shared will disable smart linking.
+LIBTYPE=shared
+
 # What compiler to use ?
 # What compiler to use ?
 ifndef PP
 ifndef PP
 PP=ppc386
 PP=ppc386
@@ -53,8 +69,6 @@ ifndef PPUMOVE
 PPUMOVE=ppumove
 PPUMOVE=ppumove
 endif
 endif
 
 
-# Set this to 'shared' or 'static'
-LIBTYPE=shared
 
 
 # AOUT should be defined in main makefile.
 # AOUT should be defined in main makefile.
 # But you can set it here too.
 # But you can set it here too.
@@ -113,6 +127,28 @@ ifeq ($(LINK_TO_C),YES)
 override OPT:=$(OPT) -dCRTLIB
 override OPT:=$(OPT) -dCRTLIB
 endif
 endif
 
 
+
+# Smart linking requested ?
+ifeq ($(SMARTLINK),YES)
+# no use with shared libs.
+ifneq ($(LIBNAME),)
+ifneq ($(LIBTYPE),shared)
+override OPT:=$(OPT) -Xl
+endif
+else
+override OPT:=$(OPT) -Xl
+endif
+endif
+
+ifneq ($(LIBNAME),)
+override OPT:=$(OPT) -o$(LIBNAME)
+ifeq ($(LIBTYPE),shared)
+override OPT:=$(OPT) -CD
+else
+override OPT:=$(OPT) -CS
+endif
+endif
+
 # Define Linux Units
 # Define Linux Units
 SYSTEMPPU=syslinux$(PPUEXT)
 SYSTEMPPU=syslinux$(PPUEXT)
 OBJECTS=strings linux objpas sysutils math\
 OBJECTS=strings linux objpas sysutils math\
@@ -296,7 +332,10 @@ include $(CFG)/makefile.def
 
 
 #
 #
 # $Log$
 # $Log$
-# Revision 1.17  1998-08-15 17:08:09  peter
+# Revision 1.18  1998-08-16 10:22:57  michael
+# Added library support, and smartlinking
+#
+# Revision 1.17  1998/08/15 17:08:09  peter
 #   + support for cprt0.o
 #   + support for cprt0.o
 #
 #
 #
 #