diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-02-12 13:36:56 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-02-19 19:24:32 +0100 |
commit | 8e85ef05018ba44b142eed75e2a64cc9480a8970 (patch) | |
tree | 1b5485aeac24307db9cd3b5ee7c76012afcaac0c /solenv | |
parent | 02192b8366c9301ab168770963a88292f4051f52 (diff) |
gbuild: Zip: clean properly all created targets on 'make clean'
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/Zip.mk | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/solenv/gbuild/Zip.mk b/solenv/gbuild/Zip.mk index f6d492ed9c6d..69e1f402f2ee 100644 --- a/solenv/gbuild/Zip.mk +++ b/solenv/gbuild/Zip.mk @@ -37,8 +37,9 @@ $(call gb_Zip_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),ZIP,3) $(call gb_Helper_abbreviate_dirs,\ rm -f $(call gb_Zip_get_target,$*) && \ - rm -f $(call gb_Zip_get__preparation_target,$*) && \ + rm -f $(call gb_Zip__get_preparation_target,$*) && \ rm -f $(call gb_Zip_get_final_target,$*) && \ + $(if $(CLEAR_LOCATION),rm -rf $(gb_Package_Location_$*) &&) \ rm -f $(call gb_Zip_get_outdir_target,$*)) # rule to create zip package in workdir @@ -71,6 +72,7 @@ $(call gb_Zip__get_preparation_target,%) : define gb_Zip_Zip $(call gb_Zip_get_target,$(1)) : FILES := $(call gb_Zip_get_target,$(1)) : LOCATION := $(2) +$(call gb_Zip_get_clean_target,$(1)) : CLEAR_LOCATION := gb_Package_Location_$(1) := $(2) $(eval $(call gb_Module_register_target,$(call gb_Zip_get_final_target,$(1)),$(call gb_Zip_get_clean_target,$(1)))) $(call gb_Deliver_add_deliverable,$(call gb_Zip_get_outdir_target,$(1)),$(call gb_Zip_get_target,$(1)),$(1)) @@ -81,12 +83,15 @@ endef # adding a file creates a dependency to it # the full path name of the file needs access to the package location # as scoped variables only exist in rules, we use a postfixed name to refer to the location +# # if package location is in $(WORKDIR) we can specify third parameter and copy file from different place +# then we need also remove the location on make clean define gb_Zip_add_file $(call gb_Zip_get_target,$(1)) : FILES += $(2) $(call gb_Zip_get_target,$(1)) : $(gb_Package_Location_$(1))/$(2) $(gb_Package_Location_$(1))/$(2) :| $(call gb_Zip__get_preparation_target,$(1)) ifneq ($(3),) +$(call gb_Zip_get_clean_target,$(1)) : CLEAR_LOCATION := TRUE $(gb_Package_Location_$(1))/$(2) : $(3) mkdir -p $$(dir $$@) cp -f $$< $$@ |