Mercurial > utils
view misc/Makefile @ 650:0c73b52edf9a
Unified scripts names.
author | Oleksandr Gavenko <gavenkoa@gmail.com> |
---|---|
date | Tue, 26 Feb 2019 10:29:25 +0200 |
parents | cffd91855f61 |
children | 2503f7226fe1 |
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: # Delete target file if command fails. .DELETE_ON_ERROR: # Default target. .DEFAULT_GOAL = all ################################################################ # Platform definition. uname-s := $(shell uname -s) build_os = unix ifneq '' '$(filter MINGW%,$(uname-s))' build_os = mingw endif ifneq '' '$(filter CYGWIN%,$(uname-s))' build_os = cygwin endif ifeq 'SunOS' '$(uname-s)' build_os = solaris endif ################################################################ # Path definitions. ifeq '' '$(prefix)' ifneq '' '$(HOME)' prefix = $(HOME)/usr else $(error HOME env var and prefix var are not set!) endif endif bindir = $(prefix)/bin ################################################################ # Build toolchain definitions. INSTALL_PROGRAM := install -m 755 INSTALL_DATA := install -m 644 ifeq 'solaris' '$(build_os)' INSTALL_PROGRAM := ginstall -m 755 INSTALL_DATA := ginstall -m 644 endif ################################################################ # Files definitions. FILES = trac-digest.sh find-ext.sh line-count.sh $(wildcard cleanupdoc-*.sh) mymake.sh my-term-ascii my-term-colors my-term-strip-ansi ################################################################ # Build targets. .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_PROGRAM) $$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: