2016-06-29 22:56:58 -04:00
|
|
|
.PHONY: all pdf release update-dates update-versions clean
|
2016-06-23 04:08:14 -04:00
|
|
|
|
|
|
|
# Constant declarations
|
|
|
|
PROGRAM_NAME = lemonbuddy
|
|
|
|
VERSION = $(shell git describe --tags)
|
2016-06-29 22:56:58 -04:00
|
|
|
DATE = $(shell date +%Y-%m-%d)
|
2016-06-23 04:08:14 -04:00
|
|
|
|
|
|
|
# Sources
|
|
|
|
MAN_SOURCES = $(wildcard *.1 *.5)
|
|
|
|
GZ_FILES = $(addsuffix .gz,$(MAN_SOURCES))
|
|
|
|
PS_FILES = $(addsuffix .ps,$(MAN_SOURCES))
|
|
|
|
PDF_TARGET = $(PROGRAM_NAME).pdf
|
|
|
|
|
|
|
|
# Targets
|
2016-06-29 22:56:58 -04:00
|
|
|
all: $(GZ_FILES)
|
2016-06-23 04:08:14 -04:00
|
|
|
pdf: $(PDF_TARGET)
|
2016-06-29 22:56:58 -04:00
|
|
|
release: clean update-dates update-versions
|
2016-06-23 04:08:14 -04:00
|
|
|
|
|
|
|
# Program targets
|
|
|
|
update-versions:
|
2016-06-29 22:56:58 -04:00
|
|
|
@sed -i '1 s/"$(PROGRAM_NAME) [^"]*"/"$(PROGRAM_NAME) $(VERSION)"/' $(MAN_SOURCES)
|
|
|
|
|
|
|
|
update-dates:
|
|
|
|
@sed -i '1 s/[0-9]{4}\-[0-9]{2}\-[0-9]{2}/$(DATE)/' $(MAN_SOURCES)
|
2016-06-23 04:08:14 -04:00
|
|
|
|
|
|
|
# Documentation targets
|
|
|
|
%.1.gz: %.1
|
|
|
|
@echo '[GZ] $(notdir $@)'
|
|
|
|
@gzip -c $< > $@
|
|
|
|
|
|
|
|
%.5.gz: %.5
|
|
|
|
@echo '[GZ] $(notdir $@)'
|
|
|
|
@gzip -c $< > $@
|
|
|
|
|
|
|
|
%.1.ps: %.1
|
|
|
|
@echo '[PS] $(notdir $@)'
|
|
|
|
@groff -Tps -mandoc $< > $@
|
|
|
|
|
|
|
|
%.5.ps: %.5
|
|
|
|
@echo '[PS] $(notdir $@)'
|
|
|
|
@groff -Tps -mandoc $< > $@
|
|
|
|
|
|
|
|
$(PDF_TARGET): $(PS_FILES)
|
|
|
|
@echo '[PDF] $(notdir $@)'
|
|
|
|
@gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
|
2016-06-29 22:56:58 -04:00
|
|
|
-sOutputFile=$@ $^
|
|
|
|
|
|
|
|
lemonbuddy: lemonbuddy.1
|
|
|
|
mandoc -a $<
|
|
|
|
|
|
|
|
lemonbuddy_wrapper: lemonbuddy_wrapper.1
|
|
|
|
mandoc -a $<
|
|
|
|
|
|
|
|
lemonbuddy_terminate: lemonbuddy_terminate.1
|
|
|
|
mandoc -a $<
|
|
|
|
|
|
|
|
lemonbuddy_config: lemonbuddy_config.5
|
|
|
|
mandoc -a $<
|
2016-06-23 04:08:14 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo '[CLEAN]'
|
|
|
|
@rm -f $(GZ_FILES) $(PS_FILES) $(PDF_TARGET)
|
|
|
|
|
2016-06-29 22:56:58 -04:00
|
|
|
# vim:ts=2 sw=2 noet nolist
|