view misc/Makefile @ 406:c22f35ecdb92

my-ascii.sh
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Sun, 18 Sep 2011 02:02:42 +0300
parents f742a1651d21
children 41c5dab96724
line wrap: on
line source

SHELL = /bin/sh

# Disable built in pattern rules.
MAKEFLAGS += -r
# Disable built in variables.
MAKEFLAGS += -R
# Disable built in suffix rules.
.SUFFIXES:
# Default target.
.DEFAULT_GOAL = all

ifeq '' '$(prefix)'
  ifneq '' '$(HOME)'
    prefix = $(HOME)/usr
  else
    $(error HOME env var and prefix var are not set!)
  endif
endif

bindir = $(prefix)/bin

FILES = trac-digest.sh find-ext.sh line-count.sh $(wildcard cleanupdoc-*.sh) mymake.sh my-ascii.sh

.PHONY: all
all:

.PHONY: check
check:

.PHONY: install
install:
	[ -d $(bindir) ] || mkdir -p $(bindir)
	for file in $(FILES); do \
		filenoext=$${file%.sh}; \
		filenoext=$${filenoext%.py}; \
		install -m 755 $$file $(bindir)/$$filenoext; \
	done

.PHONY: uninstall
uninstall:
	for file in $(FILES); do \
		filenoext=$${file%.sh}; \
		filenoext=$${filenoext%.py}; \
		[ -e $(bindir)/$$file ] && if rm $(bindir)/$$file; then :; else echo Unable to delete $(bindir)/$$file; exit 1; fi || :; \
		[ -e $(bindir)/$$filenoext ] && if rm $(bindir)/$$filenoext; then :; else echo Unable to delete $(bindir)/$$filenoext; exit 1; fi || :; \
	done

.PHONY: distclean
distclean: clean

.PHONY: clean
clean: