From baa02de05f9e490b695e52b7c1233bfe392a0ce6 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Tue, 23 Jul 2013 13:28:49 +0200 Subject: [PATCH] Makefile: Add dist target. --- Makefile | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 610235c..b262b9e 100644 --- a/Makefile +++ b/Makefile @@ -24,15 +24,21 @@ # .PHONY: all test clean -CC = $(CROSS_COMPILE)gcc -AR = $(CROSS_COMPILE)ar -STRIP = $(CROSS_COMPILE)strip +#VERSION = $(shell git tag -l | tail -1) +VERSION ?= 1.0.0 +NAME = libuev +PKG = $(NAME)-$(VERSION) +ARCHIVE = $(PKG).tar.xz + +CC = $(CROSS)gcc +AR = $(CROSS)ar +STRIP = $(CROSS)strip CFLAGS += -fPIC -Os CPPFLAGS += -W -Wall -Iinclude ARFLAGS = crus JUNK = *~ *.bak *.map .*.d DEADJOE *.gdb *.elf core core.* -LIBNAME = libuev +LIBNAME = $(NAME) prefix ?= /usr/local libdir ?= $(prefix)/lib datadir ?= $(prefix)/share/doc/$(LIBNAME) @@ -103,6 +109,11 @@ clean: distclean: clean -@$(RM) $(DEPS) $(JUNK) +dist: + @echo "Building .xz tarball of $(PKG) in parent dir..." + git archive --format=tar --prefix=$(PKG)/ $(VERSION) | xz >../$(ARCHIVE) + @(cd ..; md5sum $(ARCHIVE) | tee $(ARCHIVE).md5) + # Include automatically generated rules ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),distclean)