summaryrefslogtreecommitdiff
path: root/makefiles/dist.mk
blob: 01464da30083c241f7b782f49f276ba757998e0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# creates distribution tarball
#
# requires:
# - PACKAGE_NAME
# - PACKAGE_VERSION
#
# provides:
# - target 'dist'

.PHONY: dist
dist: distclean
	test -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar || rm -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar
	test -d /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION) || rm -rf /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
	find . -type f | grep -v .svn | \
		xargs tar cf /tmp/pre
	mkdir /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
	cd /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION) && \
		tar xf ../pre && rm -f ../pre && cd .. && \
		tar cvf /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar $(PACKAGE_NAME)-$(PACKAGE_VERSION)
	rm -rf /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
	mv -f /tmp/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar .