Skip to content

Commit

Permalink
Add a helper Makefile for common tasks
Browse files Browse the repository at this point in the history
It is ignored for git exports, because it uses git internally and is
mostly useful for developers, who will work with a git checkout anyway.
  • Loading branch information
carstene1ns committed May 25, 2015
1 parent b1e067e commit 64e3e38
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

# ignore Makefile for distribution archives
/Makefile export-ignore
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# distribution archives
easyrpg-rtp.zip
easyrpg-rtp.tar.gz
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

# helper variable
MYDIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

help:
@echo "This Makefile is intended to be used by developers only."
@echo "Therefore it does nothing by default. Available targets:"
@echo " optimize :"
@echo " -png : Recompresses png files with zopfli for smaller file size"
@echo " dist : "
@echo " -zip : Creates a distribution zip archive (for use under Windows)"
@echo " -tar : Creates a distribution tarball (for other platforms)"
@echo "The meta targets will execute all their subtargets."

dist: dist-tar dist-zip

dist-zip:
@rm -f easyrpg-rtp.zip
@git archive --prefix=EasyRPG-RTP/ -9 --output=$(MYDIR)/easyrpg-rtp.zip master

dist-tar:
@rm -f easyrpg-rtp.tar.gz
@git archive --prefix=EasyRPG-RTP/ --output=$(MYDIR)/easyrpg-rtp.tar.gz master

optimize: optimize-png

optimize-png:
find $(MYDIR) -iname "*.png" -execdir advpng -z4 {} \+

0 comments on commit 64e3e38

Please sign in to comment.