openwrt/tools/lz4/patches/001-add-make-ENABLE_DOCS-configurable.patch
Christian Marangi 28bf0137b4
tools: refresh all patches
Refresh all tools patches now that tools/refresh correctly works.

CI now checks for them and actively complain if tools have unrefreshed
patches.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-05-22 12:41:10 +02:00

61 lines
1.7 KiB
Diff

--- a/programs/Makefile
+++ b/programs/Makefile
@@ -66,6 +66,7 @@ LZ4_VERSION=$(LIBVER)
MD2ROFF = ronn
MD2ROFF_FLAGS = --roff --warnings --manual="User Commands" --organization="lz4 $(LZ4_VERSION)"
+ENABLE_DOCS ?= 1
default: lz4-release
@@ -120,6 +121,7 @@ lz4c32: CFLAGS += -m32
lz4c32 : $(SRCFILES)
$(CC) $(FLAGS) $^ -o $@$(EXT)
+ifeq ($(ENABLE_DOCS),1)
lz4.1: lz4.1.md $(LIBVER_SRC)
cat $< | $(MD2ROFF) $(MD2ROFF_FLAGS) | $(SED) -n '/^\.\\\".*/!p' > $@
@@ -130,6 +132,7 @@ clean-man:
preview-man: clean-man man
man ./lz4.1
+endif
clean:
ifeq ($(WINBASED),yes)
@@ -172,16 +175,19 @@ man1dir ?= $(MAN1DIR)
install: lz4
@echo Installing binaries in $(DESTDIR)$(bindir)
- $(INSTALL_DIR) $(DESTDIR)$(bindir)/ $(DESTDIR)$(man1dir)/
+ $(INSTALL_DIR) $(DESTDIR)$(bindir)/
$(INSTALL_PROGRAM) lz4$(EXT) $(DESTDIR)$(bindir)/lz4$(EXT)
$(LN_SF) lz4$(EXT) $(DESTDIR)$(bindir)/lz4c$(EXT)
$(LN_SF) lz4$(EXT) $(DESTDIR)$(bindir)/lz4cat$(EXT)
$(LN_SF) lz4$(EXT) $(DESTDIR)$(bindir)/unlz4$(EXT)
+ifeq ($(ENABLE_DOCS),1)
@echo Installing man pages in $(DESTDIR)$(man1dir)
+ $(INSTALL_DIR) $(DESTDIR)$(man1dir)/
$(INSTALL_DATA) lz4.1 $(DESTDIR)$(man1dir)/lz4.1
$(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/lz4c.1
$(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/lz4cat.1
$(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/unlz4.1
+endif
@echo lz4 installation completed
uninstall:
@@ -189,10 +195,12 @@ uninstall:
$(RM) $(DESTDIR)$(bindir)/unlz4$(EXT)
$(RM) $(DESTDIR)$(bindir)/lz4$(EXT)
$(RM) $(DESTDIR)$(bindir)/lz4c$(EXT)
+ifeq ($(ENABLE_DOCS),1)
$(RM) $(DESTDIR)$(man1dir)/lz4.1
$(RM) $(DESTDIR)$(man1dir)/lz4c.1
$(RM) $(DESTDIR)$(man1dir)/lz4cat.1
$(RM) $(DESTDIR)$(man1dir)/unlz4.1
+endif
@echo lz4 programs successfully uninstalled
endif