-
Notifications
You must be signed in to change notification settings - Fork 64
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
*WIP* Make-based build system #16
Conversation
Anyone tried it? |
I just tried it. Is this meant to replace the existing shell/command script because currently the shell script does a lot more:
Your Makefile appears to only do the last step, and it doesn't copy anything from internal/source to internal/temp, resulting in errors like the following with a fresh checkout:
If I invoke While I understand a Makefile won't do everything listed above, it should at least do steps 2, 4, and 6 in my opinion. I haven't looked at the FreeType stuff in detail, so I'm unsure if that's also a requirement or not. |
We are probably sticking with the default script for now, based on the feedback above. @ismaell: if you have anything else to add to the original pull request that we haven't been able to take into consideration yet, please let me know, or I'l bel closing the request. |
@chronokitsune3233 It's meant to ease packaging for the OS. It could complain about dependencies, but it shouldn't build anything external. Why are sources copied from |
@FellippeHeitor It has been open for quite some time, wouldn't hurt to keep it open some more. I would like to improve it further. |
I never dug into the internals of QB64... Should |
Hey, I saw this and though I'd chime in. I wrote/rewrote the original ./setup_lnx.sh that's in the repo today and I've write a fair amount of Makefiles. It would definitely make sense to replace part of the bulid scripts with a The fact that we don't grab a package for As for making libqb.o a shared object instead, it's not a horrible idea, but it would mean that QB64 executables are not as easily redistributable. Keep in mind that unlike Windows, Linux will not look for All that said, replacing the current build system with |
@ismaell
A brief summary of the process when compiling using the Linux or OS X
And here's what happens when using an existing
I'd say no, given that QB64 currently appears to use a specially encoded filename for libqb object files. The code for it starts at line 11885 of qb64.bas. If there's a way to remove this dependency, perhaps by loading things at runtime (e.g. |
@mkilgore For example, we now have a script Fedora also uses In other words, there's some stuff that could be changed since the last version of the script was completed. Maybe it is time to just use a Makefile after all? 😛 |
That looks great! I'm surprised that it was around back in 2012, ./script_lnx.sh says I wrote it in 2013 (Though that could just be the date of the last update). More wide adoption of /etc/os-release probably happened after I wrote that script, or else I think I would have saw it. That said, while it's probably worth keeping the weird logic in the script as a fallback in the event /etc/os-release doesn't exist, /etc/os-release definitely looks like a much saner way to do things. I would agree the script could use a little updating. That said, I'll be perfectly honestly that I've been a solid Gentoo user for probably 3 or more years now, so I'm a bit out of the loop on what some other distros like Fedora are doing. You would likely know better then I do. I just put a preliminary possible version of the Makefile system in this branch: It ended up being fairly more involved then I expected when first starting, but my build system replaces a decent amount of the logic in qb64.bas that involves the building. The only thing I don't currently have supported is To clarify how my build system works, essentially you specify the name of the program to compile in the EXE variable, and then set the dependencies it has through a bunch of
I also added a convenience flag to the |
@mkilgore Would you mind to work with me towards a portable I can extend my implementation to include all |
@ismaell As far as making it portable, I'm pretty sure mine is already pretty portable, though it definitely needs testing. The idea was that eventually we could just pass If you want to try running it on Windows, you could just copy the I think the harder part will be retrofitting this into qb64.bas. The compilation logic there is a bit screwy, and it generates scripts and then runs them to compile the source, so it's important that we ensure there aren't any weird cases we're not handling. It shouldn't be too bad, but still. |
I had surprisingly quick success getting it to work on "Windows" (Though I'm just testing in Wine). It took me a bit to figure out where qb64.bas was getting all its flags from (./internal/c/makeline_win.txt) but it's not too bad. Right now everything is compiled into the /os/lnx folders, since that was the quickest way to get things working. I also add basic support for OSX, but it's untested. I think the big thing now is looking at converting qb64.bas to use |
@mkilgore Hi, Matt. It's nice to see you around. Given how long ago your last contribution was I didn't even consider bringing you into this PR initially, for which I apologize. Turns out your contribution was solid enough not to require you to step back in for four years :-) Good to have you with us. |
@mkilgore It uses features specific to A portable
So you can do something like |
Ah, I see your point. I'm open to doing that, is there a reason for supporting bmake though? There is more GNU specific stuff then just the 'if' lines, and all the platforms QB64 supports have easy access to GNU make. |
@mkilgore well, just because if a dependency isn't strictly needed, then probably it shouldn't be forced. Let me check what I can do with your implementation. |
That's fair. I guess the way I see it is that we're already likely dependent on GCC anyway, so not having a dependency on GNU make doesn't really get us much. That said, I don't really feel like that's my call to make, so I'm fine with making it more standard make syntax. Your definetely right that it could be cleaned up. I was mostly just focused on duplicating the current functionally correctly. |
I will copy here my comments on the commit for completeness: Conditional rules could be rewritten like this: https://gist.github.com/ismaell/48fc527236888456d83a676d6c1ba9ab. But I would prefer to have a Probably @mkilgore Which way would you prefer to go? |
@ismaell The build.mk files in my change already work for every OS, I just haven't moved them out of the With that said, do we have any way to test OSX? It seems like that might be a problem we're going to run into. @FellippeHeitor |
I can provide testing on macOS. I'm on High Sierra. |
I agree with the process going on here, but for the sake of those systems that dont have a |
Agreed with above, removing build.bat would make building a Windows executable a living hell for 99% of Windows developers. |
Obviously, this project fell a bit off the radar. I don't personally do much with QB64 anymore so while IIRC the
I'm not sure I understand this. We distribute GNU |
Agreed and willing to close. Everybody else, thoughts? |
I very much like the idea of using make to build QB64, in principle at least. However, given that this is ultimately a refactor of an already working process, I don't think I'd be able to find the time or motivation to properly check and integrate this (not at this point in time, anyway). |
We could just rely on
It's common practice to provide scripts for that, but also it's possible to embed a path into the executable (see |
@flukiluke @FellippeHeitor I'm still interested on pursuing this; a clean buildsystem is a must for building packages. Though, it will take me quite some time to catch up with this and other related stuff. |
@ismaell how are you progressing? I'm interested in your Makefile to create official debian/ubuntu packages of qb64. which system will you need the makefile in? currently I didn't find a way to set the path for the 'internal' folder to be /usr/share/qb64 (or /usr/share/qb64) and be only read-only. and tell qb64 to use /tmp or ~/.cache for writing or cache files |
@alexmyczko not at all; life got in the way. I'll post updates here, I've not dropped the idea yet. |
Moved to https://github.com/QB64Team/qb64 |
A more traditional way to build it. Please comment.
The flags might be outdated, it has been over a year, but it still seems to build.
Something not included is a step to remove
../temp/
from the#include
directives, as it didn't seem appropriate to do it there...NOTE: Sadly I couldn't test the result this time as it's producing a segmentation fault.