From 23b849976cc08c4275997ab134ae58453e382133 Mon Sep 17 00:00:00 2001 From: Hengchao Xiang Date: Mon, 22 Feb 2021 18:31:54 -0500 Subject: [PATCH 1/2] change to use evfevent as file extension --- IBMiMake | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/IBMiMake b/IBMiMake index bae2006..a64ca53 100644 --- a/IBMiMake +++ b/IBMiMake @@ -197,7 +197,7 @@ CRTCLMODFLAGS = AUT($(AUT)) DBGVIEW($(DBGVIEW)) OPTION($(OPTION)) TEXT(''$(TEXT) 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)) \ - MAKEDEP('$(DEPDIR)/$*.Td') + MAKEDEP('$(DEPDIR)/$*.evfevent') 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)) @@ -210,7 +210,7 @@ CRTRPGMODFLAGS = AUT($(AUT)) DBGVIEW($(DBGVIEW)) OPTION($(OPTION)) OUTPUT(*PRINT 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)) MAKEDEP(''$(DEPDIR)/$*.Td'')') + TGTCCSID($(TGTCCSID)) TERASPACE($(TERASPACE)) MAKEDEP(''$(DEPDIR)/$*.evfevent'')') CRTSQLRPGIFLAGS = COMMIT($(COMMIT)) OBJTYPE($(OBJTYPE)) OPTION($(OPTION)) OUTPUT(*PRINT) TEXT('$(TEXT)') \ TGTRLS($(TGTRLS)) DBGVIEW($(DBGVIEW)) RPGPPOPT($(RPGPPOPT)) \ COMPILEOPT('TGTCCSID($(TGTCCSID))') @@ -232,7 +232,7 @@ runDate := $(shell date +"%F_%H.%M.%S-%a") LOGPATH := $(SRCPATH)/Logs/$(runDate) $(shell mkdir -p $(LOGPATH)) $(info IBMiMake log directory: $(LOGPATH)) -DEPDIR := $(SRCPATH)/.deps +DEPDIR := $(SRCPATH)/.evfevent $(shell mkdir -p $(DEPDIR) >/dev/null) CRTFRMSTMFLIB := $(TOOLSLIB) ICONV := /QOpenSys/usr/bin/iconv @@ -248,10 +248,10 @@ cleanCDeps = awk '$$2 !~ /^\/QIBM\// && $$2 !~ /$(notdir $<)$$/ && $$2 !~ /$(bas # This defines the steps taken after a C compile to massage the auto-generated dependencies into a useable form. # See http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#tldr define POSTCCOMPILE = -$(ICONV) -f $(ICONV_EBCDIC) -t $(ICONV_ASCII) $(DEPDIR)/$*.Td | tr -d '\r' > $(DEPDIR)/$*.T2d +$(ICONV) -f $(ICONV_EBCDIC) -t $(ICONV_ASCII) $(DEPDIR)/$*.evfevent | tr -d '\r' > $(DEPDIR)/$*.T2d $(cleanCDeps) <$(DEPDIR)/$*.T2d | sort -u >$(DEPDIR)/$*.d touch -cr $(OBJPATH)/$@ $(DEPDIR)/$*.d -rm $(DEPDIR)/$*.Td $(DEPDIR)/$*.T2d +rm $(DEPDIR)/$*.evfevent $(DEPDIR)/$*.T2d $(removeEmptyDep) endef @@ -267,14 +267,14 @@ cleanRPGDeps = awk '$$1 == "FILEID" && $$6 !~ /^QTEMP/ && toupper($$6) !~ /QSYS/ # convert everything to upper case, format in makefile dependency format, and output all these dependencies # to a file that will be included by Make. define POSTRPGCOMPILE = -system "CPYTOSTMF FROMMBR('$(OBJPATH)/EVFEVENT.FILE/$*.MBR') TOSTMF('$(DEPDIR)/$*.Td') STMFCCSID(*STDASCII) ENDLINFMT(*LF) CVTDTA(*AUTO) STMFOPT(*REPLACE)" >/dev/null -{ for f in $$($(cleanRPGDeps) <$(DEPDIR)/$*.Td | sort -u); do \ +system "CPYTOSTMF FROMMBR('$(OBJPATH)/EVFEVENT.FILE/$*.MBR') TOSTMF('$(DEPDIR)/$*.evfevent') STMFCCSID(*STDASCII) ENDLINFMT(*LF) CVTDTA(*AUTO) STMFOPT(*REPLACE)" >/dev/null +{ for f in $$($(cleanRPGDeps) <$(DEPDIR)/$*.evfevent | sort -u); do \ echo "$${f}"; \ sed -n -r -e '/^.{6}[^*].{14}[^Ff]/ s/^.{5}[Ff]([^ ]{,10}).*(DISK|WORKSTN|PRINTER).*/ \1\.FILE/I p' -e '/^.{6}[^*]/ s/^.{5}[Dd].*EXTNAME\(([^ \)]*).*/ \1\.FILE/I p' "$${f}" | sort -u; \ done; \ } | sed -e 's/^\/.*\///' -e 's/^/$@: /' | tr '[:lower:]' '[:upper:]' >$(DEPDIR)/$*.d touch -cr $(OBJPATH)/$@ $(DEPDIR)/$*.d -#rm $(DEPDIR)/$*.Td +#rm $(DEPDIR)/$*.evfevent $(removeEmptyDep) endef @@ -523,7 +523,7 @@ programTGTRLS = $(strip \ @echo "*** Creating C module [$*]" @$(set_STMF_CCSID) $(eval crtcmd := crtcmod module($(OBJLIB)/$*) srcstmf('$<') $(CRTCMODFLAGS) $(ADHOCCRTFLAGS)) - @system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 || (ret=$$?; rm $(DEPDIR)/$*.Td 2>/dev/null; exit $$ret) + -@system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 || (ret=$$?; rm $(DEPDIR)/$*.evfevent 2>/dev/null; exit $$ret) @$(POSTCCOMPILE) %.MODULE: %.CLLE @@ -536,7 +536,7 @@ programTGTRLS = $(strip \ @echo "*** Creating RPG module [$*]" @$(set_STMF_CCSID) $(eval crtcmd := crtrpgmod module($(OBJLIB)/$*) srcstmf('$<') $(CRTRPGMODFLAGS)) - @system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" > $(LOGPATH)/$(notdir $<).log + -@system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" > $(LOGPATH)/$(notdir $<).log @$(POSTRPGCOMPILE) # Temp: Convert UTF-8 to temporary Windows Latin-1, because SQLC pre-compiler doesn't understand UTF-8 @@ -545,15 +545,15 @@ programTGTRLS = $(strip \ @$(set_STMF_CCSID) @qsh_out -c "touch -C 1252 $<-1252 && cat $< >$<-1252" $(eval crtcmd := crtsqlci obj($(OBJLIB)/$*) srcstmf('$<-1252') $(CRTSQLCIFLAGS)) - @system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 || (ret=$$?; rm $(DEPDIR)/$*.Td 2>/dev/null; rm "$<-1252" 2>/dev/null; exit $$ret) - @$(POSTCCOMPILE) + @system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 || (ret=$$?; rm $(DEPDIR)/$*.evfevent 2>/dev/null; rm "$<-1252" 2>/dev/null; exit $$ret) + -@$(POSTCCOMPILE) @rm "$<-1252" %.MODULE: %.SQLRPGLE $(DEPDIR)/%.d @echo "*** Creating SQLRPGLE module [$*]" @$(set_STMF_CCSID) $(eval crtcmd := crtsqlrpgi obj($(OBJLIB)/$*) srcstmf('$<') $(CRTSQLRPGIFLAGS)) - @system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 + -@system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 @$(POSTRPGCOMPILE) @@ -668,4 +668,4 @@ test: ### Uncomment and add the following to the END of each project-specific makefile. # Include all auto-generated source dependency files. Since we don't have a list of source files, # we have to grab everything in the `$DEPDIR` directory. -#-include $(wildcard $(DEPDIR)/*.d) \ No newline at end of file +#-include $(wildcard $(DEPDIR)/*.d) From 00a6cb9537dca13a35aa6c0e8fbd92b8360d43af Mon Sep 17 00:00:00 2001 From: Hengchao Xiang Date: Tue, 23 Feb 2021 10:17:18 -0500 Subject: [PATCH 2/2] keep both DEPDIR and and EVTDIR --- IBMiMake | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/IBMiMake b/IBMiMake index a64ca53..31b17fb 100644 --- a/IBMiMake +++ b/IBMiMake @@ -197,7 +197,7 @@ CRTCLMODFLAGS = AUT($(AUT)) DBGVIEW($(DBGVIEW)) OPTION($(OPTION)) TEXT(''$(TEXT) 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)) \ - MAKEDEP('$(DEPDIR)/$*.evfevent') + MAKEDEP('$(DEPDIR)/$*.Td') 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)) @@ -210,7 +210,7 @@ CRTRPGMODFLAGS = AUT($(AUT)) DBGVIEW($(DBGVIEW)) OPTION($(OPTION)) OUTPUT(*PRINT 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)) MAKEDEP(''$(DEPDIR)/$*.evfevent'')') + TGTCCSID($(TGTCCSID)) TERASPACE($(TERASPACE)) MAKEDEP(''$(DEPDIR)/$*.Td'')') CRTSQLRPGIFLAGS = COMMIT($(COMMIT)) OBJTYPE($(OBJTYPE)) OPTION($(OPTION)) OUTPUT(*PRINT) TEXT('$(TEXT)') \ TGTRLS($(TGTRLS)) DBGVIEW($(DBGVIEW)) RPGPPOPT($(RPGPPOPT)) \ COMPILEOPT('TGTCCSID($(TGTCCSID))') @@ -232,8 +232,10 @@ runDate := $(shell date +"%F_%H.%M.%S-%a") LOGPATH := $(SRCPATH)/Logs/$(runDate) $(shell mkdir -p $(LOGPATH)) $(info IBMiMake log directory: $(LOGPATH)) -DEPDIR := $(SRCPATH)/.evfevent +DEPDIR := $(SRCPATH)/.deps $(shell mkdir -p $(DEPDIR) >/dev/null) +EVTDIR := $(SRCPATH)/.evfevent +$(shell mkdir -p $(EVTDIR) >/dev/null) CRTFRMSTMFLIB := $(TOOLSLIB) ICONV := /QOpenSys/usr/bin/iconv ICONV_EBCDIC := IBM-037 @@ -248,10 +250,10 @@ cleanCDeps = awk '$$2 !~ /^\/QIBM\// && $$2 !~ /$(notdir $<)$$/ && $$2 !~ /$(bas # This defines the steps taken after a C compile to massage the auto-generated dependencies into a useable form. # See http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#tldr define POSTCCOMPILE = -$(ICONV) -f $(ICONV_EBCDIC) -t $(ICONV_ASCII) $(DEPDIR)/$*.evfevent | tr -d '\r' > $(DEPDIR)/$*.T2d +$(ICONV) -f $(ICONV_EBCDIC) -t $(ICONV_ASCII) $(DEPDIR)/$*.Td | tr -d '\r' > $(DEPDIR)/$*.T2d $(cleanCDeps) <$(DEPDIR)/$*.T2d | sort -u >$(DEPDIR)/$*.d touch -cr $(OBJPATH)/$@ $(DEPDIR)/$*.d -rm $(DEPDIR)/$*.evfevent $(DEPDIR)/$*.T2d +rm $(DEPDIR)/$*.T2d $(removeEmptyDep) endef @@ -266,15 +268,18 @@ cleanRPGDeps = awk '$$1 == "FILEID" && $$6 !~ /^QTEMP/ && toupper($$6) !~ /QSYS/ # if any externally-described files are declared. If so, isolate the actual source file name from its path, # convert everything to upper case, format in makefile dependency format, and output all these dependencies # to a file that will be included by Make. +define EVFEVENT_DOWNLOAD = +system "CPYTOSTMF FROMMBR('$(OBJPATH)/EVFEVENT.FILE/$*.MBR') TOSTMF('$(EVTDIR)/$*.evfevent') STMFCCSID(*STDASCII) ENDLINFMT(*LF) CVTDTA(*AUTO) STMFOPT(*REPLACE)" >/dev/null +endef define POSTRPGCOMPILE = -system "CPYTOSTMF FROMMBR('$(OBJPATH)/EVFEVENT.FILE/$*.MBR') TOSTMF('$(DEPDIR)/$*.evfevent') STMFCCSID(*STDASCII) ENDLINFMT(*LF) CVTDTA(*AUTO) STMFOPT(*REPLACE)" >/dev/null -{ for f in $$($(cleanRPGDeps) <$(DEPDIR)/$*.evfevent | sort -u); do \ +$(EVFEVENT_DOWNLOAD) +{ for f in $$($(cleanRPGDeps) <$(EVTDIR)/$*.evfevent | sort -u); do \ echo "$${f}"; \ sed -n -r -e '/^.{6}[^*].{14}[^Ff]/ s/^.{5}[Ff]([^ ]{,10}).*(DISK|WORKSTN|PRINTER).*/ \1\.FILE/I p' -e '/^.{6}[^*]/ s/^.{5}[Dd].*EXTNAME\(([^ \)]*).*/ \1\.FILE/I p' "$${f}" | sort -u; \ done; \ } | sed -e 's/^\/.*\///' -e 's/^/$@: /' | tr '[:lower:]' '[:upper:]' >$(DEPDIR)/$*.d touch -cr $(OBJPATH)/$@ $(DEPDIR)/$*.d -#rm $(DEPDIR)/$*.evfevent +#rm $(EVTDIR)/$*.evfevent $(removeEmptyDep) endef @@ -523,7 +528,7 @@ programTGTRLS = $(strip \ @echo "*** Creating C module [$*]" @$(set_STMF_CCSID) $(eval crtcmd := crtcmod module($(OBJLIB)/$*) srcstmf('$<') $(CRTCMODFLAGS) $(ADHOCCRTFLAGS)) - -@system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 || (ret=$$?; rm $(DEPDIR)/$*.evfevent 2>/dev/null; exit $$ret) + @system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 || (ret=$$?; rm $(DEPDIR)/$*.Td 2>/dev/null; exit $$ret) @$(POSTCCOMPILE) %.MODULE: %.CLLE @@ -536,7 +541,7 @@ programTGTRLS = $(strip \ @echo "*** Creating RPG module [$*]" @$(set_STMF_CCSID) $(eval crtcmd := crtrpgmod module($(OBJLIB)/$*) srcstmf('$<') $(CRTRPGMODFLAGS)) - -@system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" > $(LOGPATH)/$(notdir $<).log + @system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" > $(LOGPATH)/$(notdir $<).log || $(EVFEVENT_DOWNLOAD) @$(POSTRPGCOMPILE) # Temp: Convert UTF-8 to temporary Windows Latin-1, because SQLC pre-compiler doesn't understand UTF-8 @@ -545,18 +550,17 @@ programTGTRLS = $(strip \ @$(set_STMF_CCSID) @qsh_out -c "touch -C 1252 $<-1252 && cat $< >$<-1252" $(eval crtcmd := crtsqlci obj($(OBJLIB)/$*) srcstmf('$<-1252') $(CRTSQLCIFLAGS)) - @system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 || (ret=$$?; rm $(DEPDIR)/$*.evfevent 2>/dev/null; rm "$<-1252" 2>/dev/null; exit $$ret) - -@$(POSTCCOMPILE) + @system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 || (ret=$$?; rm $(DEPDIR)/$*.Td 2>/dev/null; rm "$<-1252" 2>/dev/null; exit $$ret) + @$(POSTCCOMPILE) @rm "$<-1252" %.MODULE: %.SQLRPGLE $(DEPDIR)/%.d @echo "*** Creating SQLRPGLE module [$*]" @$(set_STMF_CCSID) $(eval crtcmd := crtsqlrpgi obj($(OBJLIB)/$*) srcstmf('$<') $(CRTSQLRPGIFLAGS)) - -@system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 + @system -v "$(TOOLSLIB)/EXECWLIBS LIB($(LIBL)) CMD($(crtcmd))" >$(LOGPATH)/$(notdir $<).log 2>&1 || $(EVFEVENT_DOWNLOAD) @$(POSTRPGCOMPILE) - %.PGM: private ACTGRP = $(programACTGRP) %.PGM: private AUT = $(programAUT) %.PGM: private DBGVIEW = $(programDBGVIEW) @@ -668,4 +672,4 @@ test: ### Uncomment and add the following to the END of each project-specific makefile. # Include all auto-generated source dependency files. Since we don't have a list of source files, # we have to grab everything in the `$DEPDIR` directory. -#-include $(wildcard $(DEPDIR)/*.d) +#-include $(wildcard $(DEPDIR)/*.d) \ No newline at end of file