-
Notifications
You must be signed in to change notification settings - Fork 156
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
[hlc] Implement automatic compilation with make and Build.xml templates #706
Open
tobil4sk
wants to merge
15
commits into
HaxeFoundation:master
Choose a base branch
from
tobil4sk:feature/automatic-compilation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[hlc] Implement automatic compilation with make and Build.xml templates #706
tobil4sk
wants to merge
15
commits into
HaxeFoundation:master
from
tobil4sk:feature/automatic-compilation
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
.