Skip to content

Commit 6e94818

Browse files
committed
Yolo-copy amqp_client targets for dist
1 parent 106c46f commit 6e94818

File tree

1 file changed

+144
-0
lines changed

1 file changed

+144
-0
lines changed

deps/amqp10_client/Makefile

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,147 @@ test/system_SUITE_data/apache-activemq-$(ACTIVEMQ_VERSION)-bin.tar.gz:
8181
tests:: $(ACTIVEMQ)
8282

8383
ct ct-system: $(ACTIVEMQ)
84+
85+
# --------------------------------------------------------------------
86+
# Distribution.
87+
# --------------------------------------------------------------------
88+
89+
.PHONY: distribution
90+
91+
distribution: docs source-dist package
92+
93+
docs:: edoc
94+
edoc: doc/overview.edoc
95+
96+
doc/overview.edoc: src/overview.edoc.in
97+
mkdir -p doc
98+
sed -e 's:%%VERSION%%:$(PROJECT_VERSION):g' < $< > $@
99+
100+
.PHONY: source-dist clean-source-dist
101+
102+
SOURCE_DIST_BASE ?= $(PROJECT)
103+
SOURCE_DIST_SUFFIXES ?= tar.xz zip
104+
SOURCE_DIST ?= $(PACKAGES_DIR)/$(SOURCE_DIST_BASE)-$(PROJECT_VERSION)-src
105+
106+
# The first source distribution file is used by packages: if the archive
107+
# type changes, you must update all packages' Makefile.
108+
SOURCE_DIST_FILES = $(addprefix $(SOURCE_DIST).,$(SOURCE_DIST_SUFFIXES))
109+
110+
.PHONY: $(SOURCE_DIST_FILES)
111+
112+
source-dist: $(SOURCE_DIST_FILES)
113+
@:
114+
115+
RSYNC ?= rsync
116+
RSYNC_V_0 =
117+
RSYNC_V_1 = -v
118+
RSYNC_V_2 = -v
119+
RSYNC_V = $(RSYNC_V_$(V))
120+
RSYNC_FLAGS += -a $(RSYNC_V) \
121+
--exclude '.sw?' --exclude '.*.sw?' \
122+
--exclude '*.beam' \
123+
--exclude '*.d' \
124+
--exclude '*.pyc' \
125+
--exclude '.git*' \
126+
--exclude '.hg*' \
127+
--exclude '.travis.yml' \
128+
--exclude '.*.plt' \
129+
--exclude '$(notdir $(ERLANG_MK_TMP))' \
130+
--exclude 'cover/' \
131+
--exclude 'deps/' \
132+
--exclude 'ebin/' \
133+
--exclude 'erl_crash.dump' \
134+
--exclude '$(notdir $(DEPS_DIR))/' \
135+
--exclude 'doc/' \
136+
--exclude 'hexer*' \
137+
--exclude 'logs/' \
138+
--exclude 'plugins/' \
139+
--exclude '$(notdir $(DIST_DIR))/' \
140+
--exclude 'test' \
141+
--exclude 'xrefr' \
142+
--exclude '/$(notdir $(PACKAGES_DIR))/' \
143+
--exclude '/PACKAGES/' \
144+
--delete \
145+
--delete-excluded
146+
147+
TAR ?= tar
148+
TAR_V_0 =
149+
TAR_V_1 = -v
150+
TAR_V_2 = -v
151+
TAR_V = $(TAR_V_$(V))
152+
153+
GZIP ?= gzip
154+
BZIP2 ?= bzip2
155+
XZ ?= xz
156+
157+
ZIP ?= zip
158+
ZIP_V_0 = -q
159+
ZIP_V_1 =
160+
ZIP_V_2 =
161+
ZIP_V = $(ZIP_V_$(V))
162+
163+
.PHONY: $(SOURCE_DIST)
164+
165+
$(SOURCE_DIST): $(ERLANG_MK_RECURSIVE_DEPS_LIST)
166+
$(verbose) mkdir -p $(dir $@)
167+
$(gen_verbose) $(RSYNC) $(RSYNC_FLAGS) ./ $@/
168+
$(verbose) echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" > $@/git-revisions.txt
169+
$(verbose) echo "$(PROJECT) $$(git rev-parse HEAD) $$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)" >> $@/git-revisions.txt
170+
$(verbose) for dep in $$(cat $(ERLANG_MK_RECURSIVE_DEPS_LIST) | grep -v '/$(PROJECT)$$' | LC_COLLATE=C sort); do \
171+
$(RSYNC) $(RSYNC_FLAGS) \
172+
$$dep \
173+
$@/deps; \
174+
if test -f $@/deps/$$(basename $$dep)/erlang.mk && \
175+
test "$$(wc -l $@/deps/$$(basename $$dep)/erlang.mk | awk '{print $$1;}')" = "1" && \
176+
grep -qs -E "^[[:blank:]]*include[[:blank:]]+(erlang\.mk|.*/erlang\.mk)$$" $@/deps/$$(basename $$dep)/erlang.mk; then \
177+
echo "include ../../erlang.mk" > $@/deps/$$(basename $$dep)/erlang.mk; \
178+
fi; \
179+
sed -E -i.bak "s|^[[:blank:]]*include[[:blank:]]+\.\./.*erlang.mk$$|include ../../erlang.mk|" \
180+
$@/deps/$$(basename $$dep)/Makefile && \
181+
rm $@/deps/$$(basename $$dep)/Makefile.bak; \
182+
(cd $$dep; echo "$$(basename "$$dep") $$(git rev-parse HEAD) $$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)") >> $@/git-revisions.txt; \
183+
done
184+
$(verbose) for file in $$(find $@ -name '*.app.src'); do \
185+
sed -E -i.bak \
186+
-e 's/[{]vsn[[:blank:]]*,[[:blank:]]*(""|"0.0.0")[[:blank:]]*}/{vsn, "$(PROJECT_VERSION)"}/' \
187+
$$file; \
188+
rm $$file.bak; \
189+
done
190+
$(verbose) rm $@/README.in
191+
$(verbose) cp README.in $@/README
192+
$(verbose) if test "$(BUILD_DOC)"; then cat "$(BUILD_DOC)" >> $@/README; fi
193+
194+
# TODO: Fix file timestamps to have reproducible source archives.
195+
# $(verbose) find $@ -not -name 'git-revisions.txt' -print0 | xargs -0 touch -r $@/git-revisions.txt
196+
197+
$(SOURCE_DIST).tar.gz: $(SOURCE_DIST)
198+
$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
199+
find $(notdir $(SOURCE_DIST)) -print0 | LC_COLLATE=C sort -z | \
200+
xargs -0 $(TAR) $(TAR_V) --no-recursion -cf - | \
201+
$(GZIP) --best > $@
202+
203+
$(SOURCE_DIST).tar.bz2: $(SOURCE_DIST)
204+
$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
205+
find $(notdir $(SOURCE_DIST)) -print0 | LC_COLLATE=C sort -z | \
206+
xargs -0 $(TAR) $(TAR_V) --no-recursion -cf - | \
207+
$(BZIP2) > $@
208+
209+
$(SOURCE_DIST).tar.xz: $(SOURCE_DIST)
210+
$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
211+
find $(notdir $(SOURCE_DIST)) -print0 | LC_COLLATE=C sort -z | \
212+
xargs -0 $(TAR) $(TAR_V) --no-recursion -cf - | \
213+
$(XZ) > $@
214+
215+
$(SOURCE_DIST).zip: $(SOURCE_DIST)
216+
$(verbose) rm -f $@
217+
$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
218+
find $(notdir $(SOURCE_DIST)) -print0 | LC_COLLATE=C sort -z | \
219+
xargs -0 $(ZIP) $(ZIP_V) $@
220+
221+
clean:: clean-source-dist
222+
223+
clean-source-dist:
224+
$(gen_verbose) rm -rf -- $(SOURCE_DIST_BASE)-*
225+
226+
package: dist
227+
cp $(DIST_DIR)/*.ez $(PACKAGES_DIR)

0 commit comments

Comments
 (0)