diff --git a/Makefile b/Makefile new file mode 100644 --- /dev/null +++ b/Makefile @@ -0,0 +1,101 @@ +# -*- makefile -*- + +top_srcdir = . +srcdir = . + +SUDOERS_D = /etc/sudoers.d + +base_dir=$(shell pwd) + +SUBDIRS = doc + +INPUTS = +TXTS = +HTML_TXTS = +EXTRA_DIST = +CLEANFILES = + +INPUTS += .htaccess.in +INPUTS += lib/ws-vacation-sudo.in +INPUTS += lib/ws-vacation.conf.in + +TARGETS = $(patsubst %.in,%,$(INPUTS)) +CLEANFILES += $(TARGETS) + +TXT_PDFS = $(patsubst %.txt,%.pdf,$(TXTS)) +TXT_HTMLS = $(patsubst %.txt,%.html,$(TXTS)) $(patsubst %.txt,%.html,$(HTML_TXTS)) +CLEANFILES += $(TXT_PDFS) +CLEANFILES += $(TXT_HTMLS) + +SNIPPETS = ./lib/snippets.pl + +DISTFILES = +DISTFILES += Makefile +DISTFILES += $(INPUTS) +DISTFILES += $(TARGETS) +DISTFILES += $(TXTS) +DISTFILES += $(TXT_PDFS) +DISTFILES += $(TXT_HTMLS) +DISTFILES += $(EXTRA_DIST) + +%: %.in + cat $< | $(SNIPPETS) --process --replace --mode text --key base_dir --value $(base_dir) --cat - >$@ + test -s $@ || ( rm -f $@ && test 1 = 0 ) + +%.pdf: %.txt + cd doc && $(MAKE) ../$@ + +%.html: %.txt + cd doc && $(MAKE) ../$@ + +default: all + +all: $(DISTFILES) all-local + +all-local: doc + +.PHONY: doc +doc: + ( cd doc && $(MAKE) ) + +clean: clean-local + test -z '$(CLEANFILES)' || rm -rf $(CLEANFILES) + +clean-local: + ( cd doc && $(MAKE) clean ) + + +install: all + mkdir -p $(SUDOERS_D) + +dist: + +tags-rc: + gen_tags.sh --template +tags: + gen_tags.sh --force + +# |:here:| +# :ide-menu: Emacs IDE Main Menu - Buffer @BUFFER@ +# . M-x `eIDE-menu' ()(eIDE-menu "z") + +# :ide: COMPILE: tags +# . (let ((args "tags")) (compile (concat "make -k " args))) + +# :ide: COMPILE: dist +# . (let ((args "dist")) (compile (concat "make -k " args))) + +# :ide: COMPILE: install +# . (let ((args "install")) (compile (concat "make -k " args))) + +# :ide: COMPILE: clean +# . (let ((args "clean")) (compile (concat "make -k " args))) + +# :ide: COMPILE: Standard +# . (let ((args "")) (compile (concat "make -k " args))) +# +# Local Variables: +# mode: makefile +# snip-mode: makefile-gmake +# truncate-lines: t +# End: