From a580d92e05cea89aef8d87d8aa6ac1ff2f449f62 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Sat, 18 Jan 2014 12:47:15 +0800 Subject: [PATCH] make dist should distribute all source, and accept tagname (so we can do 'make dist TAG=2.0-rc1' --- Makefile | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index cc3b015b..e015e4ac 100644 --- a/Makefile +++ b/Makefile @@ -172,28 +172,16 @@ clean: $(MAKE) -C bindings/ocaml clean $(MAKE) -C tests clean -CSVER=capstone-$(VERSION) + +TAG ?= HEAD +ifeq ($(TAG), HEAD) +DIST_VERSION = latest +else +DIST_VERSION = $(TAG) +endif + dist: - rm -rf $(CSVER) - git clone . $(CSVER) - rm -rf $(CSVER)/.git* -ifeq (,$(findstring mips,$(CAPSTONE_ARCHS))) - rm -rf $(CSVER)/arch/Mips -endif -ifeq (,$(findstring arm,$(CAPSTONE_ARCHS))) - rm -rf $(CSVER)/arch/ARM -endif -ifeq (,$(findstring powerpc,$(CAPSTONE_ARCHS))) - rm -rf $(CSVER)/arch/PowerPC -endif -ifeq (,$(findstring aarch64,$(CAPSTONE_ARCHS))) - rm -rf $(CSVER)/arch/AArch64 -endif -ifeq (,$(findstring x86,$(CAPSTONE_ARCHS))) - rm -rf $(CSVER)/arch/X86 -endif - tar czvf $(CSVER).tar.gz $(CSVER) - rm -rf $(CSVER) + git archive --format=tar.gz --prefix=capstone-$(DIST_VERSION)/ $(TAG) > capstone-$(DIST_VERSION).tar.gz .c.o: $(CC) $(CFLAGS) -c $< -o $@