Makefile 850 Bytes
SUBCOMMANDS = random \
	      rand_printable \
	      amngrdbinit \
	      amngrdbdestroy \
	      amngradd \
	      amngrcreate \
	      amngrcrypt \
	      amngrdelete \
	      amngrgen \
	      amngrgetoldpass \
	      amngrgetolduser \
	      amngrgetpass \
	      amngrgetuser \
	      amngrid \
	      amngrlist \
	      amngrrename \
	      amngrsearch

PREFIX ?= /usr
DESTDIR ?=

export PREFIX DESTDIR

PROGRAM := accountmanager.sh

all: doc

.PHONY: clean install doc

doc:
	make -C doc

install_doc: doc
	make -C doc install

install_$(PROGRAM):
	@install -D "$(PROGRAM)" "$(DESTDIR)/$(PREFIX)/bin/$(PROGRAM)"

install_%:
	@ln -s "$(realpath ${DESTDIR}/${PREFIX}/bin/$(PROGRAM))" \
		"${DESTDIR}/$(PREFIX)/bin/$(subst install_,,$@)"

install: install_$(PROGRAM) $(patsubst %,install_%,$(SUBCOMMANDS)) install_doc

clean:
	make -C doc clean