Skip to content

Commit

Permalink
First draft of gw2dmk.1, dmk2gw.1 and gwhist.1 man pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
qbarnes committed Jan 30, 2025
1 parent 6bd23b8 commit c732d15
Show file tree
Hide file tree
Showing 4 changed files with 1,568 additions and 3 deletions.
29 changes: 26 additions & 3 deletions Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ ifdef E
LDLIBS += -static -lregex
endif

nroff ?= nroff
groff ?= groff

nroff_txt_flags ?= -c
groff_pdf_flags ?=

build_dir ?= build

ifndef top_dir
Expand All @@ -29,10 +35,17 @@ vpath % $(top_dir)
obj_targets = gw2dmk.o dmk2gw.o gw.o gwx.o msg.o m2.o gwhisto.o \
gwhist.o gwdetect.o crc.o

targets = gw2dmk$E dmk2gw$E gwhist$E m2$E
bins = gw2dmk dmk2gw gwhist
bin_targets = $(foreach b,$(bins), $b$E)

man_txt_targets = $(foreach b,$(bins),$b.1.txt)
man_pdf_targets = $(foreach b,$(bins),$b.1.pdf)
man_html_targets = $(foreach b,$(bins),$b.1.html)
man_targets = $(man_txt_targets) $(man_pdf_targets) $(man_html_targets)

targets = $(bin_targets) $(man_targets)

#tar_files = LICENSE README.md $(targets) $(tar_extras)
tar_files = LICENSE README.md gw2dmk$E dmk2gw$E gwhist$E $(tar_extras)
tar_files = LICENSE README.md $(targets) $(tar_extras)

clean_files = $(targets) $(obj_targets)

Expand Down Expand Up @@ -90,6 +103,16 @@ gwhist$E: msg.o gw.o gwx.o gwhisto.o gwdetect.o gwhist.o
m2$E: msg.o m2.o gw.o gwx.o
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o '$@'

%.txt: %
$(nroff) -man -Tascii $(nroff_txt_flags) $< | col -b | cat -s > $@

%.pdf: %
$(groff) -man -Tpdf $(groff_pdf_flags) $< > $@

%.html: %
$(groff) -man -Thtml $(groff_html_flags) $< > $@


$(TARBALLGZ): $(tar_files)
tar -czP \
--transform='s:^$(top_dir)/::' \
Expand Down
Loading

0 comments on commit c732d15

Please sign in to comment.