From 1b90301ac84a07d1ac8965e39c59f1453d8328d4 Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Thu, 23 Jan 2014 22:30:54 -0600 Subject: [PATCH] Added a makefile (just makes the .zip for now) --- Makefile | 22 ++++++++++++++++++++++ make-zip.sh | 9 --------- 2 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 Makefile delete mode 100755 make-zip.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1275bd2 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +#!/usr/bin/make -f + +SHELL = /bin/sh +.SUFFIXES: # We don't use suffixes for this Makefile +.DELETE_ON_ERROR: # We want make to delete partially-created targets +VERSION := $(shell grep '^\#\# Version: ' WeightsWatcher.toc | sed -e 's/.* //') +OUTPUT_FILENAME := "WeightsWatcher-$(VERSION).zip" +EXCLUDED_FILES = .git* Todo* *~ *.sh gem-ids* create-* Makefile +EXCLUDE_PATTERNS = $(foreach str,$(EXCLUDED_FILES),-xr!'$(str)') + + +.PHONY: clean +clean: + +.PHONY: distclean +distclean: + -rm -f ../$(OUTPUT_FILENAME) + +.PHONY: dist +dist: + @[ -f ../$(OUTPUT_FILENAME) ] || exit 0 && echo "Output file $(OUTPUT_FILENAME) exists! Aborting..." && exit 1 + cd .. && 7z a -tzip $(EXCLUDE_PATTERNS) -mx=9 $(OUTPUT_FILENAME) WeightsWatcher/ diff --git a/make-zip.sh b/make-zip.sh deleted file mode 100755 index 4e6bedd..0000000 --- a/make-zip.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -VERSION="`grep '^## Version: ' WeightsWatcher.toc | sed -e 's/.* //'`" - -## Debug code -# echo "'$VERSION'" -# exit - -cd .. && 7z a -tzip -xr!'.git*' -xr!'Todo*' -xr!'*~' -xr-!'WeightsWatcher/goals' -xr-!'WeightsWatcher/future-features' -xr-!'WeightsWatcher/wowhead values' -xr-!'WeightsWatcher/localization notes' -xr-!'WeightsWatcher/*.sh' -xr-!'WeightsWatcher/gem-ids*' -xr-!'WeightsWatcher/create-*' -mx=9 WeightsWatcher-$VERSION.zip WeightsWatcher/ -- 1.7.9.5