Welcome to little lamb

Code » comain » commit 6ce13cc

Install BLD_DOCS into SHAREDIR/xpln

author Olivier Brunel
2023-07-18 12:27:14 UTC
committer Olivier Brunel
2023-07-18 16:29:11 UTC
parent c57e4bb8782d421cf1b510792d0eb71482220915

Install BLD_DOCS into SHAREDIR/xpln

common.mk +6 -8
configure +1 -1

diff --git a/common.mk b/common.mk
index dd339fd..9b1b655 100644
--- a/common.mk
+++ b/common.mk
@@ -33,7 +33,7 @@ PRIV_LIBS =
 PRIV_STATIC_LIBS = $(PRIV_LIBS:%=lib%.a)
 PRIV_SHARED_LIBS = $(PRIV_LIBS:%=lib%.so)
 PRIV_BINS =
-DOCS = README COPYING $(BLD_DOCS)
+DOCS = README COPYING
 DATA =
 
 # to be removed upon `make clean`
@@ -114,6 +114,9 @@ lib%.so:
 		-o $@ \
 		$^
 
+DESTMD = $(DESTDIR)$(SHAREDIR)/xpln
+INSTMD = $(_INST) if test -h $<; then cp -P $< $@; else install -D -m 644 $< $@; fi
+
 DESTDOC = $(DESTDIR)$(SHAREDIR)/doc/$(PROJECT_NAME)
 INSTDOC = $(_INST) install -D -m 644 $< $@
 
@@ -153,12 +156,6 @@ $(DESTDIR)$(SHAREDIR)/doc/$(PROJECT_NAME)/README:
 $(DESTDOC)/%: % | dummy%
 	$(INSTDOC)
 
-#$(DESTDOC)/0/%: build/doc/%
-#	$(INSTDOC)
-
-#$(DESTDOC)/3/escall_fmt.3.md: build/doc/esc.h/escall_fmt.3.md
-#	$(INSTDOC)
-
 # install *.md documentation
 $(DESTDIR)$(SHAREDIR)/doc/$(PROJECT_NAME)/md/%.md: build/doc/%.md | dummy%
 	$(_INST) install -D -m 644 $< $@
@@ -183,7 +180,8 @@ install-priv: $(PRIV_STATIC_LIBS:%=$(DESTDIR)$(LIBDIR)/$(PROJECT_NAME)/%) \
 	$(PRIV_SHARED_LIBS:%=$(DESTDIR)$(LIBDIR)/$(PROJECT_NAME)/%) \
 	$(PRIV_BINS:%=$(DESTDIR)$(LIBDIR)/$(PROJECT_NAME)/%)
 
-install-docs: $(DOCS:%=$(DESTDIR)$(SHAREDIR)/doc/$(PROJECT_NAME)/%)
+install-docs: $(DOCS:%=$(DESTDIR)$(SHAREDIR)/doc/$(PROJECT_NAME)/%) \
+	$(BLD_DOCS:%=$(DESTMD)/%)
 
 install-data: $(DATA) $(DATA:build/%=$(DESTDIR)$(SHAREDIR)/$(PROJECT_NAME)/%)
 
diff --git a/configure b/configure
index 2f0daa6..3492174 100755
--- a/configure
+++ b/configure
@@ -882,7 +882,7 @@ setupobjs()
                 | sed -e 's/^src\/doc.*\/\(.\+\.\(.\)\.md\)$/\2\/\1/g' \
                 | tr '\n' ' ' | sed -e 's/ \+/ /g')"$'\n'"$BLD_DOCS"
             BLD_DOCS="$(echo "$objs" \
-                | sed -e 's/^src\/doc\(.*\)\/\(.\+\.\(.\)\.md\)$/\$(DESTDOC)\/\3\/\2: build\/doc\1\/\2\n	$(INSTDOC)/g' \
+                | sed -e 's/^src\/doc\(.*\)\/\(.\+\.\(.\)\.md\)$/\$(DESTMD)\/\3\/\2: build\/doc\1\/\2\n	$(INSTMD)/g' \
                 )"$'\n'"$BLD_DOCS"
             continue
         fi