diff --git a/Makefile b/Makefile index 8e4a2c7..8d28e30 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +PREFIX?=/usr/local +DATAROOT=$(PREFIX)/share +DATADIR=$(DATAROOT)/ascii-pony +BINDIR=$(PREFIX)/bin MAKEFILE=$(lastword $(MAKEFILE_LIST)) MAKEFILE_DIR=$(dir $(MAKEFILE)) @@ -15,8 +19,15 @@ OUT_ALL= $(OUT_COLOR) $(OUT_PLAIN) $(OUT_SVG) $(OUT_PNG) $(OUT_BASH) $(OUT_COLOR OUT_DIRS=$(sort $(dir $(OUT_ALL))) find_deps=$(subst ;,\\\;,$(wildcard $(PONY_DIR)/$(1)/*)) +INSTALL_DIR=cp -rf +INSTALL_FILE=cp -f +UNINSTALL_DIR=rm -rf +UNINSTALL_FILE=rm -f +REMOVE_DIR=$(foreach d, $(1), [ -d $(d) ] && rmdir $(d) || true;) +MAKE_DIR=mkdir -p + # NOTE: not .PONY :-P -.PHONY: all show show_deps clean list random +.PHONY: all show show_deps clean list random install uninstall all: $(OUT_ALL) @@ -63,7 +74,7 @@ $(1) : $(OUT_DIR)/png/$(1).png endef define dir_rule_template $(1) : - mkdir -p $(1) + $(MAKE_DIR) $(1) endef $(foreach pony,$(PONIES),$(eval $(call rule_template,$(pony)))) @@ -76,8 +87,8 @@ show_deps: @$(foreach d,$(call find_deps,$(PONY)), echo $(d);) clean: - rm -f $(OUT_ALL) - rmdir --ignore-fail-on-non-empty $(OUT_DIRS) $(OUT_DIR) + $(REMOVE_FILE) $(OUT_ALL) + $(call REMOVE_DIR, $(OUT_DIRS) $(OUT_DIR)) list: @$(foreach pony,$(PONIES), echo $(pony);) @@ -85,3 +96,20 @@ list: random: PONY=$(shell make -f $(MAKEFILE) list | shuf | head -n 1) random: @make --no-print-directory -f $(MAKEFILE) show PONY=$(PONY) + +$(DATADIR): + $(MAKE_DIR) $(DATADIR) + +$(BINDIR): + $(MAKE_DIR) $(BINDIR) + +install: $(OUT_ALL) +install: $(DATADIR) +install: $(BINDIR) + $(INSTALL_DIR) $(MAKEFILE_DIR)rendered $(DATADIR) + $(INSTALL_FILE) $(MAKEFILE_DIR)systempony $(BINDIR) + +uninstall: + $(UNINSTALL_DIR) $(DATADIR) + $(UNINSTALL_FILE) $(BINDIR)/systempony + $(call REMOVE_DIR, $(DATADIR) $(DATAROOT) $(BINDIR)) diff --git a/rendered/png/applejack-nohat.png b/rendered/png/applejack-nohat.png index 8218ff4..31941ef 100644 Binary files a/rendered/png/applejack-nohat.png and b/rendered/png/applejack-nohat.png differ diff --git a/rendered/png/applejack.png b/rendered/png/applejack.png index a96faf9..b506cc4 100644 Binary files a/rendered/png/applejack.png and b/rendered/png/applejack.png differ diff --git a/rendered/png/big-mac.png b/rendered/png/big-mac.png index 86308dc..85044af 100644 Binary files a/rendered/png/big-mac.png and b/rendered/png/big-mac.png differ diff --git a/rendered/png/celestia.png b/rendered/png/celestia.png index 36f6e55..2a89669 100644 Binary files a/rendered/png/celestia.png and b/rendered/png/celestia.png differ diff --git a/rendered/png/derpy.png b/rendered/png/derpy.png index afc10c4..382cc45 100644 Binary files a/rendered/png/derpy.png and b/rendered/png/derpy.png differ diff --git a/rendered/png/fluttershy.png b/rendered/png/fluttershy.png index 15856a1..1cf3cda 100644 Binary files a/rendered/png/fluttershy.png and b/rendered/png/fluttershy.png differ diff --git a/rendered/png/great-and-powerful.png b/rendered/png/great-and-powerful.png index 44835ca..985e6b4 100644 Binary files a/rendered/png/great-and-powerful.png and b/rendered/png/great-and-powerful.png differ diff --git a/rendered/png/luna.png b/rendered/png/luna.png index 59e91a1..448ff33 100644 Binary files a/rendered/png/luna.png and b/rendered/png/luna.png differ diff --git a/rendered/png/lyra.png b/rendered/png/lyra.png index 4282b3e..87d4a2e 100644 Binary files a/rendered/png/lyra.png and b/rendered/png/lyra.png differ diff --git a/rendered/png/pinkie-pie.png b/rendered/png/pinkie-pie.png index d7fbdbf..a9264b0 100644 Binary files a/rendered/png/pinkie-pie.png and b/rendered/png/pinkie-pie.png differ diff --git a/rendered/png/rainbow-dash.png b/rendered/png/rainbow-dash.png index 351f96b..5c3fa75 100644 Binary files a/rendered/png/rainbow-dash.png and b/rendered/png/rainbow-dash.png differ diff --git a/rendered/png/rainbow.png b/rendered/png/rainbow.png index 88747af..39b37ed 100644 Binary files a/rendered/png/rainbow.png and b/rendered/png/rainbow.png differ diff --git a/rendered/png/rarity.png b/rendered/png/rarity.png index 2da664a..ec6285a 100644 Binary files a/rendered/png/rarity.png and b/rendered/png/rarity.png differ diff --git a/rendered/png/rose.png b/rendered/png/rose.png index b9ed8f5..359b8b5 100644 Binary files a/rendered/png/rose.png and b/rendered/png/rose.png differ diff --git a/rendered/png/trixie-hat.png b/rendered/png/trixie-hat.png index 1309845..f683939 100644 Binary files a/rendered/png/trixie-hat.png and b/rendered/png/trixie-hat.png differ diff --git a/rendered/png/twilight-alicorn.png b/rendered/png/twilight-alicorn.png index c1de745..6c14e4f 100644 Binary files a/rendered/png/twilight-alicorn.png and b/rendered/png/twilight-alicorn.png differ diff --git a/rendered/png/twilight-unicorn.png b/rendered/png/twilight-unicorn.png index 6e92762..1c662dd 100644 Binary files a/rendered/png/twilight-unicorn.png and b/rendered/png/twilight-unicorn.png differ diff --git a/rendered/png/vinyl-scratch-glasses.png b/rendered/png/vinyl-scratch-glasses.png index 6bcec2d..3c920a4 100644 Binary files a/rendered/png/vinyl-scratch-glasses.png and b/rendered/png/vinyl-scratch-glasses.png differ diff --git a/rendered/png/vinyl-scratch-noglasses.png b/rendered/png/vinyl-scratch-noglasses.png index 2d3aa38..33117ab 100644 Binary files a/rendered/png/vinyl-scratch-noglasses.png and b/rendered/png/vinyl-scratch-noglasses.png differ diff --git a/systempony.sh b/systempony similarity index 98% rename from systempony.sh rename to systempony index 31a94e8..50c7adb 100755 --- a/systempony.sh +++ b/systempony @@ -193,7 +193,7 @@ done SELFDIR=$(dirname $(readlink -se "${BASH_SOURCE[0]}")) ponydir="$SELFDIR/rendered/ansi/" -[ ! -d "$ponydir" ] && ponydir="$SELFDIR/../share/systempony/rendered/ansi/" +[ ! -d "$ponydir" ] && ponydir="$SELFDIR/../share/ascii-pony/rendered/ansi/" ponyfile="$ponydir/$PONY.colored.txt" if [ -f "$ponyfile" ]