aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-05-26 08:53:46 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-05-26 12:16:31 +0200
commit708563c1642ec3130997136bab66adae10682202 (patch)
tree1408fbe25bbf5f062b28530d350b222af51d380d
parent6b288217b3bf2d4895aeb9be11f70c7bb56c4524 (diff)
downloadpacredir-708563c1642ec3130997136bab66adae10682202.tar.gz
pacredir-708563c1642ec3130997136bab66adae10682202.tar.zst
Makefile: convert all markdown files to html
-rw-r--r--.gitignore2
-rw-r--r--Makefile19
2 files changed, 12 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index cf170d5..bf69658 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,10 @@
*~
+*.html
*.o
arch
pacredir
config.h
avahi/pacserve.service
-README.html
version.h
pacredir-*.tar.xz
pacredir-*.tar.xz.asc
diff --git a/Makefile b/Makefile
index 152ebec..f4e28b5 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,10 @@ ID := $(shell shopt -u extglob && source /etc/os-release && echo $$ID)
# a release tarball...
VERSION := 0.4.3
-all: pacredir avahi/pacserve.service README.html
+MARKDOWN = $(wildcard *.md)
+HTML = $(MARKDOWN:.md=.html)
+
+all: pacredir avahi/pacserve.service $(HTML)
pacredir: pacredir.c pacredir.h config.h version.h
$(CC) pacredir.c $(CFLAGS) $(CFLAGS_EXTRA) $(LDFLAGS) -DREPRODUCIBLE=$(REPRODUCIBLE) -DARCH=\"$(ARCH)\" -DID=\"$(ID)\" -o pacredir
@@ -44,8 +47,8 @@ version.h: $(wildcard .git/HEAD .git/index .git/refs/tags/*) Makefile
avahi/pacserve.service: avahi/pacserve.service.in
$(SED) 's/%ARCH%/$(ARCH)/;s/%ID%/$(ID)/' avahi/pacserve.service.in > avahi/pacserve.service
-README.html: README.md
- $(MD) README.md > README.html
+%.html: %.md Makefile
+ markdown $< | sed 's/href="\([-[:alnum:]]*\)\.md"/href="\1.html"/g' > $@
install: install-bin install-doc
@@ -63,15 +66,15 @@ install-bin: pacredir avahi/pacserve.service
$(INSTALL) -D -m0644 dhcpcd/80-pacredir $(DESTDIR)$(PREFIX)/lib/dhcpcd/dhcpcd-hooks/80-pacredir
$(INSTALL) -D -m0755 networkmanager/80-pacredir $(DESTDIR)$(PREFIX)/lib/NetworkManager/dispatcher.d/80-pacredir
-install-doc: README.html
- $(INSTALL) -D -m0644 README.md $(DESTDIR)$(PREFIX)/share/doc/pacredir/README.md
- $(INSTALL) -D -m0644 README.html $(DESTDIR)$(PREFIX)/share/doc/pacredir/README.html
+install-doc: $(HTML)
+ $(INSTALL) -d -m0755 $(DESTDIR)$(PREFIX)/share/doc/pacredir/
+ $(INSTALL) -D -m0644 $(MARKDOWN) $(HTML) -t $(DESTDIR)$(PREFIX)/share/doc/pacredir/
clean:
- $(RM) -f *.o *~ pacredir avahi/pacserve.service README.html version.h
+ $(RM) -f *.o *~ pacredir avahi/pacserve.service $(HTML) version.h
distclean:
- $(RM) -f *.o *~ pacredir avahi/pacserve.service README.html version.h config.h
+ $(RM) -f *.o *~ pacredir avahi/pacserve.service $(HTML) version.h config.h
release:
git archive --format=tar.xz --prefix=pacredir-$(VERSION)/ $(VERSION) > pacredir-$(VERSION).tar.xz