summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <b_michaelsen@openoffice.org>2010-11-22 17:46:34 +0100
committerBjoern Michaelsen <b_michaelsen@openoffice.org>2010-11-22 17:46:34 +0100
commitc0fde8c88fdd63546d8166f72a8fff81a4a97b02 (patch)
treed32f4e69a5e66ad252feb9b05c08d3d54987d942
parenta228fd5857c76575f4b33e95a2ac2ba6170220a9 (diff)
parent0fb117ca84c0fe58026b61de34eb2e6991fa6e4c (diff)
gnumake2: merging minibranches
-rwxr-xr-xsolenv/bin/packmodule10
-rw-r--r--solenv/gbuild/Deliver.mk4
-rw-r--r--solenv/gbuild/Module.mk5
-rw-r--r--solenv/gbuild/extensions/PackModule.mk24
-rw-r--r--solenv/gbuild/extensions/SetupLocal.mk11
-rw-r--r--solenv/gbuild/gbuild.mk4
6 files changed, 34 insertions, 24 deletions
diff --git a/solenv/bin/packmodule b/solenv/bin/packmodule
index 6261bd25754f..3c50bd7f8588 100755
--- a/solenv/bin/packmodule
+++ b/solenv/bin/packmodule
@@ -28,26 +28,26 @@
import os, os.path, sys, zipfile
def paths_to_pack(loglines):
- """Returns a generator iterating the outdir fields (with platform) of deliver.log lines."""
+ """Returns a generator iterating the outdir fields (with platform) of gb_deliver.log lines."""
return (line.split()[2] for line in loglines)
def stripped_paths_to_pack(loglines):
- """returns a generator iterating the outdir fields (stripped of the platform) of deliver.log lines."""
+ """returns a generator iterating the outdir fields (stripped of the platform) of gb_deliver.log lines."""
return (path.partition('/')[2] for path in paths_to_pack(loglines))
def main(args):
- """creates/overwrites a file at OUTDIR/zip/MILESTONE/MODULE.zip containing the contents of the deliver.log."""
+ """creates/overwrites a file at OUTDIR/zip/MILESTONE/MODULE.zip containing the contents of the gb_deliver.log."""
if len(args) != 4:
print('usage: packmodule OUTDIR MODULE MILESTONE')
sys.exit(2)
(executable, outdir, module, milestone) = args
os.chdir(outdir)
- zipdir = os.path.join('zip', milestone)
+ zipdir = 'zip.'+milestone
try:
os.makedirs(zipdir)
except OSError:
pass
- deliverlog = open(os.path.join('inc', module, 'deliver.log'))
+ deliverlog = open(os.path.join('inc', module, 'gb_deliver.log'))
packedmodule = zipfile.ZipFile(os.path.join(zipdir,module+'.zip'), 'w')
[packedmodule.write(path) for path in stripped_paths_to_pack(deliverlog)]
packedmodule.close()
diff --git a/solenv/gbuild/Deliver.mk b/solenv/gbuild/Deliver.mk
index ebeb2b28668f..a722cd945886 100644
--- a/solenv/gbuild/Deliver.mk
+++ b/solenv/gbuild/Deliver.mk
@@ -46,7 +46,7 @@ endef
# FIXME: this does not really work for real multi repository builds, but the
# deliver.log format is broken in that case anyway
define gb_Deliver_add_deliverable
-gb_Deliver_DELIVERABLES += $$(patsubst $(SOURCE_ROOT_DIR)/%,%,$(2)):$$(patsubst $(SOURCE_ROOT_DIR)/%,%,$(1))
+gb_Deliver_DELIVERABLES += $$(patsubst $(REPODIR)/%,%,$(2)):$$(patsubst $(REPODIR)/%,%,$(1))
endef
@@ -63,7 +63,7 @@ define gb_Deliver_setdeliverlogcommand
ifeq ($$(words $(gb_Module_ALLMODULES)),1)
$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(true),LOG,1))
deliverlog : COMMAND := mkdir -p $$(OUTDIR)/inc/$$(strip $$(gb_Module_ALLMODULES)) &&
-deliverlog : COMMAND += echo "$$(sort $$(gb_Deliver_DELIVERABLES)) " | awk -f $$(GBUILDDIR)/processdelivered.awk > $$(OUTDIR)/inc/$$(strip $(gb_Module_ALLMODULES))/deliver.log
+deliverlog : COMMAND += echo "$$(sort $$(gb_Deliver_DELIVERABLES)) " | awk -f $$(GBUILDDIR)/processdelivered.awk > $$(OUTDIR)/inc/$$(strip $(gb_Module_ALLMODULES))/gb_deliver.log
else
$$(eval $$(call gb_Output_announce,more than one module - creating no deliver.log,$$(true),LOG,1))
deliverlog : COMMAND := true
diff --git a/solenv/gbuild/Module.mk b/solenv/gbuild/Module.mk
index f4ae3459729e..afc40a835cfe 100644
--- a/solenv/gbuild/Module.mk
+++ b/solenv/gbuild/Module.mk
@@ -47,7 +47,7 @@ $(call gb_Module_get_target,%) :
mkdir -p $(dir $@) && \
touch $@)
-.PHONY : all clean install uninstall
+.PHONY : all clean
.DEFAULT_GOAL := all
all :
@@ -62,9 +62,6 @@ clean :
$(call gb_Output_announce_title,all cleared.)
$(call gb_Output_announce_bell)
-install : all
-uninstall : clean
-
define gb_Module_Module
gb_Module_ALLMODULES += $(1)
gb_Module_MODULELOCATIONS += $(1):$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
diff --git a/solenv/gbuild/extensions/PackModule.mk b/solenv/gbuild/extensions/PackModule.mk
index 95a557a7126b..319840324d8d 100644
--- a/solenv/gbuild/extensions/PackModule.mk
+++ b/solenv/gbuild/extensions/PackModule.mk
@@ -29,6 +29,8 @@
# it depends on scripts outside the gbuild directory
# nothing in the gbuild core should ever depend on it
+.PHONY : packmodule cleanpackmodule
+
define gb_PackModule_setpackmodulecommand
ifeq ($$(words $(gb_Module_ALLMODULES)),1)
$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(true),ZIP,5))
@@ -39,18 +41,22 @@ packmodule : COMMAND := true
endif
endef
-.PHONY : packmodule cleanpackmodule
packmodule : all
$(eval $(call gb_PackModule_setpackmodulecommand))
$(COMMAND)
-# TODO: implement cleanpackmodule
-# Should cleanpackmodule depend on clean and thus remove the build too? That
-# would be consistent with the current behaviour of packmodule. Or should it
-# only remove the packed module, but nothing else? Or should packmodule have
-# an order only dependency on all? Then one could either pack whats there with
-# "packmodule" (might fail on an incomplete build) or make sure everything is
-# up-to-date with "packmodule all".
-
+define gb_PackModule_setcleanpackmodulecommand
+ifeq ($$(words $(gb_Module_ALLMODULES)),1)
+$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(false),ZIP,5))
+cleanpackmodule : COMMAND := rm -f $$(OUTDIR)/zip.$$(UPDMINOR)/$$(strip $$(gb_Module_ALLMODULES)).zip
+else
+$$(eval $$(call gb_Output_announce,more than one module - deleting no zipped package,$$(false),ZIP,5))
+cleanpackmodule : COMMAND := true
+endif
+endef
+cleanpackmodule : clean
+ $(eval $(call gb_PackModule_setcleanpackmodulecommand))
+ $(COMMAND)
+
# vim: set noet ts=4 sw=4:
diff --git a/solenv/gbuild/extensions/SetupLocal.mk b/solenv/gbuild/extensions/SetupLocal.mk
index f623e4b81192..483b8a163056 100644
--- a/solenv/gbuild/extensions/SetupLocal.mk
+++ b/solenv/gbuild/extensions/SetupLocal.mk
@@ -25,11 +25,11 @@
#
#*************************************************************************
-ifneq ($(gb_LOCALBUILDDIR),)
.PHONY : setuplocal removelocal
+ifneq ($(gb_LOCALBUILDDIR),)
ifneq ($(wildcard $(gb_LOCALBUILDDIR)/SetupLocal.mk),)
setuplocal :
- $(eval, $(call gb_Output_error,$(gb_LOCALBUILDDIR) exists already.))
+ $(eval $(call gb_Output_error,$(gb_LOCALBUILDDIR) exists already.))
else
@@ -56,6 +56,13 @@ removelocal :
sleep 10
rm -rf $(gb_LOCALBUILDDIR)
+else
+setuplocal:
+ $(eval $(call gb_Output_error,setuplocal: gb_LOCALBUILDDIR is not set.))
+
+removelocal:
+ $(eval $(call gb_Output_error,setuplocal: gb_LOCALBUILDDIR is not set.))
+
endif
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 0cc6e74260c9..fcf7e02cf952 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -94,8 +94,8 @@ else
gb_ENABLE_PCH := $(false)
endif
-# for clean, uninstall and setuplocal goals we switch off dependencies
-ifneq ($(filter clean uninstall setuplocal removelocal,$(MAKECMDGOALS)),)
+# for clean, setuplocal and removelocal goals we switch off dependencies
+ifneq ($(filter clean setuplocal removelocal,$(MAKECMDGOALS)),)
gb_FULLDEPS := $(false)
else
gb_FULLDEPS := $(true)