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

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
/lib/
/db/
/dbd/
/doc/
/html/
/include/
/templates/

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)

View File

@ -38,7 +38,7 @@ ifeq ($(wildcard $(PERL_h)),)
endif
endif
ifneq (inc,$(strip $(MAKECMDGOALS)))
ifneq ($(filter-out inc,$(strip $(MAKECMDGOALS))),)
ifeq ($(T_A),$(EPICS_HOST_ARCH)) # No cross-builds (wrong Perl!)
ifeq ($(strip $(XSUBPP)),)
$(warning Perl's xsubpp program was not found.)

View File

@ -20,7 +20,7 @@ BPT_DBD += bptTypeJdegF.dbd
BPT_DBD += bptTypeKdegC.dbd
BPT_DBD += bptTypeKdegF.dbd
ifneq (inc,$(strip $(MAKECMDGOALS)))
ifneq ($(filter-out inc,$(strip $(MAKECMDGOALS))),)
DBD += $(BPT_DBD)
endif

View File

@ -21,7 +21,9 @@ dbRecStdTest_LIBS += dbRecStd dbCore ca Com
PROD_LIBS = dbRecStdTest dbRecStd dbCore ca Com
TARGETS += $(COMMON_DIR)/recTestIoc.dbd
ifneq (inc,$(strip $(MAKECMDGOALS)))
DBDDEPENDS_FILES += recTestIoc.dbd$(DEP)
endif
recTestIoc_DBD = base.dbd
recTestIoc_DBD += bptTypeKdegC.dbd
recTestIoc_DBD += bptTypeKdegF.dbd
@ -174,7 +176,9 @@ TESTS += regressTest
TARGETS += $(COMMON_DIR)/simmTest.dbd
TARGETS += $(COMMON_DIR)/simmTest.db
DBDDEPENDS_FILES += simmTest.dbd$(DEP)
ifneq (inc,$(strip $(MAKECMDGOALS)))
DBDDEPENDS_FILES += simmTest.db$(DEP)
endif
simmTest_DBD += base.dbd
TESTPROD_HOST += simmTest
simmTest_SRCS += simmTest.c