VERSION := $(shell ./version-gen.sh dss version.c)
RM := rm -f
LSG := lopsubgen
+GZIP := gzip -fn9
units := dss str file exec sig daemon df tv snap ipc dss.lsg version
objs := $(addsuffix .o, $(units))
deps := $(addsuffix .d, $(units))
-all: dss dss.1
+all: dss dss.1.gz
man: dss.1
$(objs): dss.lsg.h Makefile
-include $(deps)
%.lsg.c: %.suite
$(call SAY, LSGC $<)
$(LSG) --gen-c=$@ < $<
-%.1: %.suite
+%.1.gz: %.suite
$(call SAY, LSGM $<)
- $(LSG) --gen-man=$@ --version-string=$(VERSION) < $<
-%.1.html: %.1
+ $(LSG) --gen-man=${@:.gz=} --version-string=$(VERSION) < $<
+ $(GZIP) ${@:.gz=}
+%.1.html: %.1.gz
$(call SAY, GROFF $<)
- groff -m man -Thtml -P -l -P -r $< | sed -e '1,/^<body>/d; /^<\/body>/,$$d' > $@
-
+ zcat $< | groff -m man -Thtml -P -l -P -r \
+ | sed -e '1,/^<body>/d; /^<\/body>/,$$d' > $@
clean:
$(call SAY, CLEAM)
- $(RM) *.[od] dss dss.1 *.html dss.lsg.[ch] version.c
+ $(RM) *.[od] dss dss.1.gz *.html dss.lsg.[ch] version.c
ifneq ($(findstring strip, $(MAKECMDGOALS)),)
strip_option := -s
install install-strip: all
$(MKDIR_P) $(bindir) $(mandir)
$(INSTALL_PROGRAM) $(strip_option) dss $(bindir)
- $(INSTALL_DATA) dss.1 $(mandir)
+ $(INSTALL_DATA) dss.1.gz $(mandir)
index.html: dss.1.html index.html.in INSTALL README NEWS
sed -e '/@README@/,$$d' index.html.in > $@