Skip to content

Commit e00f7f6

Browse files
committed
Fix to makefile generation for multi module
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
1 parent 907ca64 commit e00f7f6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

cli/src/targets.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,8 @@ export class Targets {
14731473
imports: currentTarget.imports,
14741474
exports: [],
14751475
type: `MODULE`,
1476-
relativePath: basePath
1476+
relativePath: basePath,
1477+
extension: path.extname(basePath).substring(1)
14771478
};
14781479

14791480
// Replace the old resolved object with the module

cli/test/multiModule2.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,14 @@ describe.skipIf(files.length === 0)(`multi_module_two tests`, () => {
5555
expect(deps.some(d => d.systemName === `CUSTOMER`)).toBeTruthy();
5656
expect(deps.some(d => d.systemName === `DATA`)).toBeTruthy();
5757
});
58+
59+
test(`Check makefile result`, async () => {
60+
const project = new MakeProject(cwd, targets);
61+
62+
const targetContent = project.getMakefile();
63+
64+
expect(targetContent).toContain(`$(PREPATH)/RUNNER.PGM: $(PREPATH)/DB.MODULE $(PREPATH)/RUNNER.MODULE $(PREPATH)/DATA.MODULE`);
65+
expect(targetContent).toContain(`\tsystem "CRTPGM PGM($(BIN_LIB)/RUNNER) ENTMOD(RUNNER) MODULE(DB RUNNER DATA) TGTRLS(*CURRENT) BNDDIR($(BNDDIR)) ACTGRP(*NEW)" > .logs/runner.splf`);
66+
expect(targetContent).toContain(`$(PREPATH)/RUNNER.MODULE: rpgle/runner.pgm.rpgle`);
67+
});
5868
});

0 commit comments

Comments
 (0)