Browse Source

* install more like debian with build/install rules

peter 25 years ago
parent
commit
b3cc108b8e
1 changed files with 74 additions and 106 deletions
  1. 74 106
      install/Makefile.fpc

+ 74 - 106
install/Makefile.fpc

@@ -5,9 +5,6 @@
 [defaults]
 [defaults]
 defaultrule=help
 defaultrule=help
 
 
-[dirs]
-fpcdir=..
-
 [sections]
 [sections]
 info=0
 info=0
 
 
@@ -18,6 +15,14 @@ tooldate=1
 
 
 
 
 [presettings]
 [presettings]
+OLDFPCDIR:=$(FPCDIR)
+
+checkfpcdir:
+ifdef OLDFPCDIR
+        @echo You must unset FPCDIR to use this Makefile
+        @exit 1
+endif
+
 # Test dir if none specified
 # Test dir if none specified
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
 PREFIXINSTALLDIR=/pptest
 PREFIXINSTALLDIR=/pptest
@@ -25,26 +30,25 @@ endif
 
 
 # Directory to the base of the CVS tree
 # Directory to the base of the CVS tree
 CVSBASE=..
 CVSBASE=..
-CFG=$(CVSBASE)/rtl/cfg
+
+# Always compile for release
+override RELEASE=1
 
 
 # Temporary path to pack a file
 # Temporary path to pack a file
-PACKDIR=$(subst \,/,$(TMP))/pp_tmp
+BASEPACKDIR=$(BASEDIR)/basepack
 
 
 # Use new ppc386
 # Use new ppc386
 PPNEW=$(BASEDIR)/$(CVSBASE)/compiler/ppc386.exe
 PPNEW=$(BASEDIR)/$(CVSBASE)/compiler/ppc386.exe
 PPUFILESNEW=$(BASEDIR)/$(CVSBASE)/utils/ppufiles.exe
 PPUFILESNEW=$(BASEDIR)/$(CVSBASE)/utils/ppufiles.exe
 
 
-# Test dir if none specified
-ifndef PACKAGEDIR
-PACKAGEDIR=$(BASEDIR)
-endif
+# Build/install options
+BUILDOPTS=FPC=$(PPNEW) RELEASE=1
+INSTALLOPTS=FPC=$(PPNEW) PPUFILES=$(PPUFILESNEW) ZIPDESTDIR=$(BASEDIR)
 
 
-BUILDOPTSGO32V2=OS_TARGET=go32v2 FPC=$(PPNEW) RELEASE=1
-INSTALLOPTSGO32V2=OS_TARGET=go32v2 FPC=$(PPNEW) PPUFILES=$(PPUFILESNEW)
-BUILDOPTSWIN32=OS_TARGET=win32 FPC=$(PPNEW) RELEASE=1
-INSTALLOPTSWIN32=OS_TARGET=win32 FPC=$(PPNEW) PPUFILES=$(PPUFILESNEW)
 
 
 [rules]
 [rules]
+.PHONY: help checkfpcdir
+
 help:
 help:
         @echo
         @echo
         @echo Possible targets are:
         @echo Possible targets are:
@@ -52,128 +56,92 @@ help:
         @echo basego32, basego32.zip
         @echo basego32, basego32.zip
         @echo basew32,  basew32.zip
         @echo basew32,  basew32.zip
         @echo
         @echo
-        @exit
+        @exit 1
+
 
 
 ##########################################################################
 ##########################################################################
 # Install
 # Install
 ##########################################################################
 ##########################################################################
 
 
+.PHONY: installer
+
 installer:
 installer:
         $(MAKE) -C fpinst all RELEASE=1
         $(MAKE) -C fpinst all RELEASE=1
 
 
+
 ##########################################################################
 ##########################################################################
 # Basego32.zip
 # Basego32.zip
 ##########################################################################
 ##########################################################################
 
 
-p:
-        $(MAKE) -C $(CVSBASE) compiler_install $(INSTALLOPTSGO32V2)
+.PHONY: build installbase zipinstall zipinstallbase zipinstallfcl \
+        zipinstallpackages
 
 
-basego32:
+export RELEASE DESTZIPDIR
+
+build: checkfpcdir
 # create new compiler
 # create new compiler
-        $(MAKE) -C $(CVSBASE) compiler_cycle OS_TARGET=go32v2 RELEASE=1
+        -$(MAKE) -C $(CVSBASE) compiler_cycle
 # clean
 # clean
-        $(MAKE) -C $(CVSBASE) rtl_clean OS_TARGET=go32v2
-        $(MAKE) -C $(CVSBASE) fcl_clean OS_TARGET=go32v2
-        $(MAKE) -C $(CVSBASE) packages_clean OS_TARGET=go32v2
-        $(MAKE) -C $(CVSBASE) utils_clean OS_TARGET=go32v2
+        $(MAKE) -C $(CVSBASE) rtl_clean
+        $(MAKE) -C $(CVSBASE) fcl_clean
+        $(MAKE) -C $(CVSBASE) packages_clean
+        $(MAKE) -C $(CVSBASE) utils_clean
 # build everything
 # build everything
-        $(MAKE) -C $(CVSBASE) rtl_smart $(BUILDOPTSGO32V2)
-        $(MAKE) -C $(CVSBASE) fcl_smart $(BUILDOPTSGO32V2)
-        $(MAKE) -C $(CVSBASE) packages_smart $(BUILDOPTSGO32V2)
-        $(MAKE) -C $(CVSBASE) utils_all $(BUILDOPTSGO32V2)
-# install
-        # create dirs
+        $(MAKE) -C $(CVSBASE) rtl_smart $(BUILDOPTS)
+        $(MAKE) -C $(CVSBASE) fcl_smart $(BUILDOPTS)
+        $(MAKE) -C $(CVSBASE) packages_smart $(BUILDOPTS)
+        $(MAKE) -C $(CVSBASE) utils_all $(BUILDOPTS)
+
+
+installbase:
+# create dirs
         $(MKDIR) $(BASEINSTALLDIR)
         $(MKDIR) $(BASEINSTALLDIR)
         $(MKDIR) $(DOCINSTALLDIR)
         $(MKDIR) $(DOCINSTALLDIR)
         $(MKDIR) $(BININSTALLDIR)
         $(MKDIR) $(BININSTALLDIR)
         $(MKDIR) $(SOURCEINSTALLDIR)
         $(MKDIR) $(SOURCEINSTALLDIR)
-        # readme & whatsnew and docs
+# readme & whatsnew and docs
         $(COPY) doc/*.txt doc/copying* $(DOCINSTALLDIR)
         $(COPY) doc/*.txt doc/copying* $(DOCINSTALLDIR)
-        # bingo32 (cwsdpmi,wmemu387.dxe)
+# bingo32 (cwsdpmi,wmemu387.dxe)
+ifeq ($(OS_TARGET),go32v2)
         $(COPY) bingo32/* $(BININSTALLDIR)
         $(COPY) bingo32/* $(BININSTALLDIR)
-        # source (base)
+endif
+# source (base)
         $(COPY) $(CVSBASE)/Makefile $(CVSBASE)/Makefile.fpc $(SOURCEINSTALLDIR)
         $(COPY) $(CVSBASE)/Makefile $(CVSBASE)/Makefile.fpc $(SOURCEINSTALLDIR)
-        # install generated things
-        $(MAKE) -C $(CVSBASE) compiler_install $(INSTALLOPTSGO32V2)
-        $(MAKE) -C $(CVSBASE) rtl_install $(INSTALLOPTSGO32V2)
-        $(MAKE) -C $(CVSBASE) fcl_install $(INSTALLOPTSGO32V2)
-        $(MAKE) -C $(CVSBASE) packages_install $(INSTALLOPTSGO32V2)
-        $(MAKE) -C $(CVSBASE) utils_install $(INSTALLOPTSGO32V2)
+# install generated things
+        $(MAKE) -C $(CVSBASE) compiler_install $(INSTALLOPTS)
+        $(MAKE) -C $(CVSBASE) rtl_install $(INSTALLOPTS)
+        $(MAKE) -C $(CVSBASE) utils_install $(INSTALLOPTS)
 
 
-basego32.zip:
-        $(MAKE) basego32 BASEINSTALLDIR=$(PACKDIR)
-        cd $(PACKDIR) ; $(ZIPPROG) $(PACKAGEDIR)/basego32.zip * ; cd $(BASEDIR)
-        $(DELTREE) $(PACKDIR)
+zipinstallbase:
+        $(MKDIR) $(BASEPACKDIR)
+        $(MAKE) installbase PREFIXINSTALLDIR=$(BASEPACKDIR)
+        cd $(BASEPACKDIR) ; $(ZIPPROG) $(DESTZIPDIR)/basego32.zip * ; cd $(BASEDIR)
+        $(DELTREE) $(BASEPACKDIR)
 
 
+zipinstallapi:
+        $(MAKE) -C $(CVSBASE) api_zipinstall $(INSTALLOPTS)
 
 
-##########################################################################
-# basew32.zip
-##########################################################################
+zipinstallfcl:
+        $(MAKE) -C $(CVSBASE) fcl_zipinstall $(INSTALLOPTS)
+
+zipinstallpackages:
+        $(MAKE) -C $(CVSBASE) packages_install $(INSTALLOPTS)
 
 
-basew32:
-# create dirs
-        $(MKDIR) $(BASEINSTALLDIR)
-        $(MKDIR) $(DOCINSTALLDIR)
-        $(MKDIR) $(BININSTALLDIR)
-        $(MKDIR) $(SOURCEINSTALLDIR)
-# readme & whatsnew and docs
-        $(COPY) doc/*.txt doc/copying* $(DOCINSTALLDIR)
-# source (base)
-        $(COPY) $(CVSBASE)/base/Makefile $(CVSBASE)/base/makefile.fpc $(SOURCEINSTALLDIR)
-# readme.txt & whatsnew.txt
-        $(MKDIR) $(BASEINSTALLDIR)
-        $(COPY) readme.txt whatsnew.txt $(BASEINSTALLDIR)
-# compiler, the - is necessary because the files sometimes differ
-        -$(MAKE) -C $(CVSBASE)/compiler cycle OS_TARGET=win32 RELEASE=1
-        $(MAKE) -C $(CVSBASE)/compiler install OS_TARGET=win32
-# rtl
-        $(MAKE) -C $(CVSBASE)/rtl/win32 clean OS_TARGET=win32
-        $(MAKE) -C $(CVSBASE)/rtl/win32 install OS_TARGET=win32 RELEASE=1 FPC=$(PPNEW)
-# rtl libs
-#       $(MAKE) -C $(CVSBASE)/rtl/win32 clean OS_TARGET=win32
-#       $(MAKE) -C $(CVSBASE)/rtl/win32 libinstall OS_TARGET=win32 RELEASE=1 FPC=$(PPNEW)
-# utils
-        $(MAKE) -C $(CVSBASE)/utils clean OS_TARGET=win32
-        $(MAKE) -C $(CVSBASE)/utils install OS_TARGET=win32 RELEASE=1 FPC=$(PPNEW)
-
-basew32.zip:
-        $(MAKE) basew32 BASEINSTALLDIR=$(PACKDIR)
-        $(MKDIR) $(PACKAGEDIR)
-# Maybe you need 4dos for it, becuase unix paths with / are used
-        cd $(PACKDIR)
-        $(ZIPPROG) $(PACKAGEDIR)/basew32.zip *
-        cd $(BASEDIR)
-        $(DELTREE) $(PACKDIR)
+
+zipinstall: build \
+            zipinstallbase zipinstallapi zipinstallfcl \
+            zipinstallpackages
 
 
 
 
 ##########################################################################
 ##########################################################################
-# Baseemx.zip
+# go32v2,win32 specific targets
 ##########################################################################
 ##########################################################################
 
 
-baseemx:
-# create dirs
-        $(MKDIR) $(BASEINSTALLDIR)
-        $(MKDIR) $(DOCINSTALLDIR)
-        $(MKDIR) $(BININSTALLDIR)
-        $(MKDIR) $(SOURCEINSTALLDIR)
-# readme & whatsnew and docs
-        $(COPY) doc/*.txt doc/copying* $(DOCINSTALLDIR)
-# source (base)
-        $(COPY) $(CVSBASE)/base/Makefile $(CVSBASE)/base/makefile.fpc $(SOURCEINSTALLDIR)
-# compiler
-        $(MAKE) -C $(CVSBASE)/compiler cycle OS_TARGET=os2 RELEASE=1
-        $(MAKE) -C $(CVSBASE)/compiler install OS_TARGET=os2
-# rtl os2
-        $(MAKE) -C $(CVSBASE)/rtl/go32v2 clean OS_TARGET=os2
-        $(MAKE) -C $(CVSBASE)/rtl/go32v2 install OS_TARGET=os2 RELEASE=1 FPC=$(PPNEW)
-# rtl go32v2 libs
-#       $(MAKE) -C $(CVSBASE)/rtl/go32v2 clean OS_TARGET=go32v2
-#       $(MAKE) -C $(CVSBASE)/rtl/go32v2 libinstall OS_TARGET=go32v2 RELEASE=1 FPC=$(PPNEW)
-# utils
-        $(MAKE) -C $(CVSBASE)/utils clean OS_TARGET=os2
-        $(MAKE) -C $(CVSBASE)/utils install OS_TARGET=os2 RELEASE=1 FPC=$(PPNEW)
-
-baseemx.zip:
-        $(MAKE) baseemx BASEINSTALLDIR=$(PACKDIR)
-        cd $(PACKDIR) ; $(ZIPPROG) $(PACKAGEDIR)/baseemx.zip * ; cd $(BASEDIR)
-        $(DELTREE) $(PACKDIR)
+.PHONY: go32v2 win32
+
+go32v2:
+        $(MAKE) zipinstall OS_TARGET=go32v2
+
+win32:
+        $(MAKE) zipinstall OS_TARGET=win32
+