Browse Source

* fpcmake updates

peter 26 years ago
parent
commit
c29072c681

+ 776 - 42
packages/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 16:42
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:14
 #
 
 defaultrule: all
@@ -118,6 +118,13 @@ endif
 
 # Targets
 
+DIROBJECTS+=$(wildcard ibase mysql uncgi paszlib gdbint api fv)
+ifeq ($(OS_TARGET),linux)
+DIROBJECTS+=$(wildcard gtk opengl utmp inet postgres ncurses forms svgalib ggi)
+endif
+ifeq ($(OS_TARGET),win32)
+DIROBJECTS+=$(wildcard gtk opengl)
+endif
 
 # Clean
 
@@ -130,6 +137,12 @@ endif
 
 # Directories
 
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -138,72 +151,793 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
-staticlib: fpc_staticlib
+all: $(addsuffix _all,$(DIROBJECTS))
 
-sharedlib: fpc_sharedlib
+debug: $(addsuffix _debug,$(DIROBJECTS))
 
-showinstall: fpc_showinstall
+examples: $(addsuffix _examples,$(DIROBJECTS))
 
-staticinstall: fpc_staticinstall
+smart: $(addsuffix _smart,$(DIROBJECTS))
 
-sharedinstall: fpc_sharedinstall
+shared: $(addsuffix _shared,$(DIROBJECTS))
 
-libinstall: fpc_libinstall
+showinstall: $(addsuffix _showinstall,$(DIROBJECTS))
 
-zipinstall: fpc_zipinstall
+install: $(addsuffix _install,$(DIROBJECTS))
 
-zipinstalladd: fpc_zipinstalladd
+zipinstall: $(addsuffix _zipinstall,$(DIROBJECTS))
 
-clean_all: fpc_clean_all
+zipinstalladd: $(addsuffix _zipinstalladd,$(DIROBJECTS))
 
-depend: fpc_depend
+clean: $(addsuffix _clean,$(DIROBJECTS))
 
-info: fpc_info
+cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
 
-#####################################################################
-# Users rules
-#####################################################################
+depend: $(addsuffix _depend,$(DIROBJECTS))
 
+info: $(addsuffix _info,$(DIROBJECTS))
 
-all:
-	$(MAKE) -C ibase
-	$(MAKE) -C mysql
-	$(MAKE) -C uncgi
-ifdef inlinux
-	$(MAKE) -C utmp
-	$(MAKE) -C inet
-	$(MAKE) -C postgres
-	$(MAKE) -C ncurses
-	$(MAKE) -C forms
-	$(MAKE) -C svgalib
-endif
 
-clean:
+# Dir ibase
+
+ibase_all:
+	$(MAKE) -C ibase all
+
+ibase_debug:
+	$(MAKE) -C ibase debug
+
+ibase_examples:
+	$(MAKE) -C ibase examples
+
+ibase_smart:
+	$(MAKE) -C ibase smart
+
+ibase_shared:
+	$(MAKE) -C ibase shared
+
+ibase_showinstall:
+	$(MAKE) -C ibase showinstall
+
+ibase_install:
+	$(MAKE) -C ibase install
+
+ibase_zipinstall:
+	$(MAKE) -C ibase zipinstall
+
+ibase_zipinstalladd:
+	$(MAKE) -C ibase zipinstalladd
+
+ibase_clean:
 	$(MAKE) -C ibase clean
+
+ibase_cleanall:
+	$(MAKE) -C ibase cleanall
+
+ibase_depend:
+	$(MAKE) -C ibase depend
+
+ibase_info:
+	$(MAKE) -C ibase info
+
+
+# Dir mysql
+
+mysql_all:
+	$(MAKE) -C mysql all
+
+mysql_debug:
+	$(MAKE) -C mysql debug
+
+mysql_examples:
+	$(MAKE) -C mysql examples
+
+mysql_smart:
+	$(MAKE) -C mysql smart
+
+mysql_shared:
+	$(MAKE) -C mysql shared
+
+mysql_showinstall:
+	$(MAKE) -C mysql showinstall
+
+mysql_install:
+	$(MAKE) -C mysql install
+
+mysql_zipinstall:
+	$(MAKE) -C mysql zipinstall
+
+mysql_zipinstalladd:
+	$(MAKE) -C mysql zipinstalladd
+
+mysql_clean:
 	$(MAKE) -C mysql clean
+
+mysql_cleanall:
+	$(MAKE) -C mysql cleanall
+
+mysql_depend:
+	$(MAKE) -C mysql depend
+
+mysql_info:
+	$(MAKE) -C mysql info
+
+
+# Dir uncgi
+
+uncgi_all:
+	$(MAKE) -C uncgi all
+
+uncgi_debug:
+	$(MAKE) -C uncgi debug
+
+uncgi_examples:
+	$(MAKE) -C uncgi examples
+
+uncgi_smart:
+	$(MAKE) -C uncgi smart
+
+uncgi_shared:
+	$(MAKE) -C uncgi shared
+
+uncgi_showinstall:
+	$(MAKE) -C uncgi showinstall
+
+uncgi_install:
+	$(MAKE) -C uncgi install
+
+uncgi_zipinstall:
+	$(MAKE) -C uncgi zipinstall
+
+uncgi_zipinstalladd:
+	$(MAKE) -C uncgi zipinstalladd
+
+uncgi_clean:
 	$(MAKE) -C uncgi clean
-ifdef inlinux
+
+uncgi_cleanall:
+	$(MAKE) -C uncgi cleanall
+
+uncgi_depend:
+	$(MAKE) -C uncgi depend
+
+uncgi_info:
+	$(MAKE) -C uncgi info
+
+
+# Dir paszlib
+
+paszlib_all:
+	$(MAKE) -C paszlib all
+
+paszlib_debug:
+	$(MAKE) -C paszlib debug
+
+paszlib_examples:
+	$(MAKE) -C paszlib examples
+
+paszlib_smart:
+	$(MAKE) -C paszlib smart
+
+paszlib_shared:
+	$(MAKE) -C paszlib shared
+
+paszlib_showinstall:
+	$(MAKE) -C paszlib showinstall
+
+paszlib_install:
+	$(MAKE) -C paszlib install
+
+paszlib_zipinstall:
+	$(MAKE) -C paszlib zipinstall
+
+paszlib_zipinstalladd:
+	$(MAKE) -C paszlib zipinstalladd
+
+paszlib_clean:
+	$(MAKE) -C paszlib clean
+
+paszlib_cleanall:
+	$(MAKE) -C paszlib cleanall
+
+paszlib_depend:
+	$(MAKE) -C paszlib depend
+
+paszlib_info:
+	$(MAKE) -C paszlib info
+
+
+# Dir gdbint
+
+gdbint_all:
+	$(MAKE) -C gdbint all
+
+gdbint_debug:
+	$(MAKE) -C gdbint debug
+
+gdbint_examples:
+	$(MAKE) -C gdbint examples
+
+gdbint_smart:
+	$(MAKE) -C gdbint smart
+
+gdbint_shared:
+	$(MAKE) -C gdbint shared
+
+gdbint_showinstall:
+	$(MAKE) -C gdbint showinstall
+
+gdbint_install:
+	$(MAKE) -C gdbint install
+
+gdbint_zipinstall:
+	$(MAKE) -C gdbint zipinstall
+
+gdbint_zipinstalladd:
+	$(MAKE) -C gdbint zipinstalladd
+
+gdbint_clean:
+	$(MAKE) -C gdbint clean
+
+gdbint_cleanall:
+	$(MAKE) -C gdbint cleanall
+
+gdbint_depend:
+	$(MAKE) -C gdbint depend
+
+gdbint_info:
+	$(MAKE) -C gdbint info
+
+
+# Dir api
+
+api_all:
+	$(MAKE) -C api all
+
+api_debug:
+	$(MAKE) -C api debug
+
+api_examples:
+	$(MAKE) -C api examples
+
+api_smart:
+	$(MAKE) -C api smart
+
+api_shared:
+	$(MAKE) -C api shared
+
+api_showinstall:
+	$(MAKE) -C api showinstall
+
+api_install:
+	$(MAKE) -C api install
+
+api_zipinstall:
+	$(MAKE) -C api zipinstall
+
+api_zipinstalladd:
+	$(MAKE) -C api zipinstalladd
+
+api_clean:
+	$(MAKE) -C api clean
+
+api_cleanall:
+	$(MAKE) -C api cleanall
+
+api_depend:
+	$(MAKE) -C api depend
+
+api_info:
+	$(MAKE) -C api info
+
+
+# Dir fv
+
+fv_all:
+	$(MAKE) -C fv all
+
+fv_debug:
+	$(MAKE) -C fv debug
+
+fv_examples:
+	$(MAKE) -C fv examples
+
+fv_smart:
+	$(MAKE) -C fv smart
+
+fv_shared:
+	$(MAKE) -C fv shared
+
+fv_showinstall:
+	$(MAKE) -C fv showinstall
+
+fv_install:
+	$(MAKE) -C fv install
+
+fv_zipinstall:
+	$(MAKE) -C fv zipinstall
+
+fv_zipinstalladd:
+	$(MAKE) -C fv zipinstalladd
+
+fv_clean:
+	$(MAKE) -C fv clean
+
+fv_cleanall:
+	$(MAKE) -C fv cleanall
+
+fv_depend:
+	$(MAKE) -C fv depend
+
+fv_info:
+	$(MAKE) -C fv info
+
+ifeq ($(OS_TARGET),linux)
+
+# Dir gtk
+
+gtk_all:
+	$(MAKE) -C gtk all
+
+gtk_debug:
+	$(MAKE) -C gtk debug
+
+gtk_examples:
+	$(MAKE) -C gtk examples
+
+gtk_smart:
+	$(MAKE) -C gtk smart
+
+gtk_shared:
+	$(MAKE) -C gtk shared
+
+gtk_showinstall:
+	$(MAKE) -C gtk showinstall
+
+gtk_install:
+	$(MAKE) -C gtk install
+
+gtk_zipinstall:
+	$(MAKE) -C gtk zipinstall
+
+gtk_zipinstalladd:
+	$(MAKE) -C gtk zipinstalladd
+
+gtk_clean:
+	$(MAKE) -C gtk clean
+
+gtk_cleanall:
+	$(MAKE) -C gtk cleanall
+
+gtk_depend:
+	$(MAKE) -C gtk depend
+
+gtk_info:
+	$(MAKE) -C gtk info
+
+
+# Dir opengl
+
+opengl_all:
+	$(MAKE) -C opengl all
+
+opengl_debug:
+	$(MAKE) -C opengl debug
+
+opengl_examples:
+	$(MAKE) -C opengl examples
+
+opengl_smart:
+	$(MAKE) -C opengl smart
+
+opengl_shared:
+	$(MAKE) -C opengl shared
+
+opengl_showinstall:
+	$(MAKE) -C opengl showinstall
+
+opengl_install:
+	$(MAKE) -C opengl install
+
+opengl_zipinstall:
+	$(MAKE) -C opengl zipinstall
+
+opengl_zipinstalladd:
+	$(MAKE) -C opengl zipinstalladd
+
+opengl_clean:
+	$(MAKE) -C opengl clean
+
+opengl_cleanall:
+	$(MAKE) -C opengl cleanall
+
+opengl_depend:
+	$(MAKE) -C opengl depend
+
+opengl_info:
+	$(MAKE) -C opengl info
+
+
+# Dir utmp
+
+utmp_all:
+	$(MAKE) -C utmp all
+
+utmp_debug:
+	$(MAKE) -C utmp debug
+
+utmp_examples:
+	$(MAKE) -C utmp examples
+
+utmp_smart:
+	$(MAKE) -C utmp smart
+
+utmp_shared:
+	$(MAKE) -C utmp shared
+
+utmp_showinstall:
+	$(MAKE) -C utmp showinstall
+
+utmp_install:
+	$(MAKE) -C utmp install
+
+utmp_zipinstall:
+	$(MAKE) -C utmp zipinstall
+
+utmp_zipinstalladd:
+	$(MAKE) -C utmp zipinstalladd
+
+utmp_clean:
 	$(MAKE) -C utmp clean
+
+utmp_cleanall:
+	$(MAKE) -C utmp cleanall
+
+utmp_depend:
+	$(MAKE) -C utmp depend
+
+utmp_info:
+	$(MAKE) -C utmp info
+
+
+# Dir inet
+
+inet_all:
+	$(MAKE) -C inet all
+
+inet_debug:
+	$(MAKE) -C inet debug
+
+inet_examples:
+	$(MAKE) -C inet examples
+
+inet_smart:
+	$(MAKE) -C inet smart
+
+inet_shared:
+	$(MAKE) -C inet shared
+
+inet_showinstall:
+	$(MAKE) -C inet showinstall
+
+inet_install:
+	$(MAKE) -C inet install
+
+inet_zipinstall:
+	$(MAKE) -C inet zipinstall
+
+inet_zipinstalladd:
+	$(MAKE) -C inet zipinstalladd
+
+inet_clean:
 	$(MAKE) -C inet clean
+
+inet_cleanall:
+	$(MAKE) -C inet cleanall
+
+inet_depend:
+	$(MAKE) -C inet depend
+
+inet_info:
+	$(MAKE) -C inet info
+
+
+# Dir postgres
+
+postgres_all:
+	$(MAKE) -C postgres all
+
+postgres_debug:
+	$(MAKE) -C postgres debug
+
+postgres_examples:
+	$(MAKE) -C postgres examples
+
+postgres_smart:
+	$(MAKE) -C postgres smart
+
+postgres_shared:
+	$(MAKE) -C postgres shared
+
+postgres_showinstall:
+	$(MAKE) -C postgres showinstall
+
+postgres_install:
+	$(MAKE) -C postgres install
+
+postgres_zipinstall:
+	$(MAKE) -C postgres zipinstall
+
+postgres_zipinstalladd:
+	$(MAKE) -C postgres zipinstalladd
+
+postgres_clean:
 	$(MAKE) -C postgres clean
+
+postgres_cleanall:
+	$(MAKE) -C postgres cleanall
+
+postgres_depend:
+	$(MAKE) -C postgres depend
+
+postgres_info:
+	$(MAKE) -C postgres info
+
+
+# Dir ncurses
+
+ncurses_all:
+	$(MAKE) -C ncurses all
+
+ncurses_debug:
+	$(MAKE) -C ncurses debug
+
+ncurses_examples:
+	$(MAKE) -C ncurses examples
+
+ncurses_smart:
+	$(MAKE) -C ncurses smart
+
+ncurses_shared:
+	$(MAKE) -C ncurses shared
+
+ncurses_showinstall:
+	$(MAKE) -C ncurses showinstall
+
+ncurses_install:
+	$(MAKE) -C ncurses install
+
+ncurses_zipinstall:
+	$(MAKE) -C ncurses zipinstall
+
+ncurses_zipinstalladd:
+	$(MAKE) -C ncurses zipinstalladd
+
+ncurses_clean:
 	$(MAKE) -C ncurses clean
+
+ncurses_cleanall:
+	$(MAKE) -C ncurses cleanall
+
+ncurses_depend:
+	$(MAKE) -C ncurses depend
+
+ncurses_info:
+	$(MAKE) -C ncurses info
+
+
+# Dir forms
+
+forms_all:
+	$(MAKE) -C forms all
+
+forms_debug:
+	$(MAKE) -C forms debug
+
+forms_examples:
+	$(MAKE) -C forms examples
+
+forms_smart:
+	$(MAKE) -C forms smart
+
+forms_shared:
+	$(MAKE) -C forms shared
+
+forms_showinstall:
+	$(MAKE) -C forms showinstall
+
+forms_install:
+	$(MAKE) -C forms install
+
+forms_zipinstall:
+	$(MAKE) -C forms zipinstall
+
+forms_zipinstalladd:
+	$(MAKE) -C forms zipinstalladd
+
+forms_clean:
 	$(MAKE) -C forms clean
+
+forms_cleanall:
+	$(MAKE) -C forms cleanall
+
+forms_depend:
+	$(MAKE) -C forms depend
+
+forms_info:
+	$(MAKE) -C forms info
+
+
+# Dir svgalib
+
+svgalib_all:
+	$(MAKE) -C svgalib all
+
+svgalib_debug:
+	$(MAKE) -C svgalib debug
+
+svgalib_examples:
+	$(MAKE) -C svgalib examples
+
+svgalib_smart:
+	$(MAKE) -C svgalib smart
+
+svgalib_shared:
+	$(MAKE) -C svgalib shared
+
+svgalib_showinstall:
+	$(MAKE) -C svgalib showinstall
+
+svgalib_install:
+	$(MAKE) -C svgalib install
+
+svgalib_zipinstall:
+	$(MAKE) -C svgalib zipinstall
+
+svgalib_zipinstalladd:
+	$(MAKE) -C svgalib zipinstalladd
+
+svgalib_clean:
 	$(MAKE) -C svgalib clean
+
+svgalib_cleanall:
+	$(MAKE) -C svgalib cleanall
+
+svgalib_depend:
+	$(MAKE) -C svgalib depend
+
+svgalib_info:
+	$(MAKE) -C svgalib info
+
+
+# Dir ggi
+
+ggi_all:
+	$(MAKE) -C ggi all
+
+ggi_debug:
+	$(MAKE) -C ggi debug
+
+ggi_examples:
+	$(MAKE) -C ggi examples
+
+ggi_smart:
+	$(MAKE) -C ggi smart
+
+ggi_shared:
+	$(MAKE) -C ggi shared
+
+ggi_showinstall:
+	$(MAKE) -C ggi showinstall
+
+ggi_install:
+	$(MAKE) -C ggi install
+
+ggi_zipinstall:
+	$(MAKE) -C ggi zipinstall
+
+ggi_zipinstalladd:
+	$(MAKE) -C ggi zipinstalladd
+
+ggi_clean:
+	$(MAKE) -C ggi clean
+
+ggi_cleanall:
+	$(MAKE) -C ggi cleanall
+
+ggi_depend:
+	$(MAKE) -C ggi depend
+
+ggi_info:
+	$(MAKE) -C ggi info
+
 endif
+ifeq ($(OS_TARGET),win32)
+
+# Dir gtk
+
+gtk_all:
+	$(MAKE) -C gtk all
+
+gtk_debug:
+	$(MAKE) -C gtk debug
+
+gtk_examples:
+	$(MAKE) -C gtk examples
+
+gtk_smart:
+	$(MAKE) -C gtk smart
+
+gtk_shared:
+	$(MAKE) -C gtk shared
+
+gtk_showinstall:
+	$(MAKE) -C gtk showinstall
+
+gtk_install:
+	$(MAKE) -C gtk install
+
+gtk_zipinstall:
+	$(MAKE) -C gtk zipinstall
+
+gtk_zipinstalladd:
+	$(MAKE) -C gtk zipinstalladd
+
+gtk_clean:
+	$(MAKE) -C gtk clean
+
+gtk_cleanall:
+	$(MAKE) -C gtk cleanall
+
+gtk_depend:
+	$(MAKE) -C gtk depend
+
+gtk_info:
+	$(MAKE) -C gtk info
+
+
+# Dir opengl
+
+opengl_all:
+	$(MAKE) -C opengl all
+
+opengl_debug:
+	$(MAKE) -C opengl debug
+
+opengl_examples:
+	$(MAKE) -C opengl examples
+
+opengl_smart:
+	$(MAKE) -C opengl smart
+
+opengl_shared:
+	$(MAKE) -C opengl shared
+
+opengl_showinstall:
+	$(MAKE) -C opengl showinstall
+
+opengl_install:
+	$(MAKE) -C opengl install
+
+opengl_zipinstall:
+	$(MAKE) -C opengl zipinstall
+
+opengl_zipinstalladd:
+	$(MAKE) -C opengl zipinstalladd
+
+opengl_clean:
+	$(MAKE) -C opengl clean
+
+opengl_cleanall:
+	$(MAKE) -C opengl cleanall
+
+opengl_depend:
+	$(MAKE) -C opengl depend
+
+opengl_info:
+	$(MAKE) -C opengl info
 
-install:
-	$(MAKE) -C ibase DEFAULTUNITS=1 install
-	$(MAKE) -C mysql DEFAULTUNITS=1 install
-	$(MAKE) -C uncgi DEFAULTUNITS=1 install
-ifdef inlinux
-	$(MAKE) -C utmp DEFAULTUNITS=1 install
-	$(MAKE) -C inet DEFAULTUNITS=1 install
-	$(MAKE) -C postgres DEFAULTUNITS=1 install
-	$(MAKE) -C ncurses DEFAULTUNITS=1 install
-	$(MAKE) -C forms DEFAULTUNITS=1 install
-	$(MAKE) -C svgalib DEFAULTUNITS=1 install
 endif

+ 6 - 44
packages/Makefile.fpc

@@ -1,49 +1,11 @@
 #
-#   Makefile.fpc for Free Component Library
+#   Makefile.fpc for Free Pascal Packages
 #
 
+[targets]
+dirs=ibase mysql uncgi paszlib gdbint api fv
+dirs_linux=gtk opengl utmp inet postgres ncurses forms svgalib ggi
+dirs_win32=gtk opengl
+
 [sections]
 none=1
-
-[rules]
-all:
-        $(MAKE) -C ibase
-        $(MAKE) -C mysql
-        $(MAKE) -C uncgi
-	$(MAKE) -C paszlib
-ifdef inlinux
-        $(MAKE) -C utmp
-        $(MAKE) -C inet
-        $(MAKE) -C postgres
-        $(MAKE) -C ncurses
-        $(MAKE) -C forms
-        $(MAKE) -C svgalib
-endif
-
-clean:
-        $(MAKE) -C ibase clean
-        $(MAKE) -C mysql clean
-        $(MAKE) -C uncgi clean
-	$(MAKE) -C paszlib clean
-ifdef inlinux
-        $(MAKE) -C utmp clean
-        $(MAKE) -C inet clean
-        $(MAKE) -C postgres clean
-        $(MAKE) -C ncurses clean
-        $(MAKE) -C forms clean
-        $(MAKE) -C svgalib clean
-endif
-
-install:
-        $(MAKE) -C ibase DEFAULTUNITS=1 install
-        $(MAKE) -C mysql DEFAULTUNITS=1 install
-        $(MAKE) -C uncgi DEFAULTUNITS=1 install
-	$(MAKE) -C paszlib DEFAULTUNITS=1 install
-ifdef inlinux
-        $(MAKE) -C utmp DEFAULTUNITS=1 install
-        $(MAKE) -C inet DEFAULTUNITS=1 install
-        $(MAKE) -C postgres DEFAULTUNITS=1 install
-        $(MAKE) -C ncurses DEFAULTUNITS=1 install
-        $(MAKE) -C forms DEFAULTUNITS=1 install
-        $(MAKE) -C svgalib DEFAULTUNITS=1 install
-endif

+ 191 - 211
packages/forms/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 17:36
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:53
 #
 
 defaultrule: all
@@ -124,13 +124,13 @@ FORMSVERSION=88
 
 # Targets
 
-UNITOBJECTS=x xresource xlib xutil forms
-EXEOBJECTS=fd2pascal
+UNITOBJECTS+=x xresource xlib xutil forms
+EXEOBJECTS+=fd2pascal
 
 # Clean
 
-EXTRACLEANUNITS=forms-88 forms-86
-EXTRACLEANFILES=forms$(PASEXT)
+EXTRACLEANUNITS+=forms-88 forms-86
+EXTRACLEANFILES+=forms$(PASEXT)
 
 # Install
 
@@ -143,6 +143,12 @@ EXTRACLEANFILES=forms$(PASEXT)
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -162,6 +168,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -171,43 +182,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -219,16 +195,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -238,15 +204,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+endif
+
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
 endif
 
-# Where the .msg files will be stored
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -257,42 +236,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -308,11 +254,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
@@ -322,8 +263,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -420,16 +366,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -465,6 +401,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -606,67 +572,76 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
+
+smart: fpc_smart
 
-sharedlib: fpc_sharedlib
+shared: fpc_shared
 
 showinstall: fpc_showinstall
 
 install: fpc_install
 
-staticinstall: fpc_staticinstall
-
-sharedinstall: fpc_sharedinstall
-
-libinstall: fpc_libinstall
-
 zipinstall: fpc_zipinstall
 
 zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Exes
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_exes
 
-fpc_units: $(UNITPPUFILES)
+EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
+EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
+
+override ALLTARGET+=fpc_exes
+override INSTALLEXEFILES+=$(EXEFILES)
+override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
 
 fpc_exes: $(EXEFILES)
 
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
+
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -683,25 +658,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -716,54 +687,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
+endif
+endif
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -835,48 +816,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
+endif
+endif
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -898,6 +871,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -910,28 +897,21 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################
 # Users rules
 #####################################################################
 
-
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes
-
 forms$(PPUEXT): forms-$(FORMSVERSION)$(PASEXT) x$(PPUEXT) xresource$(PPUEXT) xlib$(PPUEXT)\
 	      xutil$(PPUEXT)
 	ln -sf forms-$(FORMSVERSION)$(PASEXT) forms$(PASEXT)
 	$(COMPILER) forms$(PASEXT)
+
+examples: all
+	$(MAKE) -C demo all

+ 3 - 6
packages/forms/Makefile.fpc

@@ -21,13 +21,10 @@ FORMSVERSION=88
 
 
 [rules]
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes
-
 forms$(PPUEXT): forms-$(FORMSVERSION)$(PASEXT) x$(PPUEXT) xresource$(PPUEXT) xlib$(PPUEXT)\
               xutil$(PPUEXT)
         ln -sf forms-$(FORMSVERSION)$(PASEXT) forms$(PASEXT)
         $(COMPILER) forms$(PASEXT)
+
+examples: all
+        $(MAKE) -C demo all

+ 171 - 194
packages/forms/demo/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 17:37
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:54
 #
 
 defaultrule: all
@@ -118,7 +118,7 @@ endif
 
 # Targets
 
-EXEOBJECTS=pushme yesno pushbutton touchbutton minput inputall choice butttypes colsel colsel1 buttonall chartall positioner secretinput cursor fdial ldial ndial invslider sliderall borderwidth boxtype xyplotover arrowbutton browserop browserall chartstrip colbrowser counter fbrowse1 fbrowse flclock fonts goodies lalign ll longlabel menu objinactive objpos newbutton multilabel objreturn
+EXEOBJECTS+=pushme yesno pushbutton touchbutton minput inputall choice butttypes colsel colsel1 buttonall chartall positioner secretinput cursor fdial ldial ndial invslider sliderall borderwidth boxtype xyplotover arrowbutton browserop browserall chartstrip colbrowser counter fbrowse1 fbrowse flclock fonts goodies lalign ll longlabel menu objinactive objpos newbutton multilabel objreturn
 
 # Clean
 
@@ -134,8 +134,14 @@ EXEOBJECTS=pushme yesno pushbutton touchbutton minput inputall choice butttypes
 ifndef FPCDIR
 FPCDIR=../../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
 override NEEDUNITDIR=..
 
+# Packages
+
+
 # Libraries
 
 override NEEDOTHERLIB=1
@@ -155,6 +161,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -164,34 +175,6 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
 # Where to find other libraries
 ifdef inlinux
 ifndef OTHERLIBDIR
@@ -200,7 +183,7 @@ endif
 endif
 
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -212,16 +195,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -231,15 +204,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+endif
+
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
 endif
 
-# Where the .msg files will be stored
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -250,42 +236,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -301,11 +254,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
@@ -324,8 +272,13 @@ override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -422,16 +375,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -467,6 +410,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -608,67 +581,62 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+smart: fpc_smart
+
+shared: fpc_shared
 
 showinstall: fpc_showinstall
 
 install: fpc_install
 
-staticinstall: fpc_staticinstall
-
-sharedinstall: fpc_sharedinstall
-
-libinstall: fpc_libinstall
-
 zipinstall: fpc_zipinstall
 
 zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Exes
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_exes
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
 EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
 EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
-UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+override ALLTARGET+=fpc_exes
+override INSTALLEXEFILES+=$(EXEFILES)
+override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+fpc_exes: $(EXEFILES)
+
+#####################################################################
+# General compile rules
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_all fpc_debug
 
-fpc_units: $(UNITPPUFILES)
+fpc_all: $(ALLTARGET)
 
-fpc_exes: $(EXEFILES)
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -685,25 +653,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -718,54 +682,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
+endif
+endif
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -837,48 +811,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -900,6 +866,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -912,13 +892,10 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 

+ 190 - 213
packages/ggi/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 17:28
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:54
 #
 
 defaultrule: all
@@ -118,8 +118,8 @@ endif
 
 # Targets
 
-UNITOBJECTS=gii ggi ggi2d
-EXEOBJECTS=ggi1
+UNITOBJECTS+=gii ggi ggi2d
+EXAMPLEOBJECTS+=ggi1
 
 # Clean
 
@@ -129,13 +129,18 @@ EXEOBJECTS=ggi1
 
 # Defaults
 
-DEFAULTUNITS=1
 
 # Directories
 
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -155,6 +160,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -164,43 +174,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -212,16 +187,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -231,15 +196,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
 endif
 
-# Where the .msg files will be stored
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
+endif
+
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -250,42 +228,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -301,11 +246,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
@@ -315,8 +255,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -413,16 +358,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -458,6 +393,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -599,25 +564,25 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+examples: fpc_examples
 
-showinstall: fpc_showinstall
+test: fpc_test
 
-install: fpc_install
+smart: fpc_smart
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
-sharedinstall: fpc_sharedinstall
+showinstall: fpc_showinstall
 
-libinstall: fpc_libinstall
+install: fpc_install
 
 zipinstall: fpc_zipinstall
 
@@ -625,41 +590,54 @@ zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Examples
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_examples fpc_test
 
-fpc_units: $(UNITPPUFILES)
+EXAMPLEFILES=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
+EXAMPLEOFILES=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+
+fpc_examples: all $(EXAMPLEFILES)
+
+fpc_test: examples
 
-fpc_exes: $(EXEFILES)
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -676,25 +654,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -709,54 +683,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
 endif
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
+endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -828,48 +812,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -891,6 +867,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -903,23 +893,10 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
-#####################################################################
-# Users rules
-#####################################################################
-
-
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 1 - 12
packages/ggi/Makefile.fpc

@@ -4,18 +4,7 @@
 
 [targets]
 units=gii ggi ggi2d
-programs=ggi1
+examples=ggi1
 
 [dirs]
 fpcdir=../..
-
-[defaults]
-defaultunits=1
-
-
-[rules]
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 190 - 210
packages/ibase/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 17:03
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:56
 #
 
 defaultrule: all
@@ -118,8 +118,8 @@ endif
 
 # Targets
 
-UNITOBJECTS=ibase
-EXEOBJECTS=testib
+UNITOBJECTS+=ibase
+EXAMPLEOBJECTS+=testib
 
 # Clean
 
@@ -129,13 +129,18 @@ EXEOBJECTS=testib
 
 # Defaults
 
-DEFAULTUNITS=1
 
 # Directories
 
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -155,6 +160,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -164,43 +174,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -212,16 +187,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -231,15 +196,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+endif
+
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
 endif
 
-# Where the .msg files will be stored
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -250,42 +228,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -301,11 +246,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
@@ -315,8 +255,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -413,16 +358,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -458,6 +393,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -599,25 +564,25 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+examples: fpc_examples
 
-showinstall: fpc_showinstall
+test: fpc_test
 
-install: fpc_install
+smart: fpc_smart
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
-sharedinstall: fpc_sharedinstall
+showinstall: fpc_showinstall
 
-libinstall: fpc_libinstall
+install: fpc_install
 
 zipinstall: fpc_zipinstall
 
@@ -625,41 +590,54 @@ zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Examples
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_examples fpc_test
 
-fpc_units: $(UNITPPUFILES)
+EXAMPLEFILES=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
+EXAMPLEOFILES=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+
+fpc_examples: all $(EXAMPLEFILES)
 
-fpc_exes: $(EXEFILES)
+fpc_test: examples
+
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -676,25 +654,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -709,54 +683,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
+endif
+endif
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -828,48 +812,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
+endif
+endif
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -891,6 +867,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -903,25 +893,15 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################
 # Users rules
 #####################################################################
 
-
-.PHONY: test examples
-
 testib$(EXEEXT): testib.pp ibase$(PPUEXT)
-
-test: fpc_exes
-
-examples: fpc_exes

+ 1 - 10
packages/ibase/Makefile.fpc

@@ -4,20 +4,11 @@
 
 [targets]
 units=ibase
-programs=testib
+examples=testib
 
 [dirs]
 fpcdir=../..
 
-[defaults]
-defaultunits=1
-
 
 [rules]
-.PHONY: test examples
-
 testib$(EXEEXT): testib.pp ibase$(PPUEXT)
-
-test: fpc_exes
-
-examples: fpc_exes

+ 190 - 210
packages/inet/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 17:10
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:56
 #
 
 defaultrule: all
@@ -118,8 +118,8 @@ endif
 
 # Targets
 
-UNITOBJECTS=inet
-EXEOBJECTS=testinet pfinger
+UNITOBJECTS+=inet
+EXAMPLEOBJECTS+=testinet pfinger
 
 # Clean
 
@@ -129,13 +129,18 @@ EXEOBJECTS=testinet pfinger
 
 # Defaults
 
-DEFAULTUNITS=1
 
 # Directories
 
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -155,6 +160,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -164,43 +174,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -212,16 +187,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -231,15 +196,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+endif
+
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
 endif
 
-# Where the .msg files will be stored
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -250,42 +228,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -301,11 +246,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
@@ -315,8 +255,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -413,16 +358,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -458,6 +393,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -599,25 +564,25 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+examples: fpc_examples
 
-showinstall: fpc_showinstall
+test: fpc_test
 
-install: fpc_install
+smart: fpc_smart
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
-sharedinstall: fpc_sharedinstall
+showinstall: fpc_showinstall
 
-libinstall: fpc_libinstall
+install: fpc_install
 
 zipinstall: fpc_zipinstall
 
@@ -625,41 +590,54 @@ zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Examples
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_examples fpc_test
 
-fpc_units: $(UNITPPUFILES)
+EXAMPLEFILES=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
+EXAMPLEOFILES=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+
+fpc_examples: all $(EXAMPLEFILES)
 
-fpc_exes: $(EXEFILES)
+fpc_test: examples
+
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -676,25 +654,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -709,54 +683,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
+endif
+endif
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -828,48 +812,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
+endif
+endif
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -891,6 +867,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -903,27 +893,17 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################
 # Users rules
 #####################################################################
 
-
-.PHONY: test examples
-
 testinet$(EXEEXT): testinet$(PASEXT) inet$(PPUEXT)
 
 pfinger$(EXEEXT): pfinger$(PASEXT) inet$(PPUEXT)
-
-test: fpc_exes
-
-examples: fpc_exes

+ 1 - 10
packages/inet/Makefile.fpc

@@ -4,22 +4,13 @@
 
 [targets]
 units=inet
-programs=testinet pfinger
+examples=testinet pfinger
 
 [dirs]
 fpcdir=../..
 
-[defaults]
-defaultunits=1
-
 
 [rules]
-.PHONY: test examples
-
 testinet$(EXEEXT): testinet$(PASEXT) inet$(PPUEXT)
 
 pfinger$(EXEEXT): pfinger$(PASEXT) inet$(PPUEXT)
-
-test: fpc_exes
-
-examples: fpc_exes

+ 190 - 210
packages/mysql/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 16:51
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:56
 #
 
 defaultrule: all
@@ -118,8 +118,8 @@ endif
 
 # Targets
 
-UNITOBJECTS=mysql_com mysql_version mysql
-EXEOBJECTS=testdb
+UNITOBJECTS+=mysql_com mysql_version mysql
+EXAMPLEOBJECTS+=testdb
 
 # Clean
 
@@ -129,13 +129,18 @@ EXEOBJECTS=testdb
 
 # Defaults
 
-DEFAULTUNITS=1
 
 # Directories
 
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -155,6 +160,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -164,43 +174,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -212,16 +187,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -231,15 +196,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+endif
+
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
 endif
 
-# Where the .msg files will be stored
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -250,42 +228,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -301,11 +246,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
@@ -315,8 +255,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -413,16 +358,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -458,6 +393,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -599,25 +564,25 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+examples: fpc_examples
 
-showinstall: fpc_showinstall
+test: fpc_test
 
-install: fpc_install
+smart: fpc_smart
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
-sharedinstall: fpc_sharedinstall
+showinstall: fpc_showinstall
 
-libinstall: fpc_libinstall
+install: fpc_install
 
 zipinstall: fpc_zipinstall
 
@@ -625,41 +590,54 @@ zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Examples
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_examples fpc_test
 
-fpc_units: $(UNITPPUFILES)
+EXAMPLEFILES=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
+EXAMPLEOFILES=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+
+fpc_examples: all $(EXAMPLEFILES)
 
-fpc_exes: $(EXEFILES)
+fpc_test: examples
+
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -676,25 +654,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -709,54 +683,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
+endif
+endif
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -828,48 +812,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
+endif
+endif
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -891,6 +867,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -903,27 +893,17 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################
 # Users rules
 #####################################################################
 
-
-.PHONY: test examples
-
 mysql$(PPUEXT): mysql$(PASEXT) mysql_com$(PPUEXT)
 
 testdb$(EXEEXT): testdb$(PASEXT) mysql$(PPUEXT)
-
-test: fpc_exes
-
-examples: fpc_exes

+ 1 - 10
packages/mysql/Makefile.fpc

@@ -4,22 +4,13 @@
 
 [targets]
 units=mysql_com mysql_version mysql
-programs=testdb
+examples=testdb
 
 [dirs]
 fpcdir=../..
 
-[defaults]
-defaultunits=1
-
 
 [rules]
-.PHONY: test examples
-
 mysql$(PPUEXT): mysql$(PASEXT) mysql_com$(PPUEXT)
 
 testdb$(EXEEXT): testdb$(PASEXT) mysql$(PPUEXT)
-
-test: fpc_exes
-
-examples: fpc_exes

+ 190 - 210
packages/ncurses/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 16:51
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:54
 #
 
 defaultrule: all
@@ -118,8 +118,8 @@ endif
 
 # Targets
 
-UNITOBJECTS=ncurses
-EXEOBJECTS=firework testn
+UNITOBJECTS+=ncurses
+EXAMPLEOBJECTS+=firework testn
 
 # Clean
 
@@ -129,13 +129,18 @@ EXEOBJECTS=firework testn
 
 # Defaults
 
-DEFAULTUNITS=1
 
 # Directories
 
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -155,6 +160,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -164,43 +174,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -212,16 +187,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -231,15 +196,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+endif
+
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
 endif
 
-# Where the .msg files will be stored
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -250,42 +228,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -301,11 +246,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
@@ -315,8 +255,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -413,16 +358,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -458,6 +393,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -599,25 +564,25 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+examples: fpc_examples
 
-showinstall: fpc_showinstall
+test: fpc_test
 
-install: fpc_install
+smart: fpc_smart
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
-sharedinstall: fpc_sharedinstall
+showinstall: fpc_showinstall
 
-libinstall: fpc_libinstall
+install: fpc_install
 
 zipinstall: fpc_zipinstall
 
@@ -625,41 +590,54 @@ zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Examples
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_examples fpc_test
 
-fpc_units: $(UNITPPUFILES)
+EXAMPLEFILES=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
+EXAMPLEOFILES=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+
+fpc_examples: all $(EXAMPLEFILES)
 
-fpc_exes: $(EXEFILES)
+fpc_test: examples
+
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -676,25 +654,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -709,54 +683,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
+endif
+endif
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -828,48 +812,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
+endif
+endif
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -891,6 +867,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -903,27 +893,17 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################
 # Users rules
 #####################################################################
 
-
-.PHONY: test examples
-
 testn$(EXEEXT): testn$(PASEXT) ncurses$(PPUEXT)
 
 firework$(EXEEXT): firework$(PASEXT) ncurses$(PPUEXT)
-
-test: fpc_exes
-
-examples: fpc_exes

+ 1 - 10
packages/ncurses/Makefile.fpc

@@ -4,22 +4,13 @@
 
 [targets]
 units=ncurses
-programs=firework testn
+examples=firework testn
 
 [dirs]
 fpcdir=../..
 
-[defaults]
-defaultunits=1
-
 
 [rules]
-.PHONY: test examples
-
 testn$(EXEEXT): testn$(PASEXT) ncurses$(PPUEXT)
 
 firework$(EXEEXT): firework$(PASEXT) ncurses$(PPUEXT)
-
-test: fpc_exes
-
-examples: fpc_exes

+ 122 - 126
packages/ncurses/firework.pp

@@ -1,14 +1,17 @@
-program firework;
+{
+  $Log$
+  Revision 1.2  1999-11-24 23:42:00  peter
+    * fpcmake updates
 
-uses ncurses,linux;
 
-procedure onsig(n : Longint);
-begin
-    curs_set(1);
-    endwin;
-    halt(1);
-end;
+  Example for ncurses
+}
+program firework;
+uses
+  ncurses,linux;
 
+CONST
+  my_bg : LONGINT = COLOR_BLACK;
 
 Procedure showit;
 begin
@@ -16,139 +19,132 @@ begin
   napms(120);
 end;
 
-Function get_colour(Var bold : chtype) : longint;
-
-Var 
-attr : 	longint;
 
+Function get_colour(Var bold : chtype) : longint;
+Var
+  attr : longint;
 begin
- attr := random(16) + 1;
- bold := A_NORMAL;
- if (attr > 8) then
-  begin
-  bold:= A_BOLD;
-  attr :=attr and 7;
-  end;
- get_colour:=attr;
+  attr:=random(16) + 1;
+  bold:=A_NORMAL;
+  if (attr > 8) then
+   begin
+     bold:=A_BOLD;
+     attr:=attr and 7;
+   end;
+  get_colour:=attr;
 end;
 
-CONST my_bg : LONGINT = COLOR_BLACK;
-
 
 Procedure explode(Row,Col : longint);
-
-var 
+var
   Bold : chtype;
-
 begin
-       ncurses.erase;
-       mvaddstr(row,col,'-');
-       showit;
-
-       init_pair(1,get_colour(bold),my_bg);
-       attrset(COLOR_PAIR(1) or bold);
-       mvaddstr(row-1,col-1,' - ');
-       mvaddstr(row,col-1,'-+-');
-       mvaddstr(row+1,col-1,' - ');
-       showit;
-
-       init_pair(1,get_colour(bold),my_bg);
-       attrset(COLOR_PAIR(1) or bold);
-       mvaddstr(row-2,col-2,' --- ');
-       mvaddstr(row-1,col-2,'-+++-');
-       mvaddstr(row,  col-2,'-+#+-');
-       mvaddstr(row+1,col-2,'-+++-');
-       mvaddstr(row+2,col-2,' --- ');
-       showit;
-
-       init_pair(1,get_colour(bold),my_bg);
-       attrset(COLOR_PAIR(1) or bold);
-       mvaddstr(row-2,col-2,' +++ ');
-       mvaddstr(row-1,col-2,'++#++');
-       mvaddstr(row,  col-2,'+# #+');
-       mvaddstr(row+1,col-2,'++#++');
-       mvaddstr(row+2,col-2,' +++ ');
-       showit;
-
-       init_pair(1,get_colour(bold),my_bg);
-       attrset(COLOR_PAIR(1) or bold);
-       mvaddstr(row-2,col-2,'  #  ');
-       mvaddstr(row-1,col-2,'## ##');
-       mvaddstr(row,  col-2,'#   #');
-       mvaddstr(row+1,col-2,'## ##');
-       mvaddstr(row+2,col-2,'  #  ');
-       showit;
-
-       init_pair(1,get_colour(bold),my_bg);
-       attrset(COLOR_PAIR(1) or bold);
-       mvaddstr(row-2,col-2,' # # ');
-       mvaddstr(row-1,col-2,'#   #');
-       mvaddstr(row,  col-2,'     ');
-       mvaddstr(row+1,col-2,'#   #');
-       mvaddstr(row+2,col-2,' # # ');
-       showit;
-end;
+  ncurses.erase;
+  mvaddstr(row,col,'-');
+  showit;
 
+  init_pair(1,get_colour(bold),my_bg);
+  attrset(COLOR_PAIR(1) or bold);
+  mvaddstr(row-1,col-1,' - ');
+  mvaddstr(row,col-1,'-+-');
+  mvaddstr(row+1,col-1,' - ');
+  showit;
 
+  init_pair(1,get_colour(bold),my_bg);
+  attrset(COLOR_PAIR(1) or bold);
+  mvaddstr(row-2,col-2,' --- ');
+  mvaddstr(row-1,col-2,'-+++-');
+  mvaddstr(row,  col-2,'-+#+-');
+  mvaddstr(row+1,col-2,'-+++-');
+  mvaddstr(row+2,col-2,' --- ');
+  showit;
 
+  init_pair(1,get_colour(bold),my_bg);
+  attrset(COLOR_PAIR(1) or bold);
+  mvaddstr(row-2,col-2,' +++ ');
+  mvaddstr(row-1,col-2,'++#++');
+  mvaddstr(row,  col-2,'+# #+');
+  mvaddstr(row+1,col-2,'++#++');
+  mvaddstr(row+2,col-2,' +++ ');
+  showit;
 
-Var
-     J : Longint;
-    startp,endp,row,diff,flag : longint;
-    direction : boolean;
-    seed : cardinal;
+  init_pair(1,get_colour(bold),my_bg);
+  attrset(COLOR_PAIR(1) or bold);
+  mvaddstr(row-2,col-2,'  #  ');
+  mvaddstr(row-1,col-2,'## ##');
+  mvaddstr(row,  col-2,'#   #');
+  mvaddstr(row+1,col-2,'## ##');
+  mvaddstr(row+2,col-2,'  #  ');
+  showit;
+
+  init_pair(1,get_colour(bold),my_bg);
+  attrset(COLOR_PAIR(1) or bold);
+  mvaddstr(row-2,col-2,' # # ');
+  mvaddstr(row-1,col-2,'#   #');
+  mvaddstr(row,  col-2,'     ');
+  mvaddstr(row+1,col-2,'#   #');
+  mvaddstr(row+2,col-2,' # # ');
+  showit;
+end;
 
+
+Var
+  startp,endp,row,diff,flag : longint;
+  direction : boolean;
 begin
-flag:=0;
-{
-for j:=SIGHUP to SIGTERM do 
-  if (signal(j,SIG_IGN)<>SIG_IGN) then
-    signal(j,@onsig);
-}
-initscr;
-if (has_colors<>0) then
-  start_color;
+  flag:=0;
+  initscr;
+  if (has_colors<>0) then
+   start_color;
   curs_set(0);
 
-randomize;
-cbreak;
-While true do
-  begin
-  repeat
-    startp := random (COLS -3);
-    endp := random (COLS - 3);
-    If startp < 2 then startp:=2;
-    If endp <2  then endp:=2;
-    direction := startp > endp ;
-    diff := abs(startp-endp);
-  until (diff>2) and (diff<(LINES-2));
-  attrset(A_NORMAL);
-  for row:=0 to diff do
-    begin;
-      If direction then 
-        mvaddstr(LINES - row,startp + row ,'/')
-      else 
-        mvaddstr(LINES - row,startp - row ,'\');
-      inc(flag);
-      if flag<>0 then 
+  randomize;
+  cbreak;
+  While true do
+   begin
+     repeat
+       startp:=random (COLS -3);
+       endp:=random (COLS - 3);
+       If startp < 2 then
+        startp:=2;
+       If endp <2  then
+        endp:=2;
+       direction:=startp > endp ;
+       diff:=abs(startp-endp);
+     until (diff>2) and (diff<(LINES-2));
+     attrset(A_NORMAL);
+     for row:=0 to diff do
+      begin;
+        If direction then
+         mvaddstr(LINES - row,startp + row ,'/')
+        else
+         mvaddstr(LINES - row,startp - row ,'\');
+        inc(flag);
+        if flag<>0 then
          begin
-         showit;
-         erase;
-         flag := 0;
+           showit;
+           erase;
+           flag:=0;
          end;
-    end;
-  inc(flag);
-  if (flag<>0) then 
-    begin
-    showit;
-    flag := 0;
-    end;
-  randomize;
-  If Direction then 
-    explode(LINES-row,startp+diff)
-  Else
-    explode(LINES-row,startp-diff);
-  erase;
-  showit;
-  end;
-end.
+      end;
+     inc(flag);
+     if (flag<>0) then
+      begin
+        showit;
+        flag:=0;
+      end;
+     randomize;
+     If Direction then
+      explode(LINES-row,startp+diff)
+     Else
+      explode(LINES-row,startp-diff);
+     erase;
+     showit;
+   end;
+end.
+{
+  $Log$
+  Revision 1.2  1999-11-24 23:42:00  peter
+    * fpcmake updates
+
+}

+ 17 - 5
packages/ncurses/ncurses.pp

@@ -1,9 +1,10 @@
-unit ncurses;
-
-{   Unit to access the ncurses library
+{
+    $Id$
     Copyright (c) 1998 by Michael Van Canneyt
     member of the Free Pascal development team
 
+    Unit to access the ncurses library
+
     See the file COPYING.FPC included in this distribution,
     for details about the copyright.
 
@@ -12,15 +13,20 @@ unit ncurses;
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
  **********************************************************************}
+
 {
-  Many thanks to Ken Wright for his patches !!
+  Many thanks to Ken Wright for his patches !
 }
+
+unit ncurses;
+
   interface
 
-{$packrecords 4}
 {$linklib ncurses}
 {$linklib c}
 
+{$packrecords C}
+
    { Manually Added types }
    Type
 
@@ -1729,3 +1735,9 @@ const External_library='';
       ACS_STERLING:=acs_map['}'];
     end;
 end.
+{
+  $Log$
+  Revision 1.3  1999-11-24 23:42:00  peter
+    * fpcmake updates
+
+}

+ 32 - 21
packages/ncurses/testn.pp

@@ -1,27 +1,38 @@
+{
+  $Id$
+
+  Simple ncurses test
+}
 program testn;
+uses
+  ncurses;
 
-uses ncurses;
 var
-
-win : pWINDOW;
+  win : pWINDOW;
 begin
-if initscr=Nil then halt(1);
-start_color;
-win:= newwin (10,60,10,10);
-if win=nil then
-  begin
+  if initscr=Nil then halt(1);
+  start_color;
+  win:= newwin (10,60,10,10);
+  if win=nil then
+   begin
+     endwin;
+     halt(1);
+   end;
+  init_pair(1,COLOR_WHITE,COLOR_BLUE);
+  wbkgd(win, COLOR_PAIR(1));
+  erase;
+  refresh;
+  box(win, ACS_VLINE, ACS_HLINE);
+  wrefresh(win);
+  mvwaddstr(win,1,1,'Press any key to continue !');
+  wrefresh(win);
+  raw;
+  wgetch(win);
   endwin;
-  halt(1);
-  end;
-init_pair(1,COLOR_WHITE,COLOR_BLUE);
-wbkgd(win, COLOR_PAIR(1));
-erase;
-refresh;
-box(win, ACS_VLINE, ACS_HLINE);
-wrefresh(win);
-mvwaddstr(win,1,1,'Press any key to continue !');
-wrefresh(win);
-raw;
-wgetch(win);
-endwin;
 end.
+{
+  $Log$
+  Revision 1.2  1999-11-24 23:42:00  peter
+    * fpcmake updates
+
+}

+ 190 - 209
packages/opengl/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 17:28
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:54
 #
 
 defaultrule: all
@@ -118,8 +118,8 @@ endif
 
 # Targets
 
-UNITOBJECTS=xlib gl glut
-EXEOBJECTS=glutdemo
+UNITOBJECTS+=xlib gl glut
+EXAMPLEOBJECTS+=glutdemo
 
 # Clean
 
@@ -129,7 +129,6 @@ EXEOBJECTS=glutdemo
 
 # Defaults
 
-DEFAULTUNITS=1
 override NEEDOPT=-Sm
 
 # Directories
@@ -137,6 +136,12 @@ override NEEDOPT=-Sm
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -156,6 +161,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -165,43 +175,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -213,16 +188,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -232,15 +197,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+endif
+
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
 endif
 
-# Where the .msg files will be stored
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -251,42 +229,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -302,7 +247,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
 ifdef NEEDOPT
 override FPCOPT+=$(NEEDOPT)
 endif
@@ -316,8 +260,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -414,16 +363,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -459,6 +398,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -600,25 +569,25 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+examples: fpc_examples
 
-showinstall: fpc_showinstall
+test: fpc_test
 
-install: fpc_install
+smart: fpc_smart
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
-sharedinstall: fpc_sharedinstall
+showinstall: fpc_showinstall
 
-libinstall: fpc_libinstall
+install: fpc_install
 
 zipinstall: fpc_zipinstall
 
@@ -626,41 +595,54 @@ zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Examples
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_examples fpc_test
 
-fpc_units: $(UNITPPUFILES)
+EXAMPLEFILES=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
+EXAMPLEOFILES=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+
+fpc_examples: all $(EXAMPLEFILES)
 
-fpc_exes: $(EXEFILES)
+fpc_test: examples
+
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -677,25 +659,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -710,54 +688,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
 endif
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
+endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -829,48 +817,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -892,6 +872,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -904,23 +898,10 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
-#####################################################################
-# Users rules
-#####################################################################
-
-
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 1 - 10
packages/opengl/Makefile.fpc

@@ -4,19 +4,10 @@
 
 [targets]
 units=xlib gl glut
-programs=glutdemo
+examples=glutdemo
 
 [dirs]
 fpcdir=../..
 
 [defaults]
-defaultunits=1
 defaultoptions=-Sm
-
-
-[rules]
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 189 - 209
packages/paszlib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-16 22:43
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:54
 #
 
 defaultrule: all
@@ -118,8 +118,8 @@ endif
 
 # Targets
 
-UNITOBJECTS=adler crc crcasm gzio infblock infcodes inffast inftrees infutil strutils trees zcompres zdeflate zinflate zlib zuncompr zutil
-EXEOBJECTS=example minigzip
+UNITOBJECTS+=adler crc crcasm gzio infblock infcodes inffast inftrees infutil strutils trees zcompres zdeflate zinflate zlib zuncompr zutil
+EXAMPLEOBJECTS+=example minigzip
 
 # Clean
 
@@ -129,7 +129,6 @@ EXEOBJECTS=example minigzip
 
 # Defaults
 
-DEFAULTUNITS=1
 override NEEDOPT=-Sm
 
 # Directories
@@ -137,6 +136,12 @@ override NEEDOPT=-Sm
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -156,6 +161,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -165,43 +175,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -213,16 +188,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -232,15 +197,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+endif
+
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
 endif
 
-# Where the .msg files will be stored
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -251,42 +229,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -302,7 +247,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
 ifdef NEEDOPT
 override FPCOPT+=$(NEEDOPT)
 endif
@@ -316,8 +260,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -414,16 +363,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -459,6 +398,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -600,25 +569,25 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+examples: fpc_examples
 
-showinstall: fpc_showinstall
+test: fpc_test
 
-install: fpc_install
+smart: fpc_smart
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
-sharedinstall: fpc_sharedinstall
+showinstall: fpc_showinstall
 
-libinstall: fpc_libinstall
+install: fpc_install
 
 zipinstall: fpc_zipinstall
 
@@ -626,41 +595,54 @@ zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Examples
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_examples fpc_test
 
-fpc_units: $(UNITPPUFILES)
+EXAMPLEFILES=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
+EXAMPLEOFILES=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+
+fpc_examples: all $(EXAMPLEFILES)
 
-fpc_exes: $(EXEFILES)
+fpc_test: examples
+
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -677,25 +659,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -710,54 +688,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
 endif
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
+endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -829,50 +817,41 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
 	-$(DEL) $(PPAS) link.res log
 
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
-
 #####################################################################
 # Info rules
 #####################################################################
@@ -893,6 +872,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -905,23 +898,10 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
-#####################################################################
-# Users rules
-#####################################################################
-
-
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 3 - 13
packages/paszlib/Makefile.fpc

@@ -1,23 +1,13 @@
 #
-#   Makefile.fpc for GL Units
+#   Makefile.fpc for PasZLib
 #
 
 [targets]
-units= adler crc crcasm gzio infblock infcodes inffast inftrees infutil strutils trees zcompres zdeflate zinflate zlib zuncompr zutil
-
-programs=example minigzip
+units=adler crc crcasm gzio infblock infcodes inffast inftrees infutil strutils trees zcompres zdeflate zinflate zlib zuncompr zutil
+examples=example minigzip
 
 [dirs]
 fpcdir=../..
 
 [defaults]
-defaultunits=1
 defaultoptions=-Sm
-
-
-[rules]
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 3 - 3
packages/paszlib/inftrees.pas

@@ -56,8 +56,8 @@ var z : z_stream                  { for messages }
      ) : int;
 
 function inflate_trees_fixed (
-    var bl : uInt;                { literal desired/actual bit depth }
-    var bd : uInt;                { distance desired/actual bit depth }
+    var bl : uIntf;               { literal desired/actual bit depth }
+    var bd : uIntf;               { distance desired/actual bit depth }
     var tl : pInflate_huft;       { literal/length tree result }
     var td : pInflate_huft;       { distance tree result }
     var z : z_stream              { for memory allocation }
@@ -165,7 +165,7 @@ Var
   i : uInt;  {register}         { counter, current code }
   j : uInt;  {register}         { counter }
   k : Int;   {register}         { number of bits in current code }
-  l : int;			{ bits per table (returned in m) }
+  l : int;                      { bits per table (returned in m) }
   mask : uInt;                  { (1 shl w) - 1, to avoid cc -O bug on HP }
   p : ^uIntf; {register}        { pointer into c[], b[], or v[] }
   q : pInflate_huft;            { points to current table }

+ 19 - 19
packages/paszlib/zdeflate.pas

@@ -243,7 +243,7 @@ function deflateInit2 (var strm : z_stream;
 {EXPORT}
 function deflateSetDictionary (var strm : z_stream;
                                dictionary : pBytef; {const bytes}
-			       dictLength : uint) : int;
+                               dictLength : uint) : int;
 
 {    Initializes the compression dictionary (history buffer) from the given
    byte sequence without producing any compressed output. This function must
@@ -353,11 +353,11 @@ type
 {local}
 procedure fill_window(var s : deflate_state); forward;
 {local}
-function deflate_stored(var s : deflate_state; flush : int) : block_state; far; forward;
+function deflate_stored(var s : deflate_state; flush : int) : block_state;{$ifndef fpc}far;{$endif} forward;
 {local}
-function deflate_fast(var s : deflate_state; flush : int) : block_state; far; forward;
+function deflate_fast(var s : deflate_state; flush : int) : block_state;{$ifndef fpc}far;{$endif} forward;
 {local}
-function deflate_slow(var s : deflate_state; flush : int) : block_state; far; forward;
+function deflate_slow(var s : deflate_state; flush : int) : block_state;{$ifndef fpc}far;{$endif} forward;
 {local}
 procedure lm_init(var s : deflate_state); forward;
 
@@ -533,15 +533,15 @@ begin
   strm.msg := '';
   if not Assigned(strm.zalloc) then
   begin
-{$ifdef fpc}  
+{$ifdef fpc}
     strm.zalloc := @zcalloc;
-{$else}    
+{$else}
     strm.zalloc := zcalloc;
-{$endif}    
+{$endif}
     strm.opaque := voidpf(0);
   end;
   if not Assigned(strm.zfree) then
-{$ifdef fpc}  
+{$ifdef fpc}
     strm.zfree := @zcfree;
 {$else}
     strm.zfree := zcfree;
@@ -920,10 +920,10 @@ begin
     if (strm.avail_out = 0) then
     begin
       { Since avail_out is 0, deflate will be called again with
-	more output space, but possibly with both pending and
-	avail_in equal to zero. There won't be anything to do,
-	but this is not an error situation so make sure we
-	return OK instead of BUF_ERROR at next call of deflate: }
+        more output space, but possibly with both pending and
+        avail_in equal to zero. There won't be anything to do,
+        but this is not an error situation so make sure we
+        return OK instead of BUF_ERROR at next call of deflate: }
 
       s^.last_flush := -1;
       deflate := Z_OK;
@@ -971,11 +971,11 @@ begin
       deflate := Z_OK;
       exit;
       { If flush != Z_NO_FLUSH && avail_out == 0, the next call
-	of deflate should use the same flush parameter to make sure
-	that the flush is complete. So we don't have to output an
-	empty block here, this will be done at next call. This also
-	ensures that for a very small output buffer, we emit at most
-	 one empty block. }
+        of deflate should use the same flush parameter to make sure
+        that the flush is complete. So we don't have to output an
+        empty block here, this will be done at next call. This also
+        ensures that for a very small output buffer, we emit at most
+         one empty block. }
     end;
     if (bstate = block_done) then
     begin
@@ -999,7 +999,7 @@ begin
       if (strm.avail_out = 0) then
       begin
         s^.last_flush := -1; { avoid BUF_ERROR at next call, see above }
-	deflate := Z_OK;
+        deflate := Z_OK;
         exit;
       end;
 
@@ -2038,7 +2038,7 @@ begin
       {$endif}
 
       {_tr_tally_dist(s, s->strstart -1 - s->prev_match,
-	                s->prev_length - MIN_MATCH, bflush);}
+                        s->prev_length - MIN_MATCH, bflush);}
       bflush := _tr_tally(s, s.strstart -1 - s.prev_match,
                            s.prev_length - MIN_MATCH);
 

+ 190 - 213
packages/postgres/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 16:55
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:56
 #
 
 defaultrule: all
@@ -118,8 +118,8 @@ endif
 
 # Targets
 
-UNITOBJECTS=dllist postgres
-EXEOBJECTS=testpg testemail
+UNITOBJECTS+=dllist postgres
+EXAMPLEOBJECTS+=testpg testemail
 
 # Clean
 
@@ -129,13 +129,18 @@ EXEOBJECTS=testpg testemail
 
 # Defaults
 
-DEFAULTUNITS=1
 
 # Directories
 
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -155,6 +160,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -164,43 +174,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -212,16 +187,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -231,15 +196,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
 endif
 
-# Where the .msg files will be stored
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
+endif
+
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -250,42 +228,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -301,11 +246,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
@@ -315,8 +255,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -413,16 +358,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -458,6 +393,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -599,25 +564,25 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+examples: fpc_examples
 
-showinstall: fpc_showinstall
+test: fpc_test
 
-install: fpc_install
+smart: fpc_smart
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
-sharedinstall: fpc_sharedinstall
+showinstall: fpc_showinstall
 
-libinstall: fpc_libinstall
+install: fpc_install
 
 zipinstall: fpc_zipinstall
 
@@ -625,41 +590,54 @@ zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Examples
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_examples fpc_test
 
-fpc_units: $(UNITPPUFILES)
+EXAMPLEFILES=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
+EXAMPLEOFILES=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+
+fpc_examples: all $(EXAMPLEFILES)
+
+fpc_test: examples
 
-fpc_exes: $(EXEFILES)
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -676,25 +654,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -709,54 +683,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
 endif
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
+endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -828,48 +812,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -891,6 +867,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -903,23 +893,10 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
-#####################################################################
-# Users rules
-#####################################################################
-
-
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 1 - 12
packages/postgres/Makefile.fpc

@@ -4,18 +4,7 @@
 
 [targets]
 units=dllist postgres
-programs=testpg testemail
+examples=testpg testemail
 
 [dirs]
 fpcdir=../..
-
-[defaults]
-defaultunits=1
-
-
-[rules]
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 190 - 213
packages/svgalib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 17:25
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:55
 #
 
 defaultrule: all
@@ -118,8 +118,8 @@ endif
 
 # Targets
 
-UNITOBJECTS=svgalib vgamouse
-EXEOBJECTS=testvga vgatest
+UNITOBJECTS+=svgalib vgamouse
+EXAMPLEOBJECTS+=testvga vgatest
 
 # Clean
 
@@ -129,13 +129,18 @@ EXEOBJECTS=testvga vgatest
 
 # Defaults
 
-DEFAULTUNITS=1
 
 # Directories
 
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -155,6 +160,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -164,43 +174,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -212,16 +187,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -231,15 +196,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
 endif
 
-# Where the .msg files will be stored
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
+endif
+
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -250,42 +228,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -301,11 +246,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
@@ -315,8 +255,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -413,16 +358,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -458,6 +393,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -599,25 +564,25 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+examples: fpc_examples
 
-showinstall: fpc_showinstall
+test: fpc_test
 
-install: fpc_install
+smart: fpc_smart
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
-sharedinstall: fpc_sharedinstall
+showinstall: fpc_showinstall
 
-libinstall: fpc_libinstall
+install: fpc_install
 
 zipinstall: fpc_zipinstall
 
@@ -625,41 +590,54 @@ zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Examples
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_examples fpc_test
 
-fpc_units: $(UNITPPUFILES)
+EXAMPLEFILES=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
+EXAMPLEOFILES=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+
+fpc_examples: all $(EXAMPLEFILES)
+
+fpc_test: examples
 
-fpc_exes: $(EXEFILES)
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -676,25 +654,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -709,54 +683,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
 endif
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
+endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -828,48 +812,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -891,6 +867,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -903,23 +893,10 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
-#####################################################################
-# Users rules
-#####################################################################
-
-
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 1 - 12
packages/svgalib/Makefile.fpc

@@ -4,18 +4,7 @@
 
 [targets]
 units=svgalib vgamouse
-programs=testvga vgatest
+examples=testvga vgatest
 
 [dirs]
 fpcdir=../..
-
-[defaults]
-defaultunits=1
-
-
-[rules]
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 190 - 213
packages/uncgi/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 17:30
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:54
 #
 
 defaultrule: all
@@ -118,8 +118,8 @@ endif
 
 # Targets
 
-UNITOBJECTS=uncgi
-EXEOBJECTS=testcgi
+UNITOBJECTS+=uncgi
+EXAMPLEOBJECTS+=testcgi
 
 # Clean
 
@@ -129,13 +129,18 @@ EXEOBJECTS=testcgi
 
 # Defaults
 
-DEFAULTUNITS=1
 
 # Directories
 
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -155,6 +160,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -164,43 +174,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -212,16 +187,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -231,15 +196,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
 endif
 
-# Where the .msg files will be stored
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
+endif
+
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -250,42 +228,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -301,11 +246,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
@@ -315,8 +255,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -413,16 +358,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -458,6 +393,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -599,25 +564,25 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+examples: fpc_examples
 
-showinstall: fpc_showinstall
+test: fpc_test
 
-install: fpc_install
+smart: fpc_smart
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
-sharedinstall: fpc_sharedinstall
+showinstall: fpc_showinstall
 
-libinstall: fpc_libinstall
+install: fpc_install
 
 zipinstall: fpc_zipinstall
 
@@ -625,41 +590,54 @@ zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Examples
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_examples fpc_test
 
-fpc_units: $(UNITPPUFILES)
+EXAMPLEFILES=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
+EXAMPLEOFILES=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+
+fpc_examples: all $(EXAMPLEFILES)
+
+fpc_test: examples
 
-fpc_exes: $(EXEFILES)
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -676,25 +654,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -709,54 +683,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
 endif
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
+endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -828,48 +812,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -891,6 +867,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -903,23 +893,10 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
-#####################################################################
-# Users rules
-#####################################################################
-
-
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 1 - 12
packages/uncgi/Makefile.fpc

@@ -4,18 +4,7 @@
 
 [targets]
 units=uncgi
-programs=testcgi
+examples=testcgi
 
 [dirs]
 fpcdir=../..
-
-[defaults]
-defaultunits=1
-
-
-[rules]
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 190 - 210
packages/utmp/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-14 17:11
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 22:55
 #
 
 defaultrule: all
@@ -118,8 +118,8 @@ endif
 
 # Targets
 
-UNITOBJECTS=utmp
-EXEOBJECTS=testu
+UNITOBJECTS+=utmp
+EXAMPLEOBJECTS+=testu
 
 # Clean
 
@@ -129,13 +129,18 @@ EXEOBJECTS=testu
 
 # Defaults
 
-DEFAULTUNITS=1
 
 # Directories
 
 ifndef FPCDIR
 FPCDIR=../..
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 # Libraries
 
@@ -155,6 +160,11 @@ else
 BASEDIR=.
 endif
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -164,43 +174,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 
 # set the base directory where to install everything
@@ -212,16 +187,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 endif
 
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifdef inlinux
@@ -231,15 +196,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+endif
+
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
 endif
 
-# Where the .msg files will be stored
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
+endif
 
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
@@ -250,42 +228,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
@@ -301,11 +246,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
@@ -315,8 +255,13 @@ endif
 endif
 
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 
 # Add commandline options
@@ -413,16 +358,6 @@ ifndef LD
 LD=ld
 endif
 
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
 # ppas.bat / ppas.sh
 ifdef inlinux
 PPAS=ppas.sh
@@ -458,6 +393,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 ifndef UPXPROG
@@ -599,25 +564,25 @@ endif
 # Default rules
 #####################################################################
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+examples: fpc_examples
 
-showinstall: fpc_showinstall
+test: fpc_test
 
-install: fpc_install
+smart: fpc_smart
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
-sharedinstall: fpc_sharedinstall
+showinstall: fpc_showinstall
 
-libinstall: fpc_libinstall
+install: fpc_install
 
 zipinstall: fpc_zipinstall
 
@@ -625,41 +590,54 @@ zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# Examples
+#####################################################################
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_examples fpc_test
 
-fpc_units: $(UNITPPUFILES)
+EXAMPLEFILES=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
+EXAMPLEOFILES=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+
+fpc_examples: all $(EXAMPLEFILES)
 
-fpc_exes: $(EXEFILES)
+fpc_test: examples
+
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
@@ -676,25 +654,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 # Library
 #####################################################################
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
@@ -709,54 +683,64 @@ endif
 # Install rules
 #####################################################################
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
+endif
+endif
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
 #####################################################################
@@ -828,48 +812,40 @@ endif
 # Clean rules
 #####################################################################
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
+endif
+endif
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 	-$(DEL) $(PPAS) link.res log
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 #####################################################################
 # Info rules
@@ -891,6 +867,20 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 fpc_infoinstall:
 	@$(ECHO)
@@ -903,25 +893,15 @@ endif
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
 #####################################################################
 # Users rules
 #####################################################################
 
-
-.PHONY: test examples
-
 testu$(EXEEXT): testu$(PASEXT) utmp$(PPUEXT)
-
-test: fpc_exes
-
-examples: fpc_exes

+ 1 - 10
packages/utmp/Makefile.fpc

@@ -4,20 +4,11 @@
 
 [targets]
 units=utmp
-programs=testu
+examples=testu
 
 [dirs]
 fpcdir=../..
 
-[defaults]
-defaultunits=1
-
 
 [rules]
-.PHONY: test examples
-
 testu$(EXEEXT): testu$(PASEXT) utmp$(PPUEXT)
-
-test: fpc_exes
-
-examples: fpc_exes