2016-10-18 16:40:47 +00:00
|
|
|
.PHONY: all release update-dates update-versions clean
|
2016-06-23 08:08:14 +00:00
|
|
|
|
|
|
|
# Constant declarations
|
2016-11-19 05:22:44 +00:00
|
|
|
PROGRAM_NAME = polybar
|
2016-06-23 08:08:14 +00:00
|
|
|
VERSION = $(shell git describe --tags)
|
2016-06-30 02:56:58 +00:00
|
|
|
DATE = $(shell date +%Y-%m-%d)
|
2016-06-23 08:08:14 +00:00
|
|
|
|
|
|
|
# Sources
|
|
|
|
MAN_SOURCES = $(wildcard *.1 *.5)
|
|
|
|
GZ_FILES = $(addsuffix .gz,$(MAN_SOURCES))
|
|
|
|
# Targets
|
2016-06-30 02:56:58 +00:00
|
|
|
all: $(GZ_FILES)
|
|
|
|
release: clean update-dates update-versions
|
2016-06-23 08:08:14 +00:00
|
|
|
|
|
|
|
# Program targets
|
|
|
|
update-versions:
|
2016-06-30 02:56:58 +00: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 08:08:14 +00:00
|
|
|
|
|
|
|
# Documentation targets
|
|
|
|
%.1.gz: %.1
|
|
|
|
@echo '[GZ] $(notdir $@)'
|
|
|
|
@gzip -c $< > $@
|
|
|
|
|
|
|
|
%.5.gz: %.5
|
|
|
|
@echo '[GZ] $(notdir $@)'
|
|
|
|
@gzip -c $< > $@
|
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
polybar: polybar.1
|
2016-06-30 02:56:58 +00:00
|
|
|
mandoc -a $<
|
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
polybar_config: polybar_config.5
|
2016-06-30 02:56:58 +00:00
|
|
|
mandoc -a $<
|
2016-06-23 08:08:14 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo '[CLEAN]'
|
2016-10-18 16:40:47 +00:00
|
|
|
@rm -f $(GZ_FILES)
|
2016-06-23 08:08:14 +00:00
|
|
|
|
2016-06-30 02:56:58 +00:00
|
|
|
# vim:ts=2 sw=2 noet nolist
|