This repository has been archived by the owner on Feb 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Modular build system #15
Open
matheusmoreira
wants to merge
155
commits into
master
Choose a base branch
from
modular-build-system
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
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
This information is specific to the project being built and doesn't belong in the make/ directory.
This makes it easy to use true and false values anywhere in makefiles.
This function converts a value to a truth value.
This is basic and extremely useful functionality that simply isn't provided by make.
False values are empty. This is an inconvenient representation. Outputting an empty variable can be confusing. A symbol that represents false, though logically true, is much better.
This function converts a value to its symbolic truth value. Useful when outputting a boolean variable as text.
This allows a project to specify the C standard it wants to use while at the same time providing a sensible default.
The new C.freestanding make variable can be set in order to turn on freestanding mode.
Files are defined as entries that are not directories for the purposes of the build system.
Also a good opportunity to improve the documentation and convert the result to a boolean value.
This function augments make's built-in wildcard function with a default value, sorting and duplicate removal.
This function applies the given function recursively to compute results.
This allows better documentation of the semantics of the default value and reuse of the default value by functions building on top of glob.
"The specified pattern" is too verbose for the short description of the returned value. It's better to refer to the first argument.
This function lists all matching entries in the given directories. By default, it operates on the current directory.
This function walks the file system recursively, returning all paths it finds. Should be useful to build lists of all kinds of files.
Fixes a bug where directory? would always return true if called without any arguments. That happens because the variable would be empty, and the "/." path would have no prefix. The root directory is always a directory by definition.
This allows the user of the function to pass in more than one path. In this case, it will return true if any path refers to a directory.
This function finds all files that satisfy the given predicate function. Extremely useful for finding source files.
These variables are specific to each project. They don't belong in a modular build system.
This variable is specific to each project. It doesn't belong in a modular build system.
This variable is specific to each project. It doesn't belong in a modular build system.
These variables are specific to each project. They don't belong in a modular build system.
When find was invoked with a predicate function, the result was the empty string for every path that did not satisfy the predicate function. This resulted in a lot of extraneous white spaces in the positions the paths would have otherwise occupied. Stripping the result gets rid of the spaces. The recurse and file_system.traverse functions didn't need this fix because they always return elements in each iteration of foreach. There are no spaces to strip out.
These variables are specific to liblinux.
This variable belongs with the other variables defining the build tree.
These variables are specific to liblinux.
These variables are specific to liblinux.
The library and object rule template functions now propagate additional dependencies to the general rule template function. This brings those functions to feature parity with the executable rule template function.
The scripts and libraries/start nodes no longer exist in the build tree. These variables are not used anymore.
This function joins all values of the given list. It's called coalesce because GNU make already defines a join function.
This variable represents the file system path separator. It can be customized on systems that don't use forward slash.
This function joins elements of a list to form a new file system path.
This allows customizing the name of the configuration directory.
It takes the value of the configuration variable into account, leaving its definition to the user of the build system. It is now possible to customize the configuration variable. If left undefined, the build system will simply not create configuration directories in the build tree.
Should make it easier to work with the build tree.
The first step towards revamping the compiler interface.
The compiler makes a huge difference in the output. The build configuration should contain the chosen compiler when multiple compilers are supported by the project.
This function generates a GCC command line that links objects and produces an executable or dynamic library.
Now the project can specify the compiler and linker options. All lists of compiler and linker options are merged. The most specific compiler and linker choices are applied. This allows multiscope configuration of compilation and linking.
These symbols are no longer used after the compiler interface redesign.
Now they use a dot to denote the hierarchy of their values.
These variables are too specific to be applicable to the build system's compiler interface. They will be provided by the user.
The build system interface has been redesigned around a project specification in the form of variables whose names follow a specific pattern. Projects contain targets, which can be of any supported type. The build system will generate all the rules based on the specification. The new rule generation interface allows specifying compiler flags for the whole project, for individual targets and even individual files. The generated rules do not depend on the build system framework, letting the user configure the build by writing them out to a makefile. Users can now specify which variables form a build configuration.
Remove reference to the undefined build_scripts_directory variable. Doesn't make sense to have a scripts directory in the build tree, so the location of the targets is now its root. Directories are now created unconditionally.
This allows a list of files to be passed, including empty lists.
Now the GCC executable can be passed as parameter.
It is no longer being referenced by any makefile.
Optimization and instrumentation options are application-specific.
Make the description of the return value more accurate.
Make the description of the return value more accurate.
It is no longer being referenced by any makefile.
The ensure_target_directory_exists function is easier to understand compared to directory creation commands.
This eliminates the need to reverse the list later, simplifying the already rather complicated functions. The executable and library targets don't add their outputs to the build stack because their symbolic names are enough to represent the outputs.
Handle empty namespace lists: just call resolve.name directly. Reimplement resolve.first in terms of the new function.
This makes the function names more consistent.
These functions resolve variables in caller-provided namespaces as well as an implicit global namespace. One merges the results while the other does not. Only the values in the global namespace are meant to be inheritable. Other namespaces override each other according to their order.
Now only values present in the global namespace are inherited.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The build system has the potential to be a reusable framework. It should be split into its own git repository.
make/
and into.make/
.make/
and intomake/
.make/
directory into its own git repository.make/
directory with a git submodule