Add 'manpages' as new target to generate manpages by help2man

* Makefile: `make manpages` generates the manpages.
* Makefile: `make clean` purges the generated manpages.
* .gitignore: Add generated manpages files.
* README.md: Add description how to make manpages for Linux.

Signed-off-by: Roger Shimizu <rosh@debian.org>
This commit is contained in:
Roger Shimizu
2025-09-13 23:14:16 -07:00
committed by Bjorn Andersson
parent d164eb0ab5
commit 0a3c1175bd
3 changed files with 16 additions and 0 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
*.1
*.o
qdl
qdl-ramdump

View File

@@ -26,6 +26,8 @@ CHECKPATCH_SP_URL := $(CHECKPATCH_ROOT)/spelling.txt
CHECKPATCH := ./.scripts/checkpatch.pl
CHECKPATCH_SP := ./.scripts/spelling.txt
MANPAGES := ks.1 qdl-ramdump.1 qdl.1
default: $(QDL) $(RAMDUMP) $(KS_OUT)
$(QDL): $(QDL_OBJS)
@@ -40,6 +42,11 @@ $(KS_OUT): $(KS_OBJS)
compile_commands.json: $(QDL_SRCS) $(KS_SRCS)
@echo -n $^ | jq -snR "[inputs|split(\" \")[]|{directory:\"$(PWD)\", command: \"$(CC) $(CFLAGS) -c \(.)\", file:.}]" > $@
manpages: $(KS_OUT) $(RAMDUMP) $(QDL)
help2man -N -n "KS" -o ks.1 ./ks
help2man -N -n "Qualcomm Download" -o qdl.1 ./qdl
help2man -N -n "Qualcomm Download Ramdump" -o qdl-ramdump.1 ./qdl-ramdump
version.h::
@echo "#define VERSION \"$(VERSION)\"" > .version.h
@cmp -s .version.h version.h || cp .version.h version.h
@@ -50,6 +57,7 @@ clean:
rm -f $(QDL) $(QDL_OBJS)
rm -f $(RAMDUMP) $(RAMDUMP_OBJS)
rm -f $(KS_OUT) $(KS_OBJS)
rm -f $(MANPAGES)
rm -f compile_commands.json
rm -f version.h .version.h
rm -f $(CHECKPATCH)

View File

@@ -15,6 +15,13 @@ sudo apt install libxml2 libusb-1.0-0-dev
make
```
Manpages can be built separately:
```bash
sudo apt install help2man
make manpages
```
### MacOS
For Homebrew users,