Commit 0f3bc39
[hlc] Implement automatic compilation with make and Build.xml templates (#706)
* Add Makefile hlc template
* Add hxcpp Build.xml hlc template
* Automate Makefile and Build.xml template builds
* Fix header file check when hlgen.makefilepath is set
* Avoid duplicate slashes in paths in hlc templates
* Avoid passing -std=c11 on MSVC in build.xml
* Add HASHLINK variable based paths in Build.xml
* Support debug builds with Build.xml template
* Improve makefile template
Use LDLIBS for passing libraries to the linker:
https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html#index-LDLIBS
Compile .c files into separate .o files to avoid recompiling the entire
project every time. Use .d files to keep track of .c files that
depend on .h files. For reference:
https://stackoverflow.com/a/52036564
* Add warning about auto generated makefile
* Add mingw support for makefile template
* Fix include path in generated makefile for mingw
For some reason, mingw doesn't like `-I./`, this causes it to be unable
to find the includes
* Keep makefile tmp files within hlgen.makefilepath
Previously it would always generate them next to the .c files,
regardless of whether hlgen.makefilepath had been set. Now it ensures
that it doesn't write outside of the Makefile directory.
This means that it first has to create the directories, otherwise the
compiler complains about directories not existing when it tries to
write the output files.
".SUFFIXES" also has to be set as an empty target, otherwise the built-
in rules mess up the rule dependencies.
* Allow HASHLINK for makefile template on linux/mac
* Simplify mingw flags for makefile template
* Let vs2019, vs2022 template build with makefile provided
* Makefile: generate separate linking flags for mac
* Add hlgen.makefile suggestion based on systemName
---------
Co-authored-by: Yuxiao Mao <[email protected]>1 parent 2834237 commit 0f3bc39
3 files changed
+120
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
27 | | - | |
28 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
29 | 49 | | |
30 | | - | |
| 50 | + | |
31 | 51 | | |
32 | 52 | | |
33 | 53 | | |
| |||
36 | 56 | | |
37 | 57 | | |
38 | 58 | | |
39 | | - | |
| 59 | + | |
40 | 60 | | |
41 | 61 | | |
42 | 62 | | |
| |||
45 | 65 | | |
46 | 66 | | |
47 | 67 | | |
48 | | - | |
49 | 68 | | |
50 | 69 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 70 | + | |
| 71 | + | |
54 | 72 | | |
55 | 73 | | |
| 74 | + | |
56 | 75 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
62 | 80 | | |
63 | | - | |
| 81 | + | |
64 | 82 | | |
65 | 83 | | |
66 | 84 | | |
| |||
76 | 94 | | |
77 | 95 | | |
78 | 96 | | |
79 | | - | |
| 97 | + | |
80 | 98 | | |
81 | 99 | | |
82 | 100 | | |
| |||
98 | 116 | | |
99 | 117 | | |
100 | 118 | | |
101 | | - | |
| 119 | + | |
102 | 120 | | |
103 | 121 | | |
104 | 122 | | |
| |||
143 | 161 | | |
144 | 162 | | |
145 | 163 | | |
146 | | - | |
| 164 | + | |
147 | 165 | | |
148 | 166 | | |
149 | 167 | | |
| |||
172 | 190 | | |
173 | 191 | | |
174 | 192 | | |
175 | | - | |
| 193 | + | |
176 | 194 | | |
177 | 195 | | |
178 | 196 | | |
| |||
183 | 201 | | |
184 | 202 | | |
185 | 203 | | |
186 | | - | |
| 204 | + | |
187 | 205 | | |
188 | 206 | | |
189 | 207 | | |
190 | 208 | | |
191 | 209 | | |
192 | 210 | | |
193 | | - | |
| 211 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
0 commit comments