Skip to content

Commit

Permalink
Merge pull request #39 from IBM/bugfix/support_curlib
Browse files Browse the repository at this point in the history
Support Curlib
  • Loading branch information
edmundreinhardt authored Oct 9, 2021
2 parents 0c1b163 + 863af5a commit 608abe6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
18 changes: 18 additions & 0 deletions makei
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ recursive_generate() {
exit 1
fi

if [[ $objlib == "*CURLIB" ]]; then
if [[ $curlib == "*CRTDFT" ]]; then
objlib="QGPL"
else
objlib=$curlib
fi
fi

if [ -z "${objlib}" ]; then
local objPath=
else
Expand Down Expand Up @@ -188,13 +196,21 @@ main() {

echo -e "${BLUE}makei: Reading from iproj.json${NOCOLOR}"
objlib=$(parse_placeholder $(retrieve_from_iproj objlib "*CURLIB"))
curlib=$(parse_placeholder $(retrieve_from_iproj curlib ""))
tgtCcsid=$(retrieve_from_iproj tgtccsid "*JOB")
IBMiEnvCmdList=$(retrieve_from_iproj setIBMiEnvCmd[] "")
preUsrliblRaw=$(retrieve_from_iproj preUsrlibl[] "")
postUsrliblRaw=$(retrieve_from_iproj postUsrlibl[] "")
preUsrlibl=""
postUsrlibl=""

if [ -z "${curlib}" ]; then
curlib="$(liblist | grep CUR | awk '{print $1}')"
fi
if [ -z "${curlib}" ]; then
curlib="*CRTDFT"
fi

for lib in $preUsrliblRaw; do
preUsrlibl+="$(parse_placeholder "$lib") "
done
Expand All @@ -204,6 +220,7 @@ main() {
done

echo -e "${DARKGRAY}......${NOCOLOR}objlib: ${ORANGE}${objlib}${NOCOLOR}"
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}preUsrlibl: ${ORANGE}${preUsrlibl}${NOCOLOR}"
Expand All @@ -216,6 +233,7 @@ main() {
echo "# This file is generated using makei, DO NOT EDIT."
echo "# Modify .ibmi.json to override values"
echo
echo "curlib := ${curlib}"
echo "preUsrlibl := ${preUsrlibl}"
echo "postUsrlibl := ${postUsrlibl}"
while read -r cmd; do
Expand Down
20 changes: 10 additions & 10 deletions mk/def_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ 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))
CRTBNDCLFLAGS = 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)')
CRTCMODFLAGS = TERASPACE($(TERASPACE)) STGMDL($(STGMDL)) OUTPUT(*PRINT) OPTION($(OPTION)) DBGVIEW($(DBGVIEW)) \
SYSIFCOPT($(SYSIFCOPT)) AUT($(AUT)) TEXT('$(TEXT)') TGTCCSID($(TGTCCSID)) TGTRLS($(TGTRLS))
Expand All @@ -225,7 +224,7 @@ CRTSQLRPGIFLAGS = COMMIT($(COMMIT)) OBJTYPE($(OBJTYPE)) OPTION($(OPTION)) OUTPUT
COMPILEOPT('TGTCCSID($(TGTCCSID))')
CRTSRVPGMFLAGS = ACTGRP($(ACTGRP)) TEXT(''$(TEXT)'') TGTRLS($(TGTRLS)) AUT($(AUT)) DETAIL($(DETAIL)) STGMDL($(STGMDL))
CRTWSCSTFLAGS = AUT($(AUT)) TEXT(''$(TEXT)'')
CRTBNDRPGFLAGS:=TGTCCSID($(TGTCCSID)) OPTION($(OPTION)) TEXT('$(TEXT)') DBGVIEW($(DBGVIEW))
CRTBNDRPGFLAGS:= DBGVIEW($(DBGVIEW)) TGTCCSID($(TGTCCSID)) OPTION($(OPTION)) TEXT('$(TEXT)')
CRTBNDCFLAGS:=TGTCCSID($(TGTCCSID)) OPTION($(OPTION)) TEXT('$(TEXT)')

# Extra command string for adhoc addition of extra parameters to a creation command.
Expand Down Expand Up @@ -262,6 +261,7 @@ VPATH = $(OBJPATH):$(SRCPATH)

define PRESETUP =
echo ">> Adding user libraries to liblist" >> $(LOGFILE); \
[[ ! -z "$(curlib)" ]] && liblist -c $(curlib) >> $(LOGFILE) 2>&1; \
[[ ! -z "$(preUsrlibl)" ]] && liblist -af $(preUsrlibl) >> $(LOGFILE) 2>&1; \
[[ ! -z "$(postUsrlibl)" ]] && liblist -al $(postUsrlibl) >> $(LOGFILE) 2>&1; \
echo ">> Setup IBM i Environment" >> $(LOGFILE); \
Expand Down Expand Up @@ -671,6 +671,14 @@ programTGTRLS = $(strip \
@$(PRESETUP); \
launch "$(JOBLOGFILE)" "$(crtcmd)" >> $(LOGFILE) 2>&1 ; $(EVFEVENT_DOWNLOAD); \
$(POSTCLEANUP)

%.PGM: $$(call genDep,$$@,$$*,PGM.CLLE)
$(eval d = $($@_d))
$(call echo_cmd,"=== Create ILE CL Program [$(notdir $*)]")
$(eval crtcmd := CRTBNDCL srcstmf('$<') PGM($(OBJLIB)/$(basename $(@F))) $(CRTCLMODFLAGS))
@$(PRESETUP); \
launch "$(JOBLOGFILE)" "$(crtcmd)" >> $(LOGFILE) 2>&1 ; $(EVFEVENT_DOWNLOAD); \
$(POSTCLEANUP)

%.PGM: $$(call genDep,$$@,$$*,RPG)
$(eval d = $($@_d))
Expand All @@ -688,14 +696,6 @@ programTGTRLS = $(strip \
$(MK)/extractAndLaunch "$(JOBLOGFILE)" "$<" $(OBJLIB) $(basename $(@F)) >> $(LOGFILE) 2>&1 || true; \
$(POSTCLEANUP)

%.PGM: $$(call genDep,$$@,$$*,PGM.CLLE)
$(eval d = $($@_d))
$(call echo_cmd,"=== Create ILE CL Program [$(notdir $*)]")
$(eval crtcmd := CRTBNDCL srcstmf('$<') PGM($(OBJLIB)/$(basename $(@F))) $(CRTCLMODFLAGS))
@$(PRESETUP); \
launch "$(JOBLOGFILE)" "$(crtcmd)" >> $(LOGFILE) 2>&1 ; $(EVFEVENT_DOWNLOAD); \
$(POSTCLEANUP)

%.PGM: %.MODULE
$(eval d = $($@_d))
$(call echo_cmd,"=== Creating program [$*] from modules [$(basename $(filter %.MODULE,$(notdir $^)))] and service programs [$(basename $(filter %.SRVPGM,$(notdir $^$|)))]")
Expand Down

0 comments on commit 608abe6

Please sign in to comment.