Browse Source

* moved into examples dir

peter 25 years ago
parent
commit
35accbecb4

+ 92 - 45
packages/gtk/tutorial/Makefile → packages/gtk/examples/tutorial/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Makefile generated by fpcmake v0.99.15 [2000/05/26]
+# Makefile generated by fpcmake v0.99.15 [2000/07/02]
 #
 #
 
 
 defaultrule: all
 defaultrule: all
@@ -131,7 +131,7 @@ endif
 
 
 # Default FPCDIR
 # Default FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-override FPCDIR=../../..
+override FPCDIR=../../../..
 ifeq ($(wildcard $(FPCDIR)/rtl),)
 ifeq ($(wildcard $(FPCDIR)/rtl),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 ifeq ($(wildcard $(FPCDIR)/units),)
 override FPCDIR=wrong
 override FPCDIR=wrong
@@ -659,6 +659,19 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 endif
 endif
 
 
+# Where to install the examples, under linux we use the doc dir
+# because the copytree command will create a subdir itself
+ifndef EXAMPLEINSTALLDIR
+ifdef inlinux
+EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
+else
+EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
+endif
+ifdef EXAMPLESUBDIR
+EXAMPLEINSTALLDIR:=$(EXAMPLEINSTALLDIR)/$(EXAMPLESUBDIR)
+endif
+endif
+
 # Where the some extra (data)files will be stored
 # Where the some extra (data)files will be stored
 ifndef DATAINSTALLDIR
 ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 DATAINSTALLDIR=$(BASEINSTALLDIR)
@@ -694,27 +707,18 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 override FPCOPT+=-T$(OS_TARGET)
 endif
 endif
 
 
-ifdef NEEDUNITDIR
-override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
-endif
-
-ifdef UNITSDIR
-override FPCOPT+=-Fu$(UNITSDIR)
+# User dirs should be first, so they are looked at first
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
 endif
 endif
-
-# Add GCC lib path if asked
-ifdef GCCLIBDIR
-override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
 endif
 endif
-
-# Add Other dirs path if asked
-ifdef OTHERLIBDIR
-override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
 endif
 endif
-
-# Target dirs
-ifdef TARGETDIR
-override FPCOPT+=-FE$(TARGETDIR)
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
 endif
 endif
 
 
 # Smartlinking
 # Smartlinking
@@ -757,21 +761,32 @@ ifdef VERBOSE
 override FPCOPT+=-vwni
 override FPCOPT+=-vwni
 endif
 endif
 
 
-# Add commandline options
-ifdef OPT
-override FPCOPT+=$(OPT)
+ifdef NEEDUNITDIR
+override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
 endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+
+ifdef UNITSDIR
+override FPCOPT+=-Fu$(UNITSDIR)
 endif
 endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+
+# Add GCC lib path if asked
+ifdef GCCLIBDIR
+override FPCOPT+=-Fl$(GCCLIBDIR)
 endif
 endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+
+# Add Other dirs path if asked
+ifdef OTHERLIBDIR
+override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
 endif
 endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+
+# Target dirs
+ifdef TARGETDIR
+override FPCOPT+=-FE$(TARGETDIR)
+endif
+
+# Add commandline options last so they can override
+ifdef OPT
+override FPCOPT+=$(OPT)
 endif
 endif
 
 
 # Add defines from FPCOPTDEF to FPCOPT
 # Add defines from FPCOPTDEF to FPCOPT
@@ -824,10 +839,14 @@ install: fpc_install
 
 
 sourceinstall: fpc_sourceinstall
 sourceinstall: fpc_sourceinstall
 
 
+exampleinstall: fpc_exampleinstall
+
 zipinstall: fpc_zipinstall
 zipinstall: fpc_zipinstall
 
 
 zipsourceinstall: fpc_zipsourceinstall
 zipsourceinstall: fpc_zipsourceinstall
 
 
+zipexampleinstall: fpc_zipexampleinstall
+
 clean: fpc_clean
 clean: fpc_clean
 
 
 distclean: fpc_distclean
 distclean: fpc_distclean
@@ -836,7 +855,7 @@ cleanall: fpc_cleanall
 
 
 info: fpc_info
 info: fpc_info
 
 
-.PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipsourceinstall clean distclean cleanall info
+.PHONY:  all debug smart shared showinstall install sourceinstall exampleinstall zipinstall zipsourceinstall zipexampleinstall clean distclean cleanall info
 
 
 #####################################################################
 #####################################################################
 # Exes
 # Exes
@@ -897,6 +916,12 @@ fpc_debug:
 
 
 .PHONY: fpc_smart fpc_shared
 .PHONY: fpc_smart fpc_shared
 
 
+ifdef LIBVERSION
+LIBFULLNAME=$(LIBNAME).$(LIBVERSION)
+else
+LIBFULLNAME=$(LIBNAME)
+endif
+
 # Default sharedlib units are all unit objects
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS:=$(UNITOBJECTS)
 SHAREDLIBUNITOBJECTS:=$(UNITOBJECTS)
@@ -910,7 +935,7 @@ ifdef inlinux
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) "LIBNAME not set"
 	@$(ECHO) "LIBNAME not set"
 else
 else
-	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
+	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBFULLNAME)
 endif
 endif
 else
 else
 	@$(ECHO) "Shared Libraries not supported"
 	@$(ECHO) "Shared Libraries not supported"
@@ -928,14 +953,7 @@ endif
 
 
 ifdef INSTALLPPUFILES
 ifdef INSTALLPPUFILES
 ifdef PPUFILES
 ifdef PPUFILES
-ifdef inlinux
 INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
 INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
-ifdef LIBNAME
-INSTALLPPULIBFILES=$(LIBNAME)
-endif
-else
-INSTALLPPULINKFILES:=$(shell $(PPUFILES) $(INSTALLPPUFILES))
-endif
 else
 else
 INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
 INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
 endif
 endif
@@ -950,8 +968,11 @@ ifdef INSTALLPPUFILES
 ifneq ($(INSTALLPPULINKFILES),)
 ifneq ($(INSTALLPPULINKFILES),)
 	@$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 	@$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
 endif
-ifneq ($(INSTALLPPULIBFILES),)
-	@$(ECHO) -e $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
+ifneq ($(wildcard $(LIBFULLNAME)),)
+	@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
+ifdef inlinux
+	@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
+endif
 endif
 endif
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
@@ -974,9 +995,12 @@ ifdef INSTALLPPUFILES
 ifneq ($(INSTALLPPULINKFILES),)
 ifneq ($(INSTALLPPULINKFILES),)
 	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
 	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
 endif
 endif
-ifneq ($(INSTALLPPULIBFILES),)
+ifneq ($(wildcard $(LIBFULLNAME)),)
 	$(MKDIR) $(LIBINSTALLDIR)
 	$(MKDIR) $(LIBINSTALLDIR)
-	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
+	$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
+ifdef inlinux
+	ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
+endif
 endif
 endif
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
@@ -998,6 +1022,24 @@ fpc_sourceinstall: clean
 	$(MKDIR) $(SOURCEINSTALLDIR)
 	$(MKDIR) $(SOURCEINSTALLDIR)
 	$(COPYTREE) $(SOURCETOPDIR) $(SOURCEINSTALLDIR)
 	$(COPYTREE) $(SOURCETOPDIR) $(SOURCEINSTALLDIR)
 
 
+#####################################################################
+# exampleinstall rules
+#####################################################################
+
+.PHONY: fpc_exampleinstall
+
+fpc_exampleinstall: $(addsuffix _clean,$(EXAMPLEDIROBJECTS))
+ifdef EXAMPLESOURCEFILES
+	$(MKDIR) $(EXAMPLEINSTALLDIR)
+	$(COPY) $(EXAMPLESOURCEFILES) $(EXAMPLEINSTALLDIR)
+endif
+ifdef EXAMPLEDIROBJECTS
+ifndef EXAMPLESOURCEFILES
+	$(MKDIR) $(EXAMPLEINSTALLDIR)
+endif
+	$(COPYTREE) $(addsuffix /*,$(EXAMPLEDIROBJECTS)) $(EXAMPLEINSTALLDIR)
+endif
+
 #####################################################################
 #####################################################################
 # Zip
 # Zip
 #####################################################################
 #####################################################################
@@ -1059,6 +1101,11 @@ endif
 fpc_zipsourceinstall:
 fpc_zipsourceinstall:
 	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall PACKAGESUFFIX=src
 	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall PACKAGESUFFIX=src
 
 
+.PHONY:  fpc_zipexampleinstall
+
+fpc_zipexampleinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall PACKAGESUFFIX=exm
+
 #####################################################################
 #####################################################################
 # Clean rules
 # Clean rules
 #####################################################################
 #####################################################################
@@ -1094,7 +1141,7 @@ ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 endif
 ifdef LIBNAME
 ifdef LIBNAME
-	-$(DEL) $(LIBNAME)
+	-$(DEL) $(LIBNAME) $(LIBFULLNAME)
 endif
 endif
 	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
 	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
 
 

+ 1 - 1
packages/gtk/tutorial/Makefile.fpc → packages/gtk/examples/tutorial/Makefile.fpc

@@ -9,7 +9,7 @@ programs=$(subst $(PASEXT),,$(wildcard tut*$(PASEXT)))
 packages=gtk
 packages=gtk
 
 
 [dirs]
 [dirs]
-fpcdir=../../..
+fpcdir=../../../..
 targetdir=.
 targetdir=.
 
 
 [libs]
 [libs]

+ 0 - 0
packages/gtk/tutorial/info.xpm → packages/gtk/examples/tutorial/info.xpm


+ 0 - 0
packages/gtk/tutorial/tut2_1.pp → packages/gtk/examples/tutorial/tut2_1.pp


+ 0 - 0
packages/gtk/tutorial/tut3_3.pp → packages/gtk/examples/tutorial/tut3_3.pp


+ 0 - 0
packages/gtk/tutorial/tut4_3.pp → packages/gtk/examples/tutorial/tut4_3.pp


+ 0 - 0
packages/gtk/tutorial/tut4_5.pp → packages/gtk/examples/tutorial/tut4_5.pp


+ 0 - 0
packages/gtk/tutorial/tut6_1.pp → packages/gtk/examples/tutorial/tut6_1.pp


+ 0 - 0
packages/gtk/tutorial/tut6_2.pp → packages/gtk/examples/tutorial/tut6_2.pp


+ 0 - 0
packages/gtk/tutorial/tut6_3.pp → packages/gtk/examples/tutorial/tut6_3.pp


+ 0 - 0
packages/gtk/tutorial/tut6_4.pp → packages/gtk/examples/tutorial/tut6_4.pp


+ 0 - 0
packages/gtk/tutorial/tut8_5.pp → packages/gtk/examples/tutorial/tut8_5.pp