Rules to generate and install Markdown

Markdown can be generated from .pod and .dbd.pod files.
Markdown will be generated and installed by "make inc".

Co-authored-by: Timo Korhonen <timo.korhonen@ess.eu>
Co-authored-by: Andrew Johnson <anj@anl.gov>
This commit is contained in:
Minijackson
2023-09-01 11:15:38 +02:00
committed by Andrew Johnson
parent c285f2a78f
commit 615ba73044
7 changed files with 42 additions and 7 deletions

View File

@ -486,4 +486,9 @@ COMMON_INC += $(filter $(COMMON_DIR)/%, \
$(foreach dir, $(ALL_SRC_DIRS), \
$(addsuffix /$(file), $(dir)))) $(COMMON_DIR)/$(file))))
COMMON_DOCS += $(filter $(COMMON_DIR)/%, \
$(foreach file, $(DOCS), \
$(firstword $(wildcard $(file) \
$(foreach dir, $(ALL_SRC_DIRS), \
$(addsuffix /$(file), $(dir)))) $(COMMON_DIR)/$(file))))
endif

View File

@ -197,7 +197,7 @@ endif
# build dependancies, clean rule
inc: $(COMMON_INC) $(INSTALL_INC) $(COMMON_DBDS) $(COMMON_DBDCATS) \
$(INSTALL_DBDS) $(INSTALL_DBD_INSTALLS)
$(INSTALL_DBDS) $(INSTALL_DBD_INSTALLS) $(COMMON_DOCS)
build: $(COMMON_DBS) $(INSTALL_DBS) \
$(DBDDEPENDS_FILES) $(TARGETS) \
@ -427,6 +427,26 @@ $(foreach file, $(DBD_INSTALLS), $(eval $(call DBD_INSTALLS_template, $(file))))
.PRECIOUS: $(COMMON_DBDS) $(COMMON_DIR)/%.dbd
#---------------------------------------------------------------
# Markdown files
$(COMMON_DIR)/%.md: %.dbd.pod $(DBDTOMD_pl)
@$(RM) $(notdir $@)
$(DBDTOMD) $(DBDFLAGS) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%.md: %.pod $(PODTOMD_pl)
@$(RM) $(notdir $@)
$(PODTOMD) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%.md: ../%.pl $(PODTOMD_pl)
@$(RM) $(notdir $@)
$(PODTOMD) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
.PRECIOUS: $(COMMON_DIR)/%.md
#---------------------------------------------------------------
# HTML files

View File

@ -22,7 +22,8 @@ vpath %.cpp $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.rc $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.h $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.hpp $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.html $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.html $(USR_VPATH) $(ALL_SRC_DIRS) $(COMMON_DIR)
vpath %.md $(USR_VPATH) $(ALL_SRC_DIRS) $(COMMON_DIR)
vpath %.skel.static $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.y $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.l $(USR_VPATH) $(ALL_SRC_DIRS)
@ -111,7 +112,7 @@ endif
#---------------------------------------------------------------
# Read dependency files
ifneq (inc,$(strip $(MAKECMDGOALS)))
ifneq ($(filter-out inc,$(strip $(MAKECMDGOALS))),)
ifneq (,$(strip $(HDEPENDS_FILES)))
$(filter-out $(wildcard *$(DEP)), $(HDEPENDS_FILES)): | $(COMMON_INC)
-include $(HDEPENDS_FILES)
@ -165,12 +166,12 @@ build: $(OBJSNAME) $(LIBTARGETS) $(PRODTARGETS) $(TESTPRODTARGETS) \
$(TARGETS) $(TESTSCRIPTS) $(INSTALL_LIB_INSTALLS)
inc: $(COMMON_INC) $(INSTALL_INC) $(INSTALL_CONFIGS) $(INSTALLS_CFG) \
$(INSTALL_HTMLS) $(INSTALLS_PERL_MODULES) $(INSTALL_SCRIPTS)
$(INSTALL_HTMLS) $(INSTALLS_PERL_MODULES) $(INSTALL_SCRIPTS) \
$(INSTALL_DOCS)
buildInstall: \
$(INSTALL_PROD) $(INSTALL_MUNCHS) \
$(INSTALL_TCLLIBS) $(INSTALL_TCLINDEX) \
$(INSTALL_DOCS) \
$(INSTALL_OBJS) \
$(INSTALL_TEMPLATE) \
$(INSTALL_BIN_INSTALLS)
@ -555,6 +556,10 @@ $(INSTALL_INCLUDE)/compiler/$(CMPLR_CLASS)/%: %
$(ECHO) "Installing compiler dependent include file $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
$(INSTALL_DOC)/%: $(COMMON_DIR)/%
$(ECHO) "Installing generated doc $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
$(INSTALL_DOC)/%: %
$(ECHO) "Installing doc $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(INSTALL_DOC)