Browse Source

* updated to new style

peter 27 years ago
parent
commit
d19599fd1c
1 changed files with 49 additions and 35 deletions
  1. 49 35
      rtl/amiga/makefile

+ 49 - 35
rtl/amiga/makefile

@@ -48,22 +48,30 @@ ifndef OPT
 OPT=
 endif
 
-# Where is the PPUMOVE program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
+# Use smartlinking ?
+ifndef SMARTLINK
+SMARTLINK=NO
 endif
 
-# Set this to 'shared' or 'static'
-LIBTYPE=shared
+# 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.
+ifndef LIBNAME
+LIBNAME=
+#LIBNAME=fpc
+endif
 
-# AOUT should be defined in main makefile.
-# But you can set it here too.
-# AOUT = -DAOUT
+# Should the library be shared or static (only if LIBNAME is set).
+# Set this to 'shared' or 'static' to create a librrary
+# Setting this to shared will disable smart linking.
+ifndef  LIBTYPE
+LIBTYPE=
+#LIBTYPE=static
+endif
 
-# Do you want to link to the C library ?
-# Standard it is NO. You can set it to YES to link in th C library.
-ifndef LINK_TO_C
-LINK_TO_C=NO
+# Where is the PPUMOVE program ?
+ifndef PPUMOVE
+PPUMOVE=ppumove
 endif
 
 #####################################################################
@@ -108,10 +116,9 @@ SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 # System dependent
 #####################################################################
 
-# Check if we need C library.
-ifeq ($(LINK_TO_C),YES)
-override OPT:=$(OPT) -dCRTLIB
-endif
+# Override extensions
+PPUEXT=.ppa
+ASMEXT=.asm
 
 # Define Linux Units
 SYSTEMPPU=sysamiga$(PPUEXT)
@@ -121,11 +128,7 @@ PRT=prt0
 LOADERAS=$(PRT).as
 
 # Define Loaders
-ifeq ($(LINK_TO_C),NO)
 LOADERS=prt0
-else
-LOADERS=lprt
-endif
 
 # Add Prefix and Suffixes
 OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
@@ -165,8 +168,8 @@ prt0$(OEXT) : $(LOADERAS)
 $(SYSTEMPPU) : sysamiga.pas $(SYSLINUXDEPS) $(SYSDEPS)
 	$(PP) $(OPT) -Us -Sg sysamiga.pas $(REDIR)
 
-strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
-	$(COPY) $(PROCINC)/strings.pp .
+strings$(PPUEXT) : ../template/strings.pp $(SYSTEMPPU)
+	$(COPY) ../template/strings.pp .
 	$(PP) $(OPT) strings $(REDIR)
 	$(DEL) strings.pp
 
@@ -190,7 +193,7 @@ objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
 #dos$(PPUEXT) : $(DOSDEPS) $(SYSTEMPPU)
 #	$(PP) $(OPT) dos $(REDIR)
 
-crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(INC)/filerec.inc $(SYSTEMPPU)
+crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(SYSTEMPPU)
 	$(PP) $(OPT) crt $(REDIR)
 
 objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
@@ -206,21 +209,32 @@ objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
 # Libs
 #####################################################################
 
-libs	: all libfpc$(LIBEXT)
-
-libfpc.so:
-	$(PPUMOVE) -o fpc *.ppu
+staticlib:
+	make clean
+	make all SMARTLINK=YES LIBNAME=fpc LIBTYPE=static
+
+sharedlib:
+	make clean
+	make all
+	$(PPUMOVE) -o fpc $(SHAREDLIBFILES)
+
+staticlibinstall: staticlib
+	$(MKDIR) $(STATIC_LIBINSTALLDIR)
+	$(MKDIR) $(STATIC_UNITINSTALLDIR)
+	$(INSTALLEXE) libfpc$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)
+	$(INSTALL) *$(PPUEXT) *$(OEXT) $(STATIC_UNITINSTALLDIR)
+
+sharedlibinstall: sharedlib
+	$(MKDIR) $(SHARED_LIBINSTALLDIR)
+	$(MKDIR) $(SHARED_UNITINSTALLDIR)
+	$(INSTALLEXE) libfpc$(SHAREDLIBEXT) $(SHARED_LIBINSTALLDIR)
+	$(INSTALL) *$(PPUEXT) *$(OEXT) $(SHARED_UNITINSTALLDIR)
+	ldconfig
 
-libfpc.a:
-	$(PPUMOVE) -s -o fpc *.ppu
+libinstall: staticlibinstall sharedlibinstall
 
-libinstall : libs
-	$(INSTALLEXE) libfpc$(LIBEXT) $(LIBINSTALLDIR)
-	$(INSTALL) *$(PPLEXT) $(UNITINSTALLDIR)
-	ldconfig
-	
 libsclean : clean
-	-$(DEL) *.a *.so *$(PPLEXT)
+	-$(DEL) *$(SMARTLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 
 #####################################################################
 # Default targets