Skip to content

Commit d0d7587

Browse files
kartgmergify[bot]
authored andcommitted
Refactor "source-dist" and "source-bundle" targets to reduce duplication
This is done by introducing a generic function that holds the common code, which then creates these two targets. The differing properties (like rsync flags) are passed in as function arguments. Signed-off-by: Kartik Ganesh <[email protected]> (cherry picked from commit f84c210)
1 parent 46cdadb commit d0d7587

File tree

1 file changed

+135
-213
lines changed

1 file changed

+135
-213
lines changed

Makefile

Lines changed: 135 additions & 213 deletions
Original file line numberDiff line numberDiff line change
@@ -134,37 +134,9 @@ define restore_hex_cache_from_erl_term
134134
endef
135135

136136
# --------------------------------------------------------------------
137-
# Distribution.
137+
# Distribution - common variables and generic functions.
138138
# --------------------------------------------------------------------
139139

140-
141-
.PHONY: source-dist clean-source-dist
142-
143-
SOURCE_DIST_BASE ?= rabbitmq-server
144-
SOURCE_DIST_SUFFIXES ?= tar.xz
145-
SOURCE_DIST ?= $(PACKAGES_DIR)/$(SOURCE_DIST_BASE)-$(PROJECT_VERSION)
146-
147-
# The first source distribution file is used by packages: if the archive
148-
# type changes, you must update all packages' Makefile.
149-
SOURCE_DIST_FILES = $(addprefix $(SOURCE_DIST).,$(SOURCE_DIST_SUFFIXES))
150-
151-
.PHONY: $(SOURCE_DIST_FILES)
152-
153-
source-dist: $(SOURCE_DIST_FILES)
154-
@:
155-
156-
.PHONY: source-bundle clean-source-bundle
157-
158-
SOURCE_BUNDLE_BASE ?= rabbitmq-server-bundle
159-
BUNDLE_DIST ?= $(PACKAGES_DIR)/$(SOURCE_BUNDLE_BASE)-$(PROJECT_VERSION)
160-
161-
BUNDLE_DIST_FILES = $(addprefix $(BUNDLE_DIST).,$(SOURCE_DIST_SUFFIXES))
162-
163-
.PHONY: $(BUNDLE_DIST_FILES)
164-
165-
source-bundle: $(BUNDLE_DIST_FILES)
166-
@:
167-
168140
RSYNC ?= rsync
169141
RSYNC_V_0 =
170142
RSYNC_V_1 = -v
@@ -253,69 +225,124 @@ ZIP_V_1 =
253225
ZIP_V_2 =
254226
ZIP_V = $(ZIP_V_$(V))
255227

256-
.PHONY: $(SOURCE_DIST)
257-
.PHONY: clean-source-dist distclean-packages clean-unpacked-source-dist
258-
259-
$(SOURCE_DIST): $(ERLANG_MK_RECURSIVE_DEPS_LIST)
260-
$(verbose) mkdir -p $(dir $@)
261-
$(gen_verbose) $(RSYNC) $(SOURCE_DIST_RSYNC_FLAGS) ./ $@/
262-
$(verbose) echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" > "$@/git-revisions.txt"
263-
$(verbose) echo "$(PROJECT) $$(git rev-parse HEAD) $$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)" >> "$@/git-revisions.txt"
264-
$(verbose) echo "$$(TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')" > "$@.git-times.txt"
265-
$(verbose) cat packaging/common/LICENSE.head > $@/LICENSE
266-
$(verbose) mkdir -p $@/deps/licensing
267-
$(verbose) set -e; for dep in $$(cat $(ERLANG_MK_RECURSIVE_DEPS_LIST) | LC_COLLATE=C sort); do \
268-
$(RSYNC) $(SOURCE_DIST_RSYNC_FLAGS) \
269-
$$dep \
270-
$@/deps; \
228+
ifeq ($(shell tar --version | grep -c "GNU tar"),0)
229+
# Skip all flags if this is Darwin (a.k.a. macOS, a.k.a. OS X)
230+
ifeq ($(shell uname | grep -c "Darwin"),0)
231+
TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS = --uid 0 \
232+
--gid 0 \
233+
--numeric-owner \
234+
--no-acls \
235+
--no-fflags \
236+
--no-xattrs
237+
endif
238+
else
239+
TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS = --owner 0 \
240+
--group 0 \
241+
--numeric-owner
242+
endif
243+
244+
DIST_SUFFIXES ?= tar.xz
245+
246+
# Function to create distribution targets
247+
# Args: $(1) - Full distribution path
248+
# $(2) - RSYNC flags to use
249+
define create_dist_target
250+
$(1): $(ERLANG_MK_RECURSIVE_DEPS_LIST)
251+
$${verbose} mkdir -p $$(dir $$@)
252+
$${gen_verbose} $${RSYNC} $(2) ./ $$@/
253+
$${verbose} echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" > $$@/git-revisions.txt
254+
$${verbose} echo "$(PROJECT) $$$$(git rev-parse HEAD) $$$$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)" >> $$@/git-revisions.txt
255+
$${verbose} echo "$$$$(TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')" > $$@.git-times.txt
256+
$${verbose} cat packaging/common/LICENSE.head > $$@/LICENSE
257+
$${verbose} mkdir -p $$@/deps/licensing
258+
$${verbose} set -e; for dep in $$$$(cat $(ERLANG_MK_RECURSIVE_DEPS_LIST) | LC_COLLATE=C sort); do \
259+
$${RSYNC} $(2) \
260+
$$$$dep \
261+
$$@/deps; \
271262
rm -f \
272-
$@/deps/rabbit_common/rebar.config \
273-
$@/deps/rabbit_common/rebar.lock; \
274-
if test -f $@/deps/$$(basename $$dep)/erlang.mk && \
275-
test "$$(wc -l $@/deps/$$(basename $$dep)/erlang.mk | awk '{print $$1;}')" = "1" && \
276-
grep -qs -E "^[[:blank:]]*include[[:blank:]]+(erlang\.mk|.*/erlang\.mk)$$" $@/deps/$$(basename $$dep)/erlang.mk; then \
277-
echo "include ../../erlang.mk" > $@/deps/$$(basename $$dep)/erlang.mk; \
263+
$$@/deps/rabbit_common/rebar.config \
264+
$$@/deps/rabbit_common/rebar.lock; \
265+
if test -f $$@/deps/$$$$(basename $$$$dep)/erlang.mk && \
266+
test "$$$$(wc -l $$@/deps/$$$$(basename $$$$dep)/erlang.mk | awk '{print $$$$1;}')" = "1" && \
267+
grep -qs -E "^[[:blank:]]*include[[:blank:]]+(erlang\.mk|.*/erlang\.mk)$$$$" $$@/deps/$$$$(basename $$$$dep)/erlang.mk; then \
268+
echo "include ../../erlang.mk" > $$@/deps/$$$$(basename $$$$dep)/erlang.mk; \
278269
fi; \
279-
sed -E -i.bak "s|^[[:blank:]]*include[[:blank:]]+\.\./.*erlang.mk$$|include ../../erlang.mk|" \
280-
$@/deps/$$(basename $$dep)/Makefile && \
281-
rm $@/deps/$$(basename $$dep)/Makefile.bak; \
282-
mix_exs=$@/deps/$$(basename $$dep)/mix.exs; \
283-
if test -f $$mix_exs; then \
284-
(cd $$(dirname "$$mix_exs") && \
285-
(test -d $@/deps/.hex || env DEPS_DIR=$@/deps MIX_HOME=$@/deps/.mix HEX_HOME=$@/deps/.hex MIX_ENV=prod FILL_HEX_CACHE=yes mix local.hex --force) && \
286-
env DEPS_DIR=$@/deps MIX_HOME=$@/deps/.mix HEX_HOME=$@/deps/.hex MIX_ENV=prod FILL_HEX_CACHE=yes mix deps.get --only prod && \
270+
sed -E -i.bak "s|^[[:blank:]]*include[[:blank:]]+\.\./.*erlang.mk$$$$|include ../../erlang.mk|" \
271+
$$@/deps/$$$$(basename $$$$dep)/Makefile && \
272+
rm $$@/deps/$$$$(basename $$$$dep)/Makefile.bak; \
273+
mix_exs=$$@/deps/$$$$(basename $$$$dep)/mix.exs; \
274+
if test -f $$$$mix_exs; then \
275+
(cd $$$$(dirname "$$$$mix_exs") && \
276+
(test -d $$@/deps/.hex || env DEPS_DIR=$$@/deps MIX_HOME=$$@/deps/.mix HEX_HOME=$$@/deps/.hex MIX_ENV=prod FILL_HEX_CACHE=yes mix local.hex --force) && \
277+
env DEPS_DIR=$$@/deps MIX_HOME=$$@/deps/.mix HEX_HOME=$$@/deps/.hex MIX_ENV=prod FILL_HEX_CACHE=yes mix deps.get --only prod && \
287278
cp $(CURDIR)/mk/rabbitmq-mix.mk . && \
288279
rm -rf _build deps); \
289280
fi; \
290-
if test -f "$$dep/license_info"; then \
291-
cp "$$dep/license_info" "$@/deps/licensing/license_info_$$(basename "$$dep")"; \
292-
cat "$$dep/license_info" >> $@/LICENSE; \
281+
if test -f "$$$$dep/license_info"; then \
282+
cp "$$$$dep/license_info" "$$@/deps/licensing/license_info_$$$$(basename $$$$dep)"; \
283+
cat "$$$$dep/license_info" >> $$@/LICENSE; \
293284
fi; \
294-
find "$$dep" -maxdepth 1 -name 'LICENSE-*' -exec cp '{}' $@/deps/licensing \; ; \
295-
(cd $$dep; \
296-
echo "$$(basename "$$dep") $$(git rev-parse HEAD) $$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)") \
297-
>> "$@/git-revisions.txt"; \
298-
! test -d $$dep/.git || (cd $$dep; \
299-
echo "$$(env TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')") \
300-
>> "$@.git-times.txt"; \
285+
find "$$$$dep" -maxdepth 1 -name 'LICENSE-*' -exec cp '{}' $$@/deps/licensing \; ; \
286+
(cd $$$$dep; \
287+
echo "$$$$(basename "$$$$dep") $$$$(git rev-parse HEAD) $$$$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)") \
288+
>> "$$@/git-revisions.txt"; \
289+
! test -d $$$$dep/.git || (cd $$$$dep; \
290+
echo "$$$$(env TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')") \
291+
>> "$$@.git-times.txt"; \
301292
done
302-
$(verbose) cat packaging/common/LICENSE.tail >> $@/LICENSE
303-
$(verbose) find $@/deps/licensing -name 'LICENSE-*' -exec cp '{}' $@ \;
304-
$(verbose) rm -rf $@/deps/licensing
305-
$(verbose) for file in $$(find $@ -name '*.app.src'); do \
293+
$${verbose} cat packaging/common/LICENSE.tail >> $$@/LICENSE
294+
$${verbose} find $$@/deps/licensing -name 'LICENSE-*' -exec cp '{}' $$@ \;
295+
$${verbose} rm -rf $$@/deps/licensing
296+
$${verbose} for file in $$$$(find $$@ -name '*.app.src'); do \
306297
sed -E -i.bak \
307298
-e 's/[{]vsn[[:blank:]]*,[[:blank:]]*(""|"0.0.0")[[:blank:]]*}/{vsn, "$(PROJECT_VERSION)"}/' \
308299
-e 's/[{]broker_version_requirements[[:blank:]]*,[[:blank:]]*\[\][[:blank:]]*}/{broker_version_requirements, ["$(PROJECT_VERSION)"]}/' \
309-
$$file; \
310-
rm $$file.bak; \
300+
$$$$file; \
301+
rm $$$$file.bak; \
311302
done
312-
$(verbose) echo "PLUGINS := $(PLUGINS)" > $@/plugins.mk
313-
# Remember the latest Git timestamp.
314-
$(verbose) sort -r < "[email protected]" | head -n 1 > "[email protected]"
315-
$(verbose) $(call erlang,$(call dump_hex_cache_to_erl_term,$(call core_native_path,$@),$(call core_native_path,[email protected])))
316-
# Fix file timestamps to have reproducible source archives.
317-
$(verbose) find $@ -print0 | xargs -0 touch -t "$$(cat "[email protected]")"
318-
303+
$${verbose} echo "PLUGINS := $(PLUGINS)" > $$@/plugins.mk
304+
$${verbose} sort -r < "$$@.git-times.txt" | head -n 1 > "$$@.git-time.txt"
305+
$${verbose} $$(call erlang,$$(call dump_hex_cache_to_erl_term,$$(call core_native_path,$$@),$$(call core_native_path,$$@.git-time.txt)))
306+
$${verbose} find $$@ -print0 | xargs -0 touch -t "$$$$(cat $$@.git-time.txt)"
307+
$${verbose} rm "$$@.git-times.txt" "$$@.git-time.txt"
308+
309+
$(1).manifest: $(1)
310+
$${gen_verbose} cd $$(dir $$@) && \
311+
find $$(notdir $$<) | LC_COLLATE=C sort > $$@
312+
313+
$(1).tar.xz: $(1).manifest
314+
$${gen_verbose} cd $$(dir $$@) && \
315+
$${TAR} $${TAR_V} $${TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS} --no-recursion -T $$(notdir $$<) -cf - | \
316+
$${XZ} > $$@
317+
318+
$(1).tar.gz: $(1).manifest
319+
$${gen_verbose} cd $$(dir $$@) && \
320+
$${TAR} $${TAR_V} $${TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS} --no-recursion -T $$(notdir $$<) -cf - | \
321+
$${GZIP} --best > $$@
322+
323+
$(1).tar.bz2: $(1).manifest
324+
$${gen_verbose} cd $$(dir $$@) && \
325+
$${TAR} $${TAR_V} $${TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS} --no-recursion -T $$(notdir $$<) -cf - | \
326+
$${BZIP2} > $$@
327+
328+
$(1).zip: $(1).manifest
329+
$${verbose} rm -f $$@
330+
$${gen_verbose} cd $$(dir $$@) && \
331+
$${ZIP} $${ZIP_V} --names-stdin $$@ < $$(notdir $$<)
332+
333+
endef
334+
335+
# Function to create clean targets
336+
# Args: $(1) - Base name (e.g. SOURCE_DIST_BASE or BUNDLE_DIST_BASE)
337+
define create_clean_targets
338+
.PHONY: clean-$(1)
339+
340+
clean-$(1):
341+
$${gen_verbose} rm -rf -- $(1)-*
342+
343+
# Add each clean target to the clean:: rule
344+
clean:: clean-$(1)
345+
endef
319346

320347
# Mix Hex component requires a cache file, otherwise it refuses to build
321348
# offline... That cache is an ETS table with all the applications we
@@ -358,140 +385,35 @@ define dump_hex_cache_to_erl_term
358385
init:stop().
359386
endef
360387

361-
.PHONY: $(BUNDLE_DIST)
362-
363-
$(BUNDLE_DIST): $(ERLANG_MK_RECURSIVE_DEPS_LIST)
364-
$(verbose) mkdir -p $(dir $@)
365-
$(gen_verbose) $(RSYNC) $(SOURCE_BUNDLE_RSYNC_FLAGS) ./ $@/
366-
$(verbose) echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" > "$@/git-revisions.txt"
367-
$(verbose) echo "$(PROJECT) $$(git rev-parse HEAD) $$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)" >> "$@/git-revisions.txt"
368-
$(verbose) echo "$$(TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')" > "$@.git-times.txt"
369-
$(verbose) cat packaging/common/LICENSE.head > $@/LICENSE
370-
$(verbose) mkdir -p $@/deps/licensing
371-
$(verbose) set -e; for dep in $$(cat $(ERLANG_MK_RECURSIVE_DEPS_LIST) | LC_COLLATE=C sort); do \
372-
$(RSYNC) $(SOURCE_BUNDLE_RSYNC_FLAGS) \
373-
$$dep \
374-
$@/deps; \
375-
rm -f \
376-
$@/deps/rabbit_common/rebar.config \
377-
$@/deps/rabbit_common/rebar.lock; \
378-
if test -f $@/deps/$$(basename $$dep)/erlang.mk && \
379-
test "$$(wc -l $@/deps/$$(basename $$dep)/erlang.mk | awk '{print $$1;}')" = "1" && \
380-
grep -qs -E "^[[:blank:]]*include[[:blank:]]+(erlang\.mk|.*/erlang\.mk)$$" $@/deps/$$(basename $$dep)/erlang.mk; then \
381-
echo "include ../../erlang.mk" > $@/deps/$$(basename $$dep)/erlang.mk; \
382-
fi; \
383-
sed -E -i.bak "s|^[[:blank:]]*include[[:blank:]]+\.\./.*erlang.mk$$|include ../../erlang.mk|" \
384-
$@/deps/$$(basename $$dep)/Makefile && \
385-
rm $@/deps/$$(basename $$dep)/Makefile.bak; \
386-
mix_exs=$@/deps/$$(basename $$dep)/mix.exs; \
387-
if test -f $$mix_exs; then \
388-
(cd $$(dirname "$$mix_exs") && \
389-
(test -d $@/deps/.hex || env DEPS_DIR=$@/deps MIX_HOME=$@/deps/.mix HEX_HOME=$@/deps/.hex MIX_ENV=prod FILL_HEX_CACHE=yes mix local.hex --force) && \
390-
env DEPS_DIR=$@/deps MIX_HOME=$@/deps/.mix HEX_HOME=$@/deps/.hex MIX_ENV=prod FILL_HEX_CACHE=yes mix deps.get --only prod && \
391-
cp $(CURDIR)/mk/rabbitmq-mix.mk . && \
392-
rm -rf _build deps); \
393-
fi; \
394-
if test -f "$$dep/license_info"; then \
395-
cp "$$dep/license_info" "$@/deps/licensing/license_info_$$(basename "$$dep")"; \
396-
cat "$$dep/license_info" >> $@/LICENSE; \
397-
fi; \
398-
find "$$dep" -maxdepth 1 -name 'LICENSE-*' -exec cp '{}' $@/deps/licensing \; ; \
399-
(cd $$dep; \
400-
echo "$$(basename "$$dep") $$(git rev-parse HEAD) $$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)") \
401-
>> "$@/git-revisions.txt"; \
402-
! test -d $$dep/.git || (cd $$dep; \
403-
echo "$$(env TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')") \
404-
>> "$@.git-times.txt"; \
405-
done
406-
$(verbose) cat packaging/common/LICENSE.tail >> $@/LICENSE
407-
$(verbose) find $@/deps/licensing -name 'LICENSE-*' -exec cp '{}' $@ \;
408-
$(verbose) rm -rf $@/deps/licensing
409-
$(verbose) for file in $$(find $@ -name '*.app.src'); do \
410-
sed -E -i.bak \
411-
-e 's/[{]vsn[[:blank:]]*,[[:blank:]]*(""|"0.0.0")[[:blank:]]*}/{vsn, "$(PROJECT_VERSION)"}/' \
412-
-e 's/[{]broker_version_requirements[[:blank:]]*,[[:blank:]]*\[\][[:blank:]]*}/{broker_version_requirements, ["$(PROJECT_VERSION)"]}/' \
413-
$$file; \
414-
rm $$file.bak; \
415-
done
416-
$(verbose) echo "PLUGINS := $(PLUGINS)" > $@/plugins.mk
417-
# Remember the latest Git timestamp.
418-
$(verbose) sort -r < "[email protected]" | head -n 1 > "[email protected]"
419-
$(verbose) $(call erlang,$(call dump_hex_cache_to_erl_term,$(call core_native_path,$@),$(call core_native_path,[email protected])))
420-
# Fix file timestamps to have reproducible source archives.
421-
$(verbose) find $@ -print0 | xargs -0 touch -t "$$(cat "[email protected]")"
422-
423-
424-
$(SOURCE_DIST).manifest: $(SOURCE_DIST)
425-
$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
426-
find $(notdir $(SOURCE_DIST)) | LC_COLLATE=C sort > $@
427-
428-
$(BUNDLE_DIST).manifest: $(BUNDLE_DIST)
429-
$(gen_verbose) cd $(dir $(BUNDLE_DIST)) && \
430-
find $(notdir $(BUNDLE_DIST)) | LC_COLLATE=C sort > $@
388+
# --------------------------------------------------------------------
389+
# Distribution - public targets
390+
# --------------------------------------------------------------------
431391

432-
ifeq ($(shell tar --version | grep -c "GNU tar"),0)
433-
# Skip all flags if this is Darwin (a.k.a. macOS, a.k.a. OS X)
434-
ifeq ($(shell uname | grep -c "Darwin"),0)
435-
TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS = --uid 0 \
436-
--gid 0 \
437-
--numeric-owner \
438-
--no-acls \
439-
--no-fflags \
440-
--no-xattrs
441-
endif
442-
else
443-
TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS = --owner 0 \
444-
--group 0 \
445-
--numeric-owner
446-
endif
392+
SOURCE_DIST_BASE ?= rabbitmq-server
393+
SOURCE_DIST ?= $(PACKAGES_DIR)/$(SOURCE_DIST_BASE)-$(PROJECT_VERSION)
394+
SOURCE_DIST_FILES = $(addprefix $(SOURCE_DIST).,$(DIST_SUFFIXES))
395+
396+
.PHONY: source-dist
397+
source-dist: $(SOURCE_DIST_FILES)
398+
@:
399+
400+
$(eval $(call create_dist_target,$(SOURCE_DIST),$(SOURCE_DIST_RSYNC_FLAGS)))
401+
402+
SOURCE_BUNDLE_BASE ?= rabbitmq-server-bundle
403+
SOURCE_BUNDLE_DIST ?= $(PACKAGES_DIR)/$(SOURCE_BUNDLE_BASE)-$(PROJECT_VERSION)
404+
SOURCE_BUNDLE_FILES = $(addprefix $(SOURCE_BUNDLE_DIST).,$(DIST_SUFFIXES))
405+
406+
.PHONY: source-bundle
407+
source-bundle: $(SOURCE_BUNDLE_FILES)
408+
@:
409+
410+
$(eval $(call create_dist_target,$(SOURCE_BUNDLE_DIST),$(SOURCE_BUNDLE_RSYNC_FLAGS)))
411+
412+
# Create the clean targets for both distributions
413+
$(eval $(call create_clean_targets,$(SOURCE_DIST_BASE)))
414+
$(eval $(call create_clean_targets,$(SOURCE_BUNDLE_BASE)))
447415

448-
$(SOURCE_DIST).tar.gz: $(SOURCE_DIST).manifest
449-
$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
450-
$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(SOURCE_DIST).manifest -cf - | \
451-
$(GZIP) --best > $@
452-
453-
$(SOURCE_DIST).tar.bz2: $(SOURCE_DIST).manifest
454-
$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
455-
$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(SOURCE_DIST).manifest -cf - | \
456-
$(BZIP2) > $@
457-
458-
$(SOURCE_DIST).tar.xz: $(SOURCE_DIST).manifest
459-
$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
460-
$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(SOURCE_DIST).manifest -cf - | \
461-
$(XZ) > $@
462-
463-
$(SOURCE_DIST).zip: $(SOURCE_DIST).manifest
464-
$(verbose) rm -f $@
465-
$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
466-
$(ZIP) $(ZIP_V) --names-stdin $@ < $(SOURCE_DIST).manifest
467-
468-
$(BUNDLE_DIST).tar.gz: $(BUNDLE_DIST).manifest
469-
$(gen_verbose) cd $(dir $(BUNDLE_DIST)) && \
470-
$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(BUNDLE_DIST).manifest -cf - | \
471-
$(GZIP) --best > $@
472-
473-
$(BUNDLE_DIST).tar.bz2: $(BUNDLE_DIST).manifest
474-
$(gen_verbose) cd $(dir $(BUNDLE_DIST)) && \
475-
$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(BUNDLE_DIST).manifest -cf - | \
476-
$(BZIP2) > $@
477-
478-
$(BUNDLE_DIST).tar.xz: $(BUNDLE_DIST).manifest
479-
$(gen_verbose) cd $(dir $(BUNDLE_DIST)) && \
480-
$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(BUNDLE_DIST).manifest -cf - | \
481-
$(XZ) > $@
482-
483-
$(BUNDLE_DIST).zip: $(BUNDLE_DIST).manifest
484-
$(verbose) rm -f $@
485-
$(gen_verbose) cd $(dir $(BUNDLE_DIST)) && \
486-
$(ZIP) $(ZIP_V) --names-stdin $@ < $(BUNDLE_DIST).manifest
487-
488-
clean:: clean-source-dist
489-
490-
clean-source-dist:
491-
$(gen_verbose) rm -rf -- $(SOURCE_DIST_BASE)-*
492-
493-
clean-source-bundle:
494-
$(gen_verbose) rm -rf -- $(SOURCE_BUNDLE_BASE)-*
416+
.PHONY: distclean-packages clean-unpacked-source-dist
495417

496418
distclean:: distclean-packages
497419

0 commit comments

Comments
 (0)