Add 'make dist' target
authorJeremy Kerr <jk@ozlabs.org>
Mon, 2 Apr 2007 04:03:06 +0000 (14:03 +1000)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 2 Apr 2007 04:03:06 +0000 (14:03 +1000)
Add a make dist target to create a petitboot tarball.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Makefile

index a9ae25c09fb65f187fdc6e5adeb5d1736ad41a3b..64a8c46e630bc8fbc759a20a3a30dfa2957d4089 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,6 @@
 PREFIX?=/usr
 PREFIX?=/usr
+VERSION=0.0.1
+PACKAGE=petitboot
 CC=gcc
 INSTALL=install
 TWIN_CFLAGS=$(shell pkg-config --cflags libtwin)
 CC=gcc
 INSTALL=install
 TWIN_CFLAGS=$(shell pkg-config --cflags libtwin)
@@ -31,6 +33,18 @@ install: all
        $(INSTALL) -t $(PREFIX)/share/petitboot/artwork/ \
                $(foreach a,$(ARTWORK),artwork/$(a))
 
        $(INSTALL) -t $(PREFIX)/share/petitboot/artwork/ \
                $(foreach a,$(ARTWORK),artwork/$(a))
 
+dist:  $(PACKAGE)-$(VERSION).tar.gz
+
+$(PACKAGE)-$(VERSION).tar.gz: $(PACKAGE)-$(VERSION)
+       tar czvf $@ $^
+
+$(PACKAGE)-$(VERSION): clean
+       mkdir $@ $@/devices
+       cp -a artwork $@
+       cp *.[ch] $@
+       cp -a devices/*.[ch] $@/devices/
+       cp Makefile $@
+
 clean:
        rm -f petitboot
        rm -f udev-helper
 clean:
        rm -f petitboot
        rm -f udev-helper