summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GNUmakefile.mk4
-rwxr-xr-xsolenv/gbuild/AllLangResTarget.mk4
-rwxr-xr-xsolenv/gbuild/ComponentTarget.mk4
-rw-r--r--solenv/gbuild/Executable.mk4
-rw-r--r--solenv/gbuild/Helper.mk19
-rwxr-xr-xsolenv/gbuild/Library.mk5
-rwxr-xr-xsolenv/gbuild/Module.mk2
-rw-r--r--solenv/gbuild/Package.mk4
-rw-r--r--solenv/gbuild/Shadow.mk49
-rwxr-xr-xsolenv/gbuild/StaticLibrary.mk4
-rwxr-xr-xsolenv/gbuild/gbuild.mk36
11 files changed, 44 insertions, 91 deletions
diff --git a/GNUmakefile.mk b/GNUmakefile.mk
index d8bdd13db0f0..fd53e09e2dda 100644
--- a/GNUmakefile.mk
+++ b/GNUmakefile.mk
@@ -25,6 +25,10 @@
#
#*************************************************************************
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
+
GBUILDDIR := $(SOLARENV)/gbuild
include $(dir $(lastword $(MAKEFILE_LIST)))/SourcePath.mk
include $(GBUILDDIR)/gbuild.mk
diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk
index b0587404b109..350ecff30fa6 100755
--- a/solenv/gbuild/AllLangResTarget.mk
+++ b/solenv/gbuild/AllLangResTarget.mk
@@ -228,8 +228,8 @@ $(call gb_ResTarget_get_target,%) : $(gb_Helper_MISCDUMMY) | $(gb_ResTarget_RSCT
$(call gb_ResTarget_get_outdir_target,%) :
$(call gb_Helper_abbreviate_dirs,\
- $(call gb_Shadow_deliver,$@,$<) && \
- $(call gb_Shadow_deliver,$(ILSTTARGET),$(dir $<)/$(notdir $(ILSTTARGET))))
+ $(call gb_Helper_deliver,$<,$@) && \
+ $(call gb_Helper_deliver,$(dir $<)/$(notdir $(ILSTTARGET)),$(ILSTTARGET)))
define gb_ResTarget_ResTarget
$(call gb_ResTarget_get_target,$(1)) : LIBRARY = $(2)
diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk
index c0c95f65b9d0..0285d9445741 100755
--- a/solenv/gbuild/ComponentTarget.mk
+++ b/solenv/gbuild/ComponentTarget.mk
@@ -59,10 +59,12 @@ $(call gb_ComponentTarget_get_target,%) :
$(error unable to find component file $(call gb_ComponentTarget_get_source,,$*) in the repositories: $(gb_ComponentTarget_REPOS))
$(call gb_ComponentTarget_get_external_target,%) :
- $(call gb_Shadow_deliver,$@,$<)
+ $(call gb_Helper_deliver,$<,$@)
define gb_ComponentTarget_ComponentTarget
+$(call gb_ComponentTarget_get_target,$(1)) : LIBFILENAME := $(2)
$(call gb_ComponentTarget_get_outdir_target,$(1)) : $(call gb_ComponentTarget_get_target,$(1))
+
endef
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index d19f8104b492..841a3d754191 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -40,8 +40,8 @@ $(call gb_Executable_get_clean_target,%) :
$(call gb_Executable_get_target,%) :
$(call gb_Helper_abbreviate_dirs,\
- $(call gb_Shadow_deliver,$@,$<) \
- $(foreach target,$(AUXTARGETS), && $(call gb_Shadow_deliver,$(target),$(dir $<)/$(notdir $(target)))))
+ $(call gb_Helper_deliver,$<,$@) \
+ $(foreach target,$(AUXTARGETS), && $(call gb_Helper_deliver,$(dir $<)/$(notdir $(target)),$(target))))
define gb_Executable_Executable
$(call gb_Executable__Executable_impl,$(1),Executable/$(1)$(gb_Executable_EXT))
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index a1f5326d2099..7eb951d6e06e 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -36,9 +36,18 @@ COMMA :=,
gb_Helper_NULLFILE := /dev/null
gb_Helper_MISC := $(WORKDIR)/Misc
+
+# general propose phony target
gb_Helper_PHONY := $(gb_Helper_MISC)/PHONY
+
+# general propose empty dummy target
gb_Helper_MISCDUMMY := $(gb_Helper_MISC)/DUMMY
+# if ($true) then old files will get removed from the target location before
+# they are copied there. In multi-user environments, this is needed you need to
+# be the owner of the target file to be able to cp -pf
+gb_Helper_CLEARONDELIVER := $(true)
+
.PHONY : $(WORKDIR)/Misc/PHONY
$(gb_Helper_MISCDUMMY) :
@mkdir -p $(dir $@) && touch $@
@@ -91,4 +100,14 @@ define gb_Helper_get_outdir_clean_target
$$(subst $(OUTDIR)/,$(WORKDIR)/Clean/OutDir/,$(1))
endef
+gb_Helper__deliverprefix = mkdir -p $(dir $(1)) &&
+
+ifeq ($(gb_Helper_CLEARONDELIVER),$(true))
+gb_Helper__deliverprefix += rm -rf $(1) &&
+endif
+
+define gb_Helper_deliver
+$(call gb_Helper__deliverprefix,$(2)) cp -pf $(1) $(2)
+endef
+
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 9b74bdb618ba..7fd47dc2c670 100755
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -47,11 +47,10 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT) : $(call gb_LinkTarget_get_c
$(AUXTARGETS))
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
-# FIXME: this should be cp -pf but that might break on some nfs setups
$(gb_Library_OUTDIRLOCATION)/%$(gb_Library_PLAINEXT) :
$(call gb_Helper_abbreviate_dirs,\
- $(call gb_Shadow_deliver,$@,$<) \
- $(foreach target,$(AUXTARGETS), && $(call gb_Shadow_deliver,$(target),$(dir $<)/$(notdir $(target)))))
+ $(call gb_Helper_deliver,$<,$@) \
+ $(foreach target,$(AUXTARGETS), && $(call gb_Helper_deliver,$(dir $<)/$(notdir $(target)),$(target))))
define gb_Library_Library
ifeq (,$$(findstring $(1),$$(gb_Library_KNOWNLIBS)))
diff --git a/solenv/gbuild/Module.mk b/solenv/gbuild/Module.mk
index 7f17380f6c9c..f5eab5a181f2 100755
--- a/solenv/gbuild/Module.mk
+++ b/solenv/gbuild/Module.mk
@@ -92,6 +92,8 @@ include $(1)
all : $$(firstword $$(gb_Module_TARGETSTACK))
clean : $$(firstword $$(gb_Module_CLEANTARGETSTACK))
+install : all
+uninstall : clean
ifneq ($$(words $$(gb_Module_TARGETSTACK)),1)
$$(warn corrupted module target stack!)
diff --git a/solenv/gbuild/Package.mk b/solenv/gbuild/Package.mk
index 78ec477956d2..554e8b78a11c 100644
--- a/solenv/gbuild/Package.mk
+++ b/solenv/gbuild/Package.mk
@@ -26,13 +26,15 @@
#*************************************************************************
# PackagePart class
+
$(foreach destination,$(call gb_PackagePart_get_destinations), $(destination)/%) :
- $(call gb_Shadow_deliver,$@,$<)
+ $(call gb_Helper_deliver,$<,$@)
define gb_PackagePart_PackagePart
$(OUTDIR)/$(1) : $(2)
endef
+
# Package class
.PHONY : $(call gb_Package_get_clean_target,%)
diff --git a/solenv/gbuild/Shadow.mk b/solenv/gbuild/Shadow.mk
deleted file mode 100644
index c44a7a641385..000000000000
--- a/solenv/gbuild/Shadow.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-# returns the absolute shadow file path for the file
-# $(1) absolute OUTDIR path
-gb_Shadow__get_file = $(patsubst $(OUTDIR)%,$(SHADOWOUTDIR)%,$(1))
-
-define gb_Shadow__deliver
-mkdir -p $(dir $(2)) && cp -f $(1) $(2) && touch -r $(1) $(2)
-endef
-
-# copies the file from the younger source:
-# - either the file at the same location in the shadowoutdir
-# - or the workdir source
-# $(1) target in the outdir (full path)
-# $(2) source in the workdir (full path) or an empty string
-ifneq ($(SHADOWOUTDIR),)
-define gb_Shadow_deliver
-if [ $(2) ]; then $(call gb_Shadow__deliver,$(2),$(1)); else $(call gb_Shadow__deliver,$(call gb_Shadow__get_file,$(1)),$(1)); fi
-endef
-else
-gb_Shadow_deliver = $(call gb_Shadow__deliver,$(2),$(1))
-endif
-
-# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk
index edd535917355..6274ff99b6d3 100755
--- a/solenv/gbuild/StaticLibrary.mk
+++ b/solenv/gbuild/StaticLibrary.mk
@@ -47,8 +47,8 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT) : $(call gb_LinkTarget
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
$(gb_StaticLibrary_OUTDIRLOCATION)/%$(gb_StaticLibrary_PLAINEXT) :
$(call gb_Helper_abbreviate_dirs,\
- $(call gb_Shadow_deliver,$@,$<) \
- $(foreach target,$(AUXTARGETS), && $(call gb_Shadow_deliver,$(target),$(dir $<)/$(notdir $(target)))))
+ $(call gb_Helper_deliver,$<,$@) \
+ $(foreach target,$(AUXTARGETS), && $(call gb_Helper_deliver,$(dir $<)/$(notdir $(target)),$(target))))
define gb_StaticLibrary_StaticLibrary
ifeq (,$$(findstring $(1),$$(gb_StaticLibrary_KNOWNLIBS)))
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index dc31b6d66c20..27791af17b48 100755
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -49,35 +49,10 @@
# USE_SYSTEM_STL (Linux)
SHELL := /bin/sh
-
-ifeq ($(strip $(SOLARSRC)),)
-$(error No environment set)
-endif
-
-# extend for JDK include (seems only needed in setsolar env?)
-SOLARINC += $(JDKINCS)
-
-OUTDIR := $(SOLARVERSION)/$(INPATH)
-WORKDIR := $(SOLARVERSION)/$(INPATH)/workdir
-ifeq ($(strip $(gb_REPOS)),)
-gb_REPOS := $(SRCDIR)
-endif
-
-# HACK
-ifeq ($(OS),WNT)
-WORKDIR := $(shell cygpath -u $(WORKDIR))
-OUTDIR := $(shell cygpath -u $(OUTDIR))
-gb_REPOS := $(shell cygpath -u $(gb_REPOS))
-endif
-
-REPODIR := $(patsubst %/,%,$(dir $(firstword $(gb_REPOS))))
-ifeq ($(SRCDIR),)
-SRCDIR := $(REPODIR)/ooo
-endif
-
true := T
false :=
+include $(GBUILDDIR)/BuildDirs.mk
ifneq ($(strip $(PRODUCT)$(product)),)
gb_PRODUCT := $(true)
@@ -101,11 +76,11 @@ else
gb_ENABLE_PCH := $(false)
endif
-
-gb_FULLDEPS := $(true)
-#gb_FULLDEPS := $(false)
-ifeq ($(MAKECMDGOALS),clean)
+# for clean and uninstall goals we switch of dependencies
+ifneq ($(filter clean uninstall,$(MAKECMDGOALS)),)
gb_FULLDEPS := $(false)
+else
+gb_FULLDEPS := $(true)
endif
include $(GBUILDDIR)/Helper.mk
@@ -219,7 +194,6 @@ include $(GBUILDDIR)/TargetLocations.mk
# is not available everywhere by default.
include $(foreach class, \
- Shadow \
ComponentTarget \
AllLangResTarget \
LinkTarget \