Skip to content

Commit

Permalink
Merge pull request #43 from IBM/feature/support_includePath
Browse files Browse the repository at this point in the history
Feature/support include path from iproj.json
  • Loading branch information
edmundreinhardt authored Oct 26, 2021
2 parents bba7da3 + a76daff commit 7c1dbb9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
6 changes: 6 additions & 0 deletions makei
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ main() {
curlib=$(parse_placeholder $(retrieve_from_iproj curlib ""))
tgtCcsid=$(retrieve_from_iproj tgtccsid "*JOB")
IBMiEnvCmdList=$(retrieve_from_iproj setIBMiEnvCmd[] "")
includePathList=$(retrieve_from_iproj includePath[] "")
includePath="${includePathList//$'\n'/ }"
preUsrliblRaw=$(retrieve_from_iproj preUsrlibl[] "")
postUsrliblRaw=$(retrieve_from_iproj postUsrlibl[] "")
preUsrlibl=""
Expand All @@ -223,6 +225,7 @@ main() {
echo -e "${DARKGRAY}......${NOCOLOR}curlib: ${ORANGE}${curlib}${NOCOLOR}"
echo -e "${DARKGRAY}......${NOCOLOR}tgtCcsid: ${ORANGE}${tgtCcsid}${NOCOLOR}"
echo -e "${DARKGRAY}......${NOCOLOR}IBMiEnvCmdList: ${ORANGE}${IBMiEnvCmdList}${NOCOLOR}"
echo -e "${DARKGRAY}......${NOCOLOR}includePathList: ${ORANGE}${includePath}${NOCOLOR}"
echo -e "${DARKGRAY}......${NOCOLOR}preUsrlibl: ${ORANGE}${preUsrlibl}${NOCOLOR}"
echo -e "${DARKGRAY}......${NOCOLOR}postUsrlibl: ${ORANGE}${postUsrlibl}${NOCOLOR}"
echo
Expand All @@ -236,9 +239,12 @@ main() {
echo "curlib := ${curlib}"
echo "preUsrlibl := ${preUsrlibl}"
echo "postUsrlibl := ${postUsrlibl}"
echo "INCDIR := ${includePath}"

while read -r cmd; do
IBMiEnvCmd+="cl '$cmd' > /dev/null 2>&1 && "
done <<<"$IBMiEnvCmdList"

echo "IBMiEnvCmd := $(echo "$IBMiEnvCmd" | sed 's/&& $//')"
} >>"$BUILDVARSMK"

Expand Down
22 changes: 17 additions & 5 deletions mk/def_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ CMD_VLDCKR := *NONE
CMOD_AUT := $(AUT)
CMOD_DBGVIEW := $(DBGVIEW)
CMOD_OPTION := *EVENTF *SHOWUSR *XREF *AGR
CMOD_INCDIR := $(INCDIR)
CMOD_STGMDL := *INHERIT
CMOD_SYSIFCOPT := *IFS64IO
CMOD_TERASPACE := *YES *NOTSIFC
Expand All @@ -121,6 +122,7 @@ endif
CLMOD_AUT := $(AUT)
CLMOD_DBGVIEW := $(DBGVIEW)
CLMOD_OPTION := $(OPTION)
CLMOD_INCDIR := $(INCDIR)
CLMOD_TGTRLS := $(TGTRLS)

DSPF_AUT := $(AUT)
Expand Down Expand Up @@ -153,6 +155,7 @@ PGM_STGMDL := *SNGLVL
PGM_TGTRLS := $(TGTRLS)

CBL_OPTION := *SRCDBG
CBL_INCDIR := $(INCDIR)
RPG_OPTION := *SRCDBG

PRTF_AUT := $(AUT)
Expand All @@ -169,6 +172,7 @@ RPGMOD_TGTRLS := $(TGTRLS)
SQLCIMOD_DBGVIEW := *SOURCE
SQLCIMOD_OBJTYPE := *MODULE
SQLCIMOD_OPTION := $(CMOD_OPTION)
SQLCIMOD_INCDIR := $(INCDIR)
SQLCIMOD_STGMDL := $(CMOD_STGMDL)
SQLCIMOD_SYSIFCOPT := $(CMOD_SYSIFCOPT)
SQLCIMOD_TERASPACE := *YES *TSIFC
Expand Down Expand Up @@ -201,10 +205,10 @@ SRVPGM_TGTRLS := $(TGTRLS)
WSCST_AUT := $(AUT)

# Creation command parameters with variables (the ones listed at the top) for the most common ones.
CRTCLMODFLAGS = AUT($(AUT)) DBGVIEW($(DBGVIEW)) OPTION($(OPTION)) TEXT('$(TEXT)') TGTRLS($(TGTRLS))
CRTCMDFLAGS = PGM($(PGM)) VLDCKR($(VLDCKR)) PMTFILE($(PMTFILE)) HLPPNLGRP($(HLPPNLGRP)) HLPID($(HLPID)) AUT($(AUT)) TEXT('$(TEXT)')
CRTCLMODFLAGS = AUT($(AUT)) DBGVIEW($(DBGVIEW)) OPTION($(OPTION)) TEXT('$(TEXT)') TGTRLS($(TGTRLS)) INCDIR($(INCDIR))
CRTCMDFLAGS = PGM($(PGM)) VLDCKR($(VLDCKR)) PMTFILE($(PMTFILE)) HLPPNLGRP($(HLPPNLGRP)) HLPID($(HLPID)) AUT($(AUT)) TEXT('$(TEXT)') INCDIR($(INCDIR))
CRTCMODFLAGS = TERASPACE($(TERASPACE)) STGMDL($(STGMDL)) OUTPUT(*PRINT) OPTION($(OPTION)) DBGVIEW($(DBGVIEW)) \
SYSIFCOPT($(SYSIFCOPT)) AUT($(AUT)) TEXT('$(TEXT)') TGTCCSID($(TGTCCSID)) TGTRLS($(TGTRLS))
SYSIFCOPT($(SYSIFCOPT)) AUT($(AUT)) TEXT('$(TEXT)') TGTCCSID($(TGTCCSID)) TGTRLS($(TGTRLS)) INCDIR($(INCDIR))
CRTDSPFFLAGS = ENHDSP(*YES) RSTDSP($(RSTDSP)) DFRWRT(*YES) AUT($(AUT)) OPTION($(OPTION)) TEXT(''$(TEXT)'')
CRTLFFLAGS = AUT($(AUT)) OPTION($(OPTION)) TEXT(''$(TEXT)'')
CRTMNUFLAGS = AUT($(AUT)) OPTION($(OPTION)) CURLIB($(CURLIB)) PRDLIB($(PRDLIB)) TEXT(''$(TEXT)'') TYPE($(TYPE))
Expand All @@ -217,8 +221,8 @@ CRTRPGMODFLAGS = AUT($(AUT)) DBGVIEW($(DBGVIEW)) OPTION($(OPTION)) OUTPUT(*PRINT
TGTCCSID($(TGTCCSID)) TGTRLS($(TGTRLS))
CRTQMQRYFLAGS = AUT($(AUT)) TEXT(''$(TEXT)'')
CRTSQLCIFLAGS = COMMIT($(COMMIT)) OBJTYPE($(OBJTYPE)) OUTPUT(*PRINT) TEXT('$(TEXT)') TGTRLS($(TGTRLS)) DBGVIEW($(DBGVIEW)) \
COMPILEOPT('INCDIR(''$(SRCPATH)'') OPTION($(OPTION)) STGMDL($(STGMDL)) SYSIFCOPT($(SYSIFCOPT)) \
TGTCCSID($(TGTCCSID)) TERASPACE($(TERASPACE))
COMPILEOPT('INCDIR(''$(INCDIR)'') OPTION($(OPTION)) STGMDL($(STGMDL)) SYSIFCOPT($(SYSIFCOPT)) \
TGTCCSID($(TGTCCSID)) TERASPACE($(TERASPACE)) INCDIR($(INCDIR))
CRTSQLRPGIFLAGS = COMMIT($(COMMIT)) OBJTYPE($(OBJTYPE)) OPTION($(OPTION)) OUTPUT(*PRINT) TEXT('$(TEXT)') \
TGTRLS($(TGTRLS)) DBGVIEW($(DBGVIEW)) RPGPPOPT($(RPGPPOPT)) \
COMPILEOPT('TGTCCSID($(TGTCCSID))')
Expand Down Expand Up @@ -395,6 +399,12 @@ moduleOPTION = $(strip \
$(if $(filter %.SQLC,$<),$(SQLCIMOD_OPTION), \
$(if $(filter %.SQLRPGLE,$<),$(SQLRPGIMOD_OPTION), \
UNKNOWN_FILE_TYPE))))))
moduleINCDIR = $(strip \
$(if $(filter %.C,$<),$(CMOD_INCDIR), \
$(if $(filter %.CLLE,$<),$(CLMOD_INCDIR), \
$(if $(filter %.CBLLE,$<),$(CBLMOD_INCDIR), \
$(if $(filter %.SQLC,$<),$(SQLCIMOD_INCDIR), \
UNKNOWN_FILE_TYPE)))))
moduleRPGPPOPT = $(strip \
$(if $(filter %.SQLRPGLE,$<),$(SQLRPGIMOD_RPGPPOPT), \
UNKNOWN_FILE_TYPE))
Expand Down Expand Up @@ -563,6 +573,7 @@ programTGTRLS = $(strip \
%.MODULE: private DBGVIEW = $(moduleDBGVIEW)
%.MODULE: private OBJTYPE = $(moduleOBJTYPE)
%.MODULE: private OPTION = $(moduleOPTION)
%.MODULE: private INCDIR = $(moduleINCDIR)
%.MODULE: private RPGPPOPT = $(moduleRPGPPOPT)
%.MODULE: private STGMDL = $(moduleSTGMDL)
%.MODULE: private SYSIFCOPT = $(moduleSYSIFCOPT)
Expand Down Expand Up @@ -866,6 +877,7 @@ test:
echo "IBMiEnvCmd: $(IBMiEnvCmd)"; \
echo "IBMiRelease: $(IBMiRelease)"; \
echo "COMPATIBILITYMODE:$(COMPATIBILITYMODE)"; \
echo "INCDIR: $(INCDIR)"; \
echo "preUsrlibl: $(preUsrlibl)"; \
echo "postUsrlibl: $(postUsrlibl)"; \
echo "CRTFRMSTFMLIB: $(CRTFRMSTMFLIB)"; \
Expand Down

0 comments on commit 7c1dbb9

Please sign in to comment.