-
Notifications
You must be signed in to change notification settings - Fork 163
[hlc] Implement automatic compilation with make and Build.xml templates #706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[hlc] Implement automatic compilation with make and Build.xml templates #706
Conversation
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
For some reason, mingw doesn't like `-I./`, this causes it to be unable to find the includes
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.
Small documentation / default value handling issue:
But adding
If picking a default value is not something we want, it would be nice to list correct values in this error message I think? |
The default value was working before, I just forgot about it with my changes so this should be fixed. Maybe it should be updated though:
Aside from this, the makefile here doesn't support mac at the moment (mac linker doesn't support
|
Yuxiao made me aware of this PR and I'd like to see this made working. Native compilation is the main difficulty I have with HL/C over hxcpp, where everything mostly "just works". I'm not sure what decisions have to be made here, and who has to make them, so I'll just ping @ncannasse and @yuxiaomao and hope for the best! |
At the moment genhl outputs a file that gives all the needed information
then call the haxelib hashlink module. I guess the implementation for auto
compilation would go there
Le mer. 9 avr. 2025, 11:59, Simon Krajewski ***@***.***> a
écrit :
… Yuxiao made me aware of this PR and I'd like to see this made working.
Native compilation is the main difficulty I have with HL/C over hxcpp,
where everything mostly "just works". I'm not sure what decisions have to
be made here, and who has to make them, so I'll just ping @ncannasse
<https://github.com/ncannasse> and @yuxiaomao
<https://github.com/yuxiaomao> and hope for the best!
—
Reply to this email directly, view it on GitHub
<#706 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHZXQFA6XERVJYN4YY7TQL2YTVO3AVCNFSM6AAAAABNO3LKXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOBZGEYDGOBWGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
*Simn* left a comment (HaxeFoundation/hashlink#706)
<#706 (comment)>
Yuxiao made me aware of this PR and I'd like to see this made working.
Native compilation is the main difficulty I have with HL/C over hxcpp,
where everything mostly "just works". I'm not sure what decisions have to
be made here, and who has to make them, so I'll just ping @ncannasse
<https://github.com/ncannasse> and @yuxiaomao
<https://github.com/yuxiaomao> and hope for the best!
—
Reply to this email directly, view it on GitHub
<#706 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHZXQFA6XERVJYN4YY7TQL2YTVO3AVCNFSM6AAAAABNO3LKXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOBZGEYDGOBWGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This adds two new templates to the hashlink support library to simplify hlc compilation:
make
for a regular Makefile, andhxcpp
for a Build.xml. Both of these implement automated compilation, so if you add either of these then an executable is generated automatically:The Makefile is smart so it will only recompile files whose dependencies have changed. I've tested it on Linux and on Windows with mingw.
Like with the Visual Studio templates, on Windows the templates expect a
HASHLINK
environment variable to point to the hashlink installation. With the Build.xml template, the installation can also point to the hashlink sources, provided that they contain binaries generated byhl.sln
.