From d813466fadaced2c4c75e8d8a57bc9dc60b0a8f4 Mon Sep 17 00:00:00 2001 From: Thomas Harning Jr Date: Tue, 5 Jul 2011 22:23:15 -0400 Subject: base: adds distribution archive generation functionality to Makefile --- Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c04dc89..611d705 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +.PHONY: all install clean dist dist-all dist-bzip2 dist-gzip dist-zip + +DIST_DIR=dist + # Utilities INSTALL = install INSTALL_PROGRAM = $(INSTALL) @@ -20,6 +24,19 @@ all: $(CC) $(CFLAGS) -c -Iinclude -I$(LUA_INC_DIR) src/*.c $(CC) $(LDFLAGS) -o $(LIB) *.o -levent +dist dist-all: distdir dist-bzip2 dist-gzip dist-zip + +distdir: + mkdir -p $(DIST_DIR) + +VERSION=luaevent-$(shell git describe --abbrev=4 HEAD 2>/dev/null) +dist-bzip2: distdir + git archive --format=tar --prefix=$(VERSION)/ HEAD | bzip2 -9v > $(DIST_DIR)/$(VERSION).tar.bz2 +dist-gzip: distdir + git archive --format=tar --prefix=$(VERSION)/ HEAD | gzip -9v > $(DIST_DIR)/$(VERSION).tar.gz +dist-zip: distdir + git archive --format=zip --prefix=$(VERSION)/ HEAD > $(DIST_DIR)/$(VERSION).zip + install: all mkdir -p $(DESTDIR)$(INSTALL_DIR_LUA) $(INSTALL_DATA) lua/luaevent.lua $(DESTDIR)$(INSTALL_DIR_LUA)/luaevent.lua -- cgit v1.2.3