diff --git a/makei b/makei index e09c192..d1484bc 100755 --- a/makei +++ b/makei @@ -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 @@ -188,6 +196,7 @@ 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[] "") @@ -195,6 +204,13 @@ main() { 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 @@ -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}" @@ -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 diff --git a/mk/def_rules.mk b/mk/def_rules.mk index c2a58d6..534c250 100644 --- a/mk/def_rules.mk +++ b/mk/def_rules.mk @@ -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)) @@ -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. @@ -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); \ @@ -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)) @@ -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 $^$|)))]")