changeset 22:b18c70b2a6ca

add dist target to Makefile
author Guido Berhoerster <guido@berhoerster.name>
date Sat, 22 Oct 2011 10:15:09 +0200
parents 6b7f2c8b90ec
children 6d0f1f6c22e8
files Makefile
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Oct 20 15:51:12 2011 +0200
+++ b/Makefile	Sat Oct 22 10:15:09 2011 +0200
@@ -1,6 +1,8 @@
 INSTALL :=	install
 INSTALL.exec :=	$(INSTALL) -D -m 0755
 INSTALL.data :=	$(INSTALL) -D -m 0644
+TAR :=		tar
+GZIP :=		gzip
 SED :=		sed
 MSGFMT :=	msgfmt
 INTLTOOL_UPDATE :=	intltool-update
@@ -18,6 +20,7 @@
 PACKAGE =	pk-update-icon
 APP_NAME =	org.opensuse.pk-update-icon
 VERSION =	0.1
+DISTNAME :=	$(PACKAGE)-$(VERSION)
 OBJS =		main.o pkui-icon.o pkui-backend.o
 AUTOSTART_FILE =	$(PACKAGE).desktop
 MOFILES :=	$(patsubst %.po,%.mo,$(wildcard po/*.po))
@@ -32,7 +35,7 @@
 
 .DEFAULT_TARGET = all
 
-.PHONY: all clean clobber install
+.PHONY: all clean clobber dist install
 
 all: $(PACKAGE) $(MOFILES) $(AUTOSTART_FILE)
 
@@ -80,4 +83,9 @@
 clobber: clean
 	rm -f *.P
 
+dist: clobber
+	rm -f $(DISTNAME)
+	ln -s -f . $(DISTNAME)
+	$(TAR) cv $(DISTNAME)/* | $(GZIP) > $(DISTNAME).tar.gz
+
 -include $(patsubst %.o,%.P,$(OBJS))