Kaydet (Commit) 8e85ef05 authored tarafından Matúš Kukan's avatar Matúš Kukan

gbuild: Zip: clean properly all created targets on 'make clean'

üst 02192b83
...@@ -37,8 +37,9 @@ $(call gb_Zip_get_clean_target,%) : ...@@ -37,8 +37,9 @@ $(call gb_Zip_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),ZIP,3) $(call gb_Output_announce,$*,$(false),ZIP,3)
$(call gb_Helper_abbreviate_dirs,\ $(call gb_Helper_abbreviate_dirs,\
rm -f $(call gb_Zip_get_target,$*) && \ 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,$*) && \ rm -f $(call gb_Zip_get_final_target,$*) && \
$(if $(CLEAR_LOCATION),rm -rf $(gb_Package_Location_$*) &&) \
rm -f $(call gb_Zip_get_outdir_target,$*)) rm -f $(call gb_Zip_get_outdir_target,$*))
# rule to create zip package in workdir # rule to create zip package in workdir
...@@ -71,6 +72,7 @@ $(call gb_Zip__get_preparation_target,%) : ...@@ -71,6 +72,7 @@ $(call gb_Zip__get_preparation_target,%) :
define gb_Zip_Zip define gb_Zip_Zip
$(call gb_Zip_get_target,$(1)) : FILES := $(call gb_Zip_get_target,$(1)) : FILES :=
$(call gb_Zip_get_target,$(1)) : LOCATION := $(2) $(call gb_Zip_get_target,$(1)) : LOCATION := $(2)
$(call gb_Zip_get_clean_target,$(1)) : CLEAR_LOCATION :=
gb_Package_Location_$(1) := $(2) 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)))) $(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)) $(call gb_Deliver_add_deliverable,$(call gb_Zip_get_outdir_target,$(1)),$(call gb_Zip_get_target,$(1)),$(1))
...@@ -81,12 +83,15 @@ endef ...@@ -81,12 +83,15 @@ endef
# adding a file creates a dependency to it # adding a file creates a dependency to it
# the full path name of the file needs access to the package location # 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 # 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 # 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 define gb_Zip_add_file
$(call gb_Zip_get_target,$(1)) : FILES += $(2) $(call gb_Zip_get_target,$(1)) : FILES += $(2)
$(call gb_Zip_get_target,$(1)) : $(gb_Package_Location_$(1))/$(2) $(call gb_Zip_get_target,$(1)) : $(gb_Package_Location_$(1))/$(2)
$(gb_Package_Location_$(1))/$(2) :| $(call gb_Zip__get_preparation_target,$(1)) $(gb_Package_Location_$(1))/$(2) :| $(call gb_Zip__get_preparation_target,$(1))
ifneq ($(3),) ifneq ($(3),)
$(call gb_Zip_get_clean_target,$(1)) : CLEAR_LOCATION := TRUE
$(gb_Package_Location_$(1))/$(2) : $(3) $(gb_Package_Location_$(1))/$(2) : $(3)
mkdir -p $$(dir $$@) mkdir -p $$(dir $$@)
cp -f $$< $$@ cp -f $$< $$@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment