@profoundlogic/codermake 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(_0x136478,_0x2dcde3){const _0x27ed08=_0x4ebb,_0x27eb26=_0x136478();while(!![]){try{const _0x459ef5=-parseInt(_0x27ed08(0x19f))/0x1*(-parseInt(_0x27ed08(0x1aa))/0x2)+parseInt(_0x27ed08(0x19a))/0x3*(parseInt(_0x27ed08(0x1a2))/0x4)+parseInt(_0x27ed08(0x19d))/0x5+-parseInt(_0x27ed08(0x1b6))/0x6*(parseInt(_0x27ed08(0x1a6))/0x7)+parseInt(_0x27ed08(0x1a7))/0x8*(-parseInt(_0x27ed08(0x1ae))/0x9)+parseInt(_0x27ed08(0x1b0))/0xa+parseInt(_0x27ed08(0x1ba))/0xb*(parseInt(_0x27ed08(0x1ac))/0xc);if(_0x459ef5===_0x2dcde3)break;else _0x27eb26['push'](_0x27eb26['shift']());}catch(_0x290495){_0x27eb26['push'](_0x27eb26['shift']());}}}(_0x54cc,0x61dc4));import{writeFileSync,mkdirSync,existsSync}from'fs';import{join}from'path';import{randomUUID}from'crypto';function _0x4ebb(_0x2c0d4b,_0x24cfac){_0x2c0d4b=_0x2c0d4b-0x198;const _0x54cc3c=_0x54cc();let _0x4ebbf9=_0x54cc3c[_0x2c0d4b];if(_0x4ebb['UaNRXV']===undefined){var _0x211ea0=function(_0xca1694){const _0x268a17='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5af47c='',_0x2a75eb='';for(let _0x47513d=0x0,_0xe1e142,_0x35d675,_0x21be7c=0x0;_0x35d675=_0xca1694['charAt'](_0x21be7c++);~_0x35d675&&(_0xe1e142=_0x47513d%0x4?_0xe1e142*0x40+_0x35d675:_0x35d675,_0x47513d++%0x4)?_0x5af47c+=String['fromCharCode'](0xff&_0xe1e142>>(-0x2*_0x47513d&0x6)):0x0){_0x35d675=_0x268a17['indexOf'](_0x35d675);}for(let _0x171686=0x0,_0x29873d=_0x5af47c['length'];_0x171686<_0x29873d;_0x171686++){_0x2a75eb+='%'+('00'+_0x5af47c['charCodeAt'](_0x171686)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2a75eb);};_0x4ebb['OFbTkC']=_0x211ea0,_0x4ebb['epXDYD']={},_0x4ebb['UaNRXV']=!![];}const _0xa14cb9=_0x54cc3c[0x0],_0xd8da62=_0x2c0d4b+_0xa14cb9,_0x381d32=_0x4ebb['epXDYD'][_0xd8da62];return!_0x381d32?(_0x4ebbf9=_0x4ebb['OFbTkC'](_0x4ebbf9),_0x4ebb['epXDYD'][_0xd8da62]=_0x4ebbf9):_0x4ebbf9=_0x381d32,_0x4ebbf9;}import{tmpdir}from'os';function _0x54cc(){const _0x234723=['oeLcy2rTBq','ChvZAa','uNnItw0','mtCYmMjgwvnpDW','DgfYz2v0lw1HChbPBMCUANnVBG','nZGWnJbVrg1HB2S','y29UzMLNlM1R','mZC0nty0n1LIEg9SvW','AM9PBG','nZC4odKZmgLirMTMwG','q09ervjnquTfx0vnufrzidO9','rwTovLi','vefsr0vuuYa6psa','CMvJDxjZAxzL','DgfYz2v0C0zPBgu','mtjizxbjtLK','qKf6CuO','svjbAxu','CNvSzxngAwXL','mtf1B1nkqKW','C3rYAw5NAwz5','CNvSzxmUBwS','nLbHt0Lvsq','BePLreC','r0nmwg8','ntu2mdy1vevUt2XR','Dg1WrgLY','nJznDfbHBxq','DxrMoa','u3nvy0W','nta0mJmYt0HYrM9Y','C2L6zq','DgfYz2v0CY5TAW','BwfWCgLUz0zPBgu','mtm1otG2ou1PAfDRAq'];_0x54cc=function(){return _0x234723;};return _0x54cc();}function ensureDir(_0x3e2167){const _0x4cb5e6=_0x4ebb,_0xd5a198={'GCLXo':function(_0x28aad5,_0x23b465){return _0x28aad5(_0x23b465);},'BAzqJ':function(_0x3bbcee,_0x12f066,_0x5285b0){return _0x3bbcee(_0x12f066,_0x5285b0);}};if(!_0xd5a198[_0x4cb5e6(0x19c)](existsSync,_0x3e2167)){const _0x14cec0={};_0x14cec0[_0x4cb5e6(0x1b4)]=!![],_0xd5a198[_0x4cb5e6(0x1b7)](mkdirSync,_0x3e2167,_0x14cec0);}}export function writeRules(_0x1a67ab,_0x51f0a5,_0x19e0a3={},_0x2dfaf9=null){const _0x1e91f7=_0x4ebb,_0x447636={'lJeDG':function(_0x281e00){return _0x281e00();},'mbTsm':function(_0x426194){return _0x426194();},'PfATY':function(_0x217daa,_0x5e864a){return _0x217daa(_0x5e864a);},'RsbMm':function(_0x10fbf8,_0x1ceb72,_0x4ed5d5){return _0x10fbf8(_0x1ceb72,_0x4ed5d5);},'IRAiu':_0x1e91f7(0x1a0),'EkNVR':function(_0x34aedb,_0x16eb3e,_0x17bfe2,_0x45a4d8){return _0x34aedb(_0x16eb3e,_0x17bfe2,_0x45a4d8);}};if(!_0x2dfaf9){const _0x4efaca=_0x447636[_0x1e91f7(0x19b)](randomUUID)['replace'](/-/g,'');_0x2dfaf9=join(_0x447636['mbTsm'](tmpdir),'cm-'+_0x4efaca);}_0x447636['PfATY'](ensureDir,_0x2dfaf9);const _0x1aa441=join(_0x2dfaf9,_0x1e91f7(0x199)),_0x10e6fd=join(_0x2dfaf9,_0x1e91f7(0x1a4)),_0x695b78=_0x447636[_0x1e91f7(0x1a9)](join,_0x2dfaf9,_0x1e91f7(0x1ab)),_0x2d92e2=_0x1a67ab[_0x1e91f7(0x1af)]('\x0a')+'\x0a';writeFileSync(_0x1aa441,_0x2d92e2,_0x447636[_0x1e91f7(0x1b8)]);const _0x3a1f47=_0x1e91f7(0x1b3)+_0x51f0a5[_0x1e91f7(0x1af)]('\x20')+'\x0a';writeFileSync(_0x10e6fd,_0x3a1f47,_0x447636['IRAiu']);const _0x1649d8=JSON[_0x1e91f7(0x198)](_0x19e0a3,null,0x2);_0x447636[_0x1e91f7(0x1b2)](writeFileSync,_0x695b78,_0x1649d8,'utf8');const _0x168ccd={};return _0x168ccd[_0x1e91f7(0x1b9)]=_0x1aa441,_0x168ccd[_0x1e91f7(0x1b5)]=_0x10e6fd,_0x168ccd[_0x1e91f7(0x1a5)]=_0x695b78,_0x168ccd[_0x1e91f7(0x19e)]=_0x2dfaf9,_0x168ccd;}export function writeConfigMk(_0x3a69c0,_0x322b48){const _0x4217c5=_0x4ebb,_0x2b7b59={'SsUcL':function(_0x462fc1,_0x48d02d){return _0x462fc1(_0x48d02d);},'xOPch':function(_0x32a0f5,_0x12f050,_0x5a3479){return _0x32a0f5(_0x12f050,_0x5a3479);}};if(!_0x322b48||_0x322b48[_0x4217c5(0x1a3)]===0x0)return null;_0x2b7b59[_0x4217c5(0x1a1)](ensureDir,_0x3a69c0);const _0x321a65=_0x2b7b59['xOPch'](join,_0x3a69c0,_0x4217c5(0x1ad)),_0xedf2a7=[_0x4217c5(0x1b1)];for(const [_0x441284,_0xfb1552]of _0x322b48){_0xedf2a7[_0x4217c5(0x1a8)](_0x441284+'\x20:=\x20'+_0xfb1552);}return writeFileSync(_0x321a65,_0xedf2a7[_0x4217c5(0x1af)]('\x0a')+'\x0a','utf8'),_0x321a65;}
1
+ (function(_0xece2bb,_0x5e5a60){const _0x53aea5=_0x3547,_0x13ee77=_0xece2bb();while(!![]){try{const _0x1d02bb=parseInt(_0x53aea5(0x159))/0x1+-parseInt(_0x53aea5(0x167))/0x2*(-parseInt(_0x53aea5(0x15e))/0x3)+-parseInt(_0x53aea5(0x163))/0x4+-parseInt(_0x53aea5(0x16b))/0x5+parseInt(_0x53aea5(0x170))/0x6+parseInt(_0x53aea5(0x166))/0x7*(-parseInt(_0x53aea5(0x16a))/0x8)+parseInt(_0x53aea5(0x15d))/0x9*(parseInt(_0x53aea5(0x16d))/0xa);if(_0x1d02bb===_0x5e5a60)break;else _0x13ee77['push'](_0x13ee77['shift']());}catch(_0x511a93){_0x13ee77['push'](_0x13ee77['shift']());}}}(_0x2fb7,0x63ed6));import{writeFileSync,mkdirSync,existsSync}from'fs';import{join}from'path';import{randomUUID}from'crypto';import{tmpdir}from'os';function _0x3547(_0x4d2c9e,_0x403779){_0x4d2c9e=_0x4d2c9e-0x154;const _0x2fb7af=_0x2fb7();let _0x35475d=_0x2fb7af[_0x4d2c9e];if(_0x3547['OgWyRC']===undefined){var _0x5b442b=function(_0x257a9e){const _0xc5d434='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x25f5f9='',_0x27d8fd='';for(let _0x41f5a1=0x0,_0x19686c,_0xf276db,_0x2cb224=0x0;_0xf276db=_0x257a9e['charAt'](_0x2cb224++);~_0xf276db&&(_0x19686c=_0x41f5a1%0x4?_0x19686c*0x40+_0xf276db:_0xf276db,_0x41f5a1++%0x4)?_0x25f5f9+=String['fromCharCode'](0xff&_0x19686c>>(-0x2*_0x41f5a1&0x6)):0x0){_0xf276db=_0xc5d434['indexOf'](_0xf276db);}for(let _0x44777a=0x0,_0x337161=_0x25f5f9['length'];_0x44777a<_0x337161;_0x44777a++){_0x27d8fd+='%'+('00'+_0x25f5f9['charCodeAt'](_0x44777a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x27d8fd);};_0x3547['UCnACB']=_0x5b442b,_0x3547['DGQrNN']={},_0x3547['OgWyRC']=!![];}const _0x543767=_0x2fb7af[0x0],_0x3f30b4=_0x4d2c9e+_0x543767,_0x43300f=_0x3547['DGQrNN'][_0x3f30b4];return!_0x43300f?(_0x35475d=_0x3547['UCnACB'](_0x35475d),_0x3547['DGQrNN'][_0x3f30b4]=_0x35475d):_0x35475d=_0x43300f,_0x35475d;}function ensureDir(_0x327455){const _0x460524=_0x3547,_0x713178={'hTWJn':function(_0x4faea2,_0x272c21,_0x12378b){return _0x4faea2(_0x272c21,_0x12378b);}};if(!existsSync(_0x327455)){const _0x29ec7a={};_0x29ec7a[_0x460524(0x168)]=!![],_0x713178[_0x460524(0x158)](mkdirSync,_0x327455,_0x29ec7a);}}function _0x2fb7(){const _0x572e59=['r1nItwC','DgfYz2v0lw1HChbPBMCUANnVBG','ndeWmZiXogvQuM9Jzq','mtuZntG1mePluhHSrW','CMvJDxjZAxzL','ChvZAa','ofvrAfDzsW','mJm2mJe5mgverNjqzq','y29UzMLNlM1R','nJuYoda1mgTACLDtDG','quD2Dgq','BwTtCKS','otm5nJzgChDWzuG','DgfYz2v0CY5TAW','C3rYAw5NAwz5','C2L6zq','q09ervjnquTfx0vnufrzidO9','wu9irwG','wNvOEeq','Dg1WrgLY','vefsr0vuuYa6psa','AM9PBG','v2nOtha','CNvSzxmUBwS','AfrxsM4','mtu1mZq4AvbNAu5p','z3nWz1K','idO9ia','seToCfK','oxPnwu5yyG','m2Dot3PvCW','y20T','qw5lDvK','DgfYz2v0C0zPBgu','DxrMoa','ndK1mZaWyMj2AwDZ'];_0x2fb7=function(){return _0x572e59;};return _0x2fb7();}export function writeRules(_0x145917,_0x486ba7,_0x5ace68={},_0x3951f5=null){const _0x5a027e=_0x3547,_0x25e1eb={'ZuhxD':function(_0x2eb9ab){return _0x2eb9ab();},'WchLp':function(_0x4c7755,_0x4b5155,_0x320067){return _0x4c7755(_0x4b5155,_0x320067);},'GSbMg':function(_0x9a1f07,_0x1e47e3){return _0x9a1f07(_0x1e47e3);},'NfBbS':_0x5a027e(0x157),'glhNj':_0x5a027e(0x165),'AGvtd':function(_0x475ae3,_0x2dc7e6){return _0x475ae3+_0x2dc7e6;},'mkSrK':function(_0x20f5a7,_0x3eac53,_0x44d063,_0x3d8483){return _0x20f5a7(_0x3eac53,_0x44d063,_0x3d8483);},'AnKuY':_0x5a027e(0x162)};if(!_0x3951f5){const _0x39c5db=_0x25e1eb[_0x5a027e(0x176)](randomUUID)['replace'](/-/g,'');_0x3951f5=_0x25e1eb[_0x5a027e(0x156)](join,_0x25e1eb['ZuhxD'](tmpdir),_0x5a027e(0x15f)+_0x39c5db);}_0x25e1eb[_0x5a027e(0x164)](ensureDir,_0x3951f5);const _0x51a4c8=join(_0x3951f5,_0x25e1eb['NfBbS']),_0x291d71=_0x25e1eb[_0x5a027e(0x156)](join,_0x3951f5,_0x5a027e(0x171)),_0x5e7e5f=join(_0x3951f5,_0x25e1eb['glhNj']),_0x59e1f2=_0x25e1eb[_0x5a027e(0x16e)](_0x145917[_0x5a027e(0x155)]('\x0a'),'\x0a');writeFileSync(_0x51a4c8,_0x59e1f2,_0x5a027e(0x162));const _0x56dae9=_0x5a027e(0x154)+_0x486ba7[_0x5a027e(0x155)]('\x20')+'\x0a';_0x25e1eb['mkSrK'](writeFileSync,_0x291d71,_0x56dae9,_0x25e1eb[_0x5a027e(0x160)]);const _0x20dfa9=JSON[_0x5a027e(0x172)](_0x5ace68,null,0x2);_0x25e1eb[_0x5a027e(0x16f)](writeFileSync,_0x5e7e5f,_0x20dfa9,_0x5a027e(0x162));const _0x1e2aee={};return _0x1e2aee['rulesFile']=_0x51a4c8,_0x1e2aee[_0x5a027e(0x161)]=_0x291d71,_0x1e2aee['mappingFile']=_0x5e7e5f,_0x1e2aee[_0x5a027e(0x177)]=_0x3951f5,_0x1e2aee;}export function writeConfigMk(_0x36c762,_0x44a904){const _0x493bdc=_0x3547,_0x54e310={'HKNpY':function(_0x2d0407,_0x20c7f6){return _0x2d0407===_0x20c7f6;},'YOHEh':function(_0x405830,_0x2bb1e7,_0x361e17){return _0x405830(_0x2bb1e7,_0x361e17);},'gspgY':function(_0xb669e9,_0x517bf5,_0x37c722,_0x332dcd){return _0xb669e9(_0x517bf5,_0x37c722,_0x332dcd);},'hKKVo':function(_0x546bc2,_0x16dbe2){return _0x546bc2+_0x16dbe2;}};if(!_0x44a904||_0x54e310[_0x493bdc(0x15c)](_0x44a904[_0x493bdc(0x173)],0x0))return null;ensureDir(_0x36c762);const _0x174427=_0x54e310[_0x493bdc(0x175)](join,_0x36c762,_0x493bdc(0x16c)),_0x4b4a4c=[_0x493bdc(0x174)];for(const [_0x5e4605,_0x8d8970]of _0x44a904){_0x4b4a4c[_0x493bdc(0x169)](_0x5e4605+_0x493bdc(0x15b)+_0x8d8970);}return _0x54e310[_0x493bdc(0x15a)](writeFileSync,_0x174427,_0x54e310['hKKVo'](_0x4b4a4c[_0x493bdc(0x155)]('\x0a'),'\x0a'),'utf8'),_0x174427;}
@@ -7,8 +7,12 @@ OS := $(shell uname -s)
7
7
  # Include base configuration
8
8
  include $(CODERMAKE_PACKAGE_DIR)/makefiles/base.mk
9
9
 
10
- # Include platform-specific rules
11
- ifeq ($(OS),OS400)
10
+ # Include platform-specific rules. Target listing (--list-targets) replaces the
11
+ # compiling backends entirely: no recipe runs, nothing is created, and no
12
+ # connection settings are needed. See list.mk and design/LIST_TARGETS.md.
13
+ ifdef CODERMAKE_LIST_TARGETS
14
+ include $(CODERMAKE_PACKAGE_DIR)/makefiles/list.mk
15
+ else ifeq ($(OS),OS400)
12
16
  # IBM i platform
13
17
  include $(CODERMAKE_PACKAGE_DIR)/makefiles/ibmi.mk
14
18
  else
@@ -16,8 +20,11 @@ else
16
20
  include $(CODERMAKE_PACKAGE_DIR)/makefiles/unix.mk
17
21
  endif
18
22
 
19
- # Initialize log directory (shared across platforms)
23
+ # Initialize log directory (shared across platforms). Skipped while listing, which
24
+ # must not discard the previous build's compile listings.
25
+ ifndef CODERMAKE_LIST_TARGETS
20
26
  $(shell rm -rf tmp/logs && $(MKDIR) -p tmp/logs)
27
+ endif
21
28
 
22
29
  # Include user compile-option overrides (.codermake/config.json -> config.mk).
23
30
  # Optional: absent when the project has no configuration, in which case every
@@ -38,13 +45,19 @@ $(shell rm -rf tmp/logs && $(MKDIR) -p tmp/logs)
38
45
  MAKE_SHORTFLAGS := $(filter-out -%,$(firstword $(MAKEFLAGS)))
39
46
 
40
47
  # Per-library bin dirs computed from TARGETS (Unix-like only).
41
- # Under `make -t` / `make -n` recipes don't run, so we pre-create these dirs at
42
- # parse time so dummies inside `build/<lib>.lib/` can be touched. In normal
43
- # builds, the directory rule in unix.mk creates each one on demand.
48
+ # Under `make -t` recipes don't run, so we pre-create these dirs at parse time so
49
+ # dummies inside `build/<lib>.lib/` can be touched. In normal builds, the
50
+ # directory rule in unix.mk creates each one on demand.
51
+ #
52
+ # Deliberately `-t` only, not `-n`. In multi-library mode `build/<lib>.lib/` is
53
+ # itself the library-existence marker, so creating it under a dry run would leave
54
+ # a marker behind that satisfies the rule and suppresses the CRTLIB in a later
55
+ # real build. Nothing under `-n` needs these directories: no recipe runs and no
56
+ # dummy is touched.
44
57
  ifneq ($(OS),OS400)
45
58
  LIBRARY_BIN_DIRS := $(patsubst %/,%,$(sort $(dir $(filter build/%,$(TARGETS)))))
46
59
  ifneq (,$(strip $(LIBRARY_BIN_DIRS)))
47
- ifneq (,$(findstring t,$(MAKE_SHORTFLAGS))$(findstring n,$(MAKE_SHORTFLAGS)))
60
+ ifneq (,$(findstring t,$(MAKE_SHORTFLAGS)))
48
61
  $(shell mkdir -p $(LIBRARY_BIN_DIRS))
49
62
  endif
50
63
  endif
@@ -0,0 +1,97 @@
1
+ ######
2
+ # Target listing backend.
3
+ #
4
+ # Included instead of unix.mk when CODERMAKE_LIST_TARGETS is set
5
+ # (`codermake --list-targets`). In this mode every output rule's recipe is a
6
+ # single pre-rendered record line emitted by the preprocessor, and make runs
7
+ # with -n, so no recipe is ever executed: make prints the records for exactly
8
+ # the targets it would have built, and the CLI reads them off stdout.
9
+ #
10
+ # -n is what makes the answer CORRECT, not merely cheap. Make propagates
11
+ # out-of-dateness to a dependent only when it believes a prerequisite was
12
+ # actually remade, which it decides by re-reading timestamps after running the
13
+ # prerequisite's recipe. A recipe that merely prints leaves the marker's
14
+ # timestamp alone, so executing print-recipes would report the directly-changed
15
+ # targets and silently drop every dependent — the opposite of what a listing is
16
+ # for. Under -n make assumes each recipe did its job and cascades normally.
17
+ #
18
+ # Nothing here contacts an IBM i, requires connection settings, prints a banner,
19
+ # or creates a file or directory: a listing is a query and must leave the build
20
+ # state untouched.
21
+ ######
22
+
23
+ ######
24
+ # Remote builds only. On IBM i the build targets are the objects in QSYS.LIB
25
+ # rather than markers under build/, and `codermake -t` cannot baseline them
26
+ # because touch cannot open a library or an object there. The CLI refuses
27
+ # --list-targets on IBM i before reaching this file; this guard means a wrong
28
+ # answer cannot be produced by accident if it ever gets here anyway.
29
+ ######
30
+ ifeq ($(OS),OS400)
31
+ $(error --list-targets is not supported when running on IBM i)
32
+ endif
33
+
34
+ SHELL := /bin/sh
35
+
36
+ ######
37
+ # Output library configuration. Only the name the generated rules reference is
38
+ # needed — the library reported for each target is baked into its record by the
39
+ # preprocessor. In single-library mode the library-creation prerequisite is
40
+ # spelled `build/$(LIBRARY).lib`, so LIBRARY must resolve here. Exactly one of
41
+ # IBMI_BUILD_LIBRARY or CODERMAKE_LIBRARY_MAP is set; the CLI has already
42
+ # validated that.
43
+ ######
44
+ ifndef CODERMAKE_LIBRARY_MAP
45
+ LIBRARY := $(IBMI_BUILD_LIBRARY)
46
+ endif
47
+
48
+ ######
49
+ # Where build output lives, used to tell a target's own sources apart from its
50
+ # object prerequisites when classifying why it is out of date.
51
+ ######
52
+ CODERMAKE_LIST_OUT_PREFIX := build/
53
+
54
+ ######
55
+ # Why a target is out of date, evaluated per record:
56
+ #
57
+ # missing - the marker does not exist; a build creates the object
58
+ # changed - one of the target's own source prerequisites is newer
59
+ # dependent - out of date only because a prerequisite object is being rebuilt
60
+ #
61
+ # Under -n, $? also lists prerequisites make only PRETENDS it remade, so the
62
+ # discriminator is whether anything outside the output tree is newer.
63
+ #
64
+ # With -B (--always-make) every target is remade by definition and the
65
+ # distinction is meaningless.
66
+ ######
67
+ CODERMAKE_LIST_REASON = $(if $(wildcard $@),$(if $(filter-out $(CODERMAKE_LIST_OUT_PREFIX)%,$?),changed,dependent),missing)
68
+
69
+ ######
70
+ # Library creation, as a no-op.
71
+ #
72
+ # Every output target carries its library-existence marker as an order-only
73
+ # prerequisite, so the marker needs a rule or make reports "No rule to make
74
+ # target". Listing must not create it: in multi-library mode the marker IS the
75
+ # `build/<lib>.lib/` directory, and leaving one behind would convince a later
76
+ # real build that the library already exists and skip its CRTLIB.
77
+ #
78
+ # A missing order-only prerequisite does not make a target out of date, so this
79
+ # produces no spurious records.
80
+ ######
81
+ ifndef CODERMAKE_LIBRARY_MAP
82
+ build/$(LIBRARY).lib:
83
+ @:
84
+ else
85
+ build/%.lib:
86
+ @:
87
+ endif
88
+
89
+ ######
90
+ # `clean` has no meaning while listing, and the CLI rejects it outright. This
91
+ # stub exists only so the main Makefile's `clean: platform-clean` still resolves
92
+ # at parse time. It cannot usefully fail instead: under -n a recipe is printed,
93
+ # never run, so there is nothing for a failing command to do.
94
+ ######
95
+ .PHONY: platform-clean
96
+ platform-clean:
97
+ @:
@@ -23,11 +23,19 @@ ifndef CODERMAKE_LIBRARY_MAP
23
23
  LIBRARY_PATH := /qsys.lib/$(LIBRARY).lib
24
24
  endif
25
25
 
26
- ifeq (,$(IBMI_HOST))
27
- $(warning Warning: Required variable IBMI_HOST is not set.)
28
- endif
29
- ifeq (,$(IBMI_USER))
30
- $(warning Warning: Required variable IBMI_USER is not set.)
26
+ ######
27
+ # Connection settings. Only warned about when a recipe might actually run:
28
+ # under -n / -q / -t no SSH session is opened, so the variables are genuinely
29
+ # not required and warning about them is noise. CODERMAKE_NO_EXECUTE is set by
30
+ # the CLI for those modes.
31
+ ######
32
+ ifndef CODERMAKE_NO_EXECUTE
33
+ ifeq (,$(IBMI_HOST))
34
+ $(warning Warning: Required variable IBMI_HOST is not set.)
35
+ endif
36
+ ifeq (,$(IBMI_USER))
37
+ $(warning Warning: Required variable IBMI_USER is not set.)
38
+ endif
31
39
  endif
32
40
 
33
41
  ######
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profoundlogic/codermake",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Make wrapper framework for IBM i development that simplifies build rules",
5
5
  "main": "dist/bin/index.js",
6
6
  "type": "module",
@@ -24,9 +24,13 @@ codermake
24
24
  # Build a single target
25
25
  codermake <target> # e.g. codermake mypgm.pgm
26
26
 
27
- # Dry run (show what would build, without building)
27
+ # Dry run (show the commands, without running them)
28
28
  codermake -n
29
29
 
30
+ # List the objects a build would create or replace (no compile, no connection;
31
+ # remote builds only)
32
+ codermake --list-targets
33
+
30
34
  # Clean all build artifacts
31
35
  codermake clean
32
36
 
@@ -36,6 +40,26 @@ codermake --print-rules
36
40
 
37
41
  Build output for each target is logged to `tmp/logs/<target>.log`.
38
42
 
43
+ ## Checking what a change affects
44
+
45
+ `codermake --list-targets` answers "what will my edit rebuild, and in what
46
+ order" without compiling anything or contacting the IBM i. It is available when
47
+ building remotely from Linux or macOS; running codermake locally on IBM i it is
48
+ refused, because there are no build markers to compare against. Each line reports one
49
+ object with its type, target library, source, and why it is affected:
50
+
51
+ - `changed` — one of the object's own sources is newer
52
+ - `dependent` — affected only because something it depends on is being rebuilt
53
+ - `missing` — the object does not exist yet
54
+
55
+ Use it to confirm that an edit reaches the objects intended before running a
56
+ build, and to see the blast radius of a change to shared source such as a `/COPY`
57
+ member. Add `=tsv` or `=json` for machine-readable output. Listing changes
58
+ nothing, so it is always safe to run.
59
+
60
+ After a successful build the list is empty, which makes it a quick check that
61
+ everything intended was actually built.
62
+
39
63
  ## Rules.mk syntax
40
64
 
41
65
  Each source directory contains a `Rules.mk` file that declares build targets and their prerequisites. codermake automatically adds path prefixes (`src/`, `build/`, etc.) based on file extensions -- you write only bare filenames.