tcbuilder 1.1.5 → 1.1.6

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.
package/dist/tcbuild.d.ts CHANGED
@@ -10,23 +10,12 @@ declare global {
10
10
  var build: typeof _build;
11
11
  var extExecutable: typeof _extExecutable;
12
12
  var extFlags: typeof _extFlags;
13
+ var extSuffix: typeof _extSuffix;
13
14
  var groupFinalExecutable: typeof _groupFinalExecutable;
14
15
  var groupFinalExecutableSuffix: typeof _groupFinalExecutableSuffix;
15
16
  var groupFinalFlags: typeof _groupFinalFlags;
16
17
  var groupFile: typeof _groupFile;
17
18
  var group: typeof _group;
18
- var debExtExecutable: typeof extExecutable;
19
- var relExtExecutable: typeof extExecutable;
20
- var debExtFlags: typeof extFlags;
21
- var relExtFlags: typeof extFlags;
22
- var debGroupFinalFlags: typeof groupFinalFlags;
23
- var relGroupFinalFlags: typeof groupFinalFlags;
24
- var debGroupFinalExecutable: typeof groupFinalExecutable;
25
- var relGroupFinalExecutable: typeof groupFinalExecutable;
26
- var debGroupFinalExecutableSuffix: typeof groupFinalExecutableSuffix;
27
- var relGroupFinalExecutableSuffix: typeof groupFinalExecutableSuffix;
28
- var debGroupFile: typeof groupFile;
29
- var relGroupFile: typeof groupFile;
30
19
  }
31
20
  declare function _build(name?: string): Promise<void>;
32
21
  type StringKeyValue = Record<string, string>;
@@ -47,6 +36,7 @@ type Group = {
47
36
  };
48
37
  declare function _extExecutable(ext: string, exec?: string): string;
49
38
  declare function _extFlags(ext: string, flags?: string): string;
39
+ declare function _extSuffix(ext: string, suffix?: string): string;
50
40
  declare function _groupFinalFlags(flags: string, toBeRemoved: string): string | undefined;
51
41
  declare function _groupFinalExecutable(exe: string): string | undefined;
52
42
  declare function _groupFinalExecutableSuffix(suffix: string): string | undefined;
package/dist/tcbuild.js CHANGED
@@ -46,66 +46,9 @@ async function _build(name = '') {
46
46
  global.build = _build;
47
47
  const globalExtExecutable = {};
48
48
  const globalExtFlags = {};
49
+ const globalExtSuffix = {};
49
50
  global.groups = {};
50
51
  let currentGroup = null;
51
- global.debExtExecutable = (...args) => {
52
- if (is_debug)
53
- return extExecutable(...args);
54
- return '';
55
- };
56
- global.relExtExecutable = (...args) => {
57
- if (!is_debug)
58
- return extExecutable(...args);
59
- return '';
60
- };
61
- global.debExtFlags = (...args) => {
62
- if (is_debug)
63
- return extFlags(...args);
64
- return '';
65
- };
66
- global.relExtFlags = (...args) => {
67
- if (!is_debug)
68
- return extFlags(...args);
69
- return '';
70
- };
71
- global.debGroupFinalFlags = (...args) => {
72
- if (is_debug)
73
- return groupFinalFlags(...args);
74
- return '';
75
- };
76
- global.relGroupFinalFlags = (...args) => {
77
- if (!is_debug)
78
- return groupFinalFlags(...args);
79
- return '';
80
- };
81
- global.debGroupFinalExecutable = (...args) => {
82
- if (is_debug)
83
- return groupFinalExecutable(...args);
84
- return '';
85
- };
86
- global.relGroupFinalExecutable = (...args) => {
87
- if (!is_debug)
88
- return groupFinalExecutable(...args);
89
- return '';
90
- };
91
- global.debGroupFinalExecutableSuffix = (...args) => {
92
- if (is_debug)
93
- return groupFinalExecutableSuffix(...args);
94
- return '';
95
- };
96
- global.relGroupFinalExecutableSuffix = (...args) => {
97
- if (!is_debug)
98
- return groupFinalExecutableSuffix(...args);
99
- return '';
100
- };
101
- global.debGroupFile = (...args) => {
102
- if (is_debug)
103
- return groupFile(...args);
104
- };
105
- global.relGroupFile = (...args) => {
106
- if (!is_debug)
107
- return groupFile(...args);
108
- };
109
52
  //
110
53
  function _extExecutable(ext, exec) {
111
54
  if (currentGroup === null) {
@@ -143,6 +86,17 @@ function _extFlags(ext, flags) {
143
86
  return '';
144
87
  }
145
88
  global.extFlags = _extFlags;
89
+ function _extSuffix(ext, suffix) {
90
+ if (!globalExtSuffix[ext])
91
+ globalExtSuffix[ext] = '';
92
+ if (suffix) {
93
+ globalExtSuffix[ext] = suffix;
94
+ return suffix;
95
+ }
96
+ else
97
+ return globalExtSuffix[ext];
98
+ }
99
+ global.extSuffix = _extSuffix;
146
100
  function _groupFinalFlags(flags, toBeRemoved) {
147
101
  if (!currentGroup)
148
102
  throw 'any group function called outside of group';
@@ -243,7 +197,7 @@ process.once('beforeExit', async () => {
243
197
  continue;
244
198
  const file = group.files[fileName];
245
199
  const fileLastExt = fileName.split('.').pop();
246
- let obj_out = `${build_dir}/${fileName}.o`;
200
+ let obj_out = `${build_dir}/${fileName}${globalExtSuffix[fileLastExt] ? `.${globalExtSuffix[fileLastExt]}` : ""}`;
247
201
  if (file.includeInFinalOutput)
248
202
  objects += ` ${obj_out}`;
249
203
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tcbuilder",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "Build System",
5
5
  "homepage": "https://github.com/umutfahriozkan/tcbuild#readme",
6
6
  "bugs": {