Skip to content
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

Replace existing build system with make #51

Merged
merged 36 commits into from
May 14, 2022

Conversation

mkilgore
Copy link
Contributor

@mkilgore mkilgore commented May 12, 2022

This replaces all of the various existing scripts and compile lines with a single Makefile. This has a few big benefits:

  1. Drastically reduces the complexity and duplication of the compilation lines. We have way too many files that include random g++ lines that are slightly different from each other, and that along with ones in qb64.bas makes it very hard to handle any kind of build changes.
  2. QB64 itself can be built using the exact same build scripts as regular programs, by simply passing BUILD_QB64=y to make.
  3. Makes it extremely easy to start splitting up the C++ code, as make can be used to easily compile separate source files and link them all together in the end without us having to do much work.

Obviously this is a fairly large change. I add a fair amount more testing to verify this change does work - I have tests for every different optional dependency, along with DATA, $EXEICON, $CONSOLE:ONLY and some others. The biggest potential question mark is weird DECLARE LIBRARY usages that I wasn't able to make tests for (I may have gotten them all, but it's somewhat poorly documented so I'm not so sure.


For the moment I'm going to leave this PR as a draft and ask some on the forum to give this a test as a bit of a sanity check. Please give the PR a look when you have time :)

Closes: #33

Edit: Note that due to ./internal/source still housing a QB64 that uses all the existing build scripts, they can't be removed in this PR. It doesn't matter that much though as the make logic doesn't care if they are still there, and I'll submit a separate PR after this one to remove all those scripts after ./internal/source is updated to use make.

The purpose of moving the EXEs is so that they are not captured in the
build artifacts. They would be nice to have, but they end up being a few
hundred MBs in size so much too large to bother saving.
The Makefile was incorrectly tying together _ICON and icon.rc, making it
impossible to use one without the other. To fix this we introduce a new
DEP_ICON_RC flag, which indicates we need to use the icon.rc file (in
addition to regular icon support). DEP_ICON now only indicates we need
to support _ICON, and does not attempt to build the resource
information.
The GitHub runners do not have any sound cards available. We could
potentially install a dummy one but that's a bit too much work right
now.
@mkilgore mkilgore added the enhancement New feature or request label May 12, 2022
@mkilgore mkilgore requested review from a user and SteveMcNeill May 12, 2022 04:56
@mkilgore mkilgore marked this pull request as ready for review May 12, 2022 21:24
@@ -0,0 +1,10 @@

QB_LIBQB_SETUP_OBJS := $(PATH_INTERNAL_C)/libqb.o

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized after looking it over that this file isn't actually getting used. I will be using this file in upcoming changes to work on splitting apart libqb but I'll remove it from this PR.

#
# This is important for libraries, since they could potentially be referencing
# things from our dependencies
CXXFLAGS += $(CXXFLAGS_EXTRA)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that related to #53 the new Makefile approach does not strip the executables, it's missing that flag. I should add that back as not doing that adds a significant size to the executables, but I'm thinking I may just try to do #53 as part of this change.

@mkilgore mkilgore added this to Review in progress in Backlog/In Progress May 14, 2022
Copy link
Member

@SteveMcNeill SteveMcNeill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing glaringly obvious stands out to me as being off here. I think you're good to go, when you feel ready to pull and merge. ;)

We'll turn this on later when we have it better sorted out.
The symbol file is a file that aids in debugging by allowing a crash
dump from a stripped executable to have it's symbols applied to it. The
file itself ends up in ./internal/temp after compilation and is called
`EXEFILE.sym`.

FIxes: QB64-Phoenix-Edition#53
On Windows we don't distribute the ./setup_win.bat, so the contents of
./internal/source are not actually relevant for them. Since the QB64
symbol file will be located in it though, it is important that they get
an updated copy. It does also just make basic sense that if we're
distributing an ./internal/source with the Windows version it should
match whatever QB64 it was shipped with.
@mkilgore mkilgore merged commit 6bc35d3 into QB64-Phoenix-Edition:main May 14, 2022
Backlog/In Progress automation moved this from Review in progress to Done May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

Replace existing build logic and build scripts with Make
2 participants