summaryrefslogtreecommitdiff
path: root/packages/fpgtk/Makefile.fpc
diff options
context:
space:
mode:
authorjoost <joost@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-01-15 18:26:19 +0000
committerjoost <joost@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-01-15 18:26:19 +0000
commit4c508d2c9a2f9b6bc8ad33a5a221f3a66b588476 (patch)
tree6a5815968ec9eca6b127f199d53dae11f975c52c /packages/fpgtk/Makefile.fpc
parenta6bf7f4bb87d7f26750a81e406f0ba834c445f4d (diff)
downloadfpc-4c508d2c9a2f9b6bc8ad33a5a221f3a66b588476.tar.gz
* Changed more packages to fpmake building
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@20089 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fpgtk/Makefile.fpc')
-rw-r--r--packages/fpgtk/Makefile.fpc68
1 files changed, 59 insertions, 9 deletions
diff --git a/packages/fpgtk/Makefile.fpc b/packages/fpgtk/Makefile.fpc
index 3225480fe0..e63bf59141 100644
--- a/packages/fpgtk/Makefile.fpc
+++ b/packages/fpgtk/Makefile.fpc
@@ -1,16 +1,13 @@
#
-# Makefile.fpc for fpgtk
+# Makefile.fpc for running fpmake
#
-[require]
-packages=fcl-base gtk1
[package]
name=fpgtk
version=2.7.1
-[target]
-units=fpglib fpgtk fpgtkext
-rsts=fpgtk fpgtkext
+[require]
+packages=rtl fpmkunit
[install]
fpcpackage=y
@@ -18,9 +15,62 @@ fpcpackage=y
[default]
fpcdir=../..
-[compiler]
-includedir=src
-sourcedir=src src/editor src/def src/pgtk tests
+[prerules]
+FPMAKE_BIN_CLEAN=$(wildcard .$(PATHSEP)fpmake$(SRCEXEEXT))
+ifdef OS_TARGET
+FPC_TARGETOPT+=--os=$(OS_TARGET)
+endif
+ifdef CPU_TARGET
+FPC_TARGETOPT+=--cpu=$(CPU_TARGET)
+endif
+LOCALFPMAKE=.$(PATHSEP)fpmake$(SRCEXEEXT)
[rules]
.NOTPARALLEL:
+
+fpmake: fpmake.pp
+ $(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT)
+all: fpmake
+ $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu
+smart: fpmake
+ $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu -o -XX -o -CX
+release: fpmake
+ $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu -o -dRELEASE
+debug: fpmake
+ $(LOCALFPMAKE) compile --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) -bu -o -dDEBUG
+# If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will
+# most often fail because the dependencies are cleared.
+# In case of a clean, simply do nothing
+ifeq ($(FPMAKE_BIN_CLEAN),)
+clean:
+else
+clean:
+ $(FPMAKE_BIN_CLEAN) clean --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC)
+endif
+# In case of a distclean, perform an 'old'-style distclean. This to avoid problems
+# when the package is compiled using fpcmake prior to running this clean using fpmake
+ifeq ($(FPMAKE_BIN_CLEAN),)
+distclean: $(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall
+else
+distclean:
+ifdef inUnix
+ { $(FPMAKE_BIN_CLEAN) distclean --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC); if [ $$? != "0" ]; then { echo Something wrong with fpmake exectable. Remove the executable and call make recursively to recover.; $(DEL) $(FPMAKE_BIN_CLEAN); $(MAKE) fpc_cleanall; }; fi; }
+else
+ $(FPMAKE_BIN_CLEAN) distclean --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC)
+endif
+ -$(DEL) $(LOCALFPMAKE)
+endif
+install: fpmake
+ifdef UNIXHier
+ $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR)
+else
+ $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR)
+endif
+# distinstall also installs the example-sources
+distinstall: fpmake
+ifdef UNIXHier
+ $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) -ie
+else
+ $(LOCALFPMAKE) install --localunitdir=../.. --globalunitdir=.. $(FPC_TARGETOPT) $(addprefix -o ,$(FPCOPT)) --compiler=$(FPC) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) -ie
+endif
+