Skip to content

Commit

Permalink
[build] Relicense top-level build script to BSD
Browse files Browse the repository at this point in the history
These scripts are intended to be modified by the user for their project
without the need to publish their changes to it.
  • Loading branch information
salkinium committed May 8, 2021
1 parent 72d6564 commit 98b1337
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 22 deletions.
8 changes: 5 additions & 3 deletions tools/build_script_generator/make/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ applications:
- a `modm/config.mk` file: configures the toolchain, device-specific information
and sets up generic and special build rules based on the `modm:build` options.
- a `modm/repo.mk` file: contains all build rules to build the modm library.
- a top-level `Makefile` file: globs the application sources and provides all
the Makefile targets for the device-specific embedded tools.
- a top-level BSD-licensed `Makefile` file: globs the application sources and
provides all the Makefile targets for the device-specific embedded tools.

We do not intend to serve every possible use-case with this module.
**If you need something special, write your own Makefile, maybe starting by
modifying ours.**
modifying ours.** It is intentionally BSD-licensed so that you do not have to
publish your changes to it.

Remember to set `modm:build:make:include_makefile` to `False`, so that your
custom `Makefile` does not get overwritten by `lbuild build`.

Expand Down
23 changes: 19 additions & 4 deletions tools/build_script_generator/make/resources/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
# Copyright (c) 2021, Niklas Hauser
#
# This file is part of the modm project.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

%% if is_unittest
unittest_runner.cpp:
Expand Down
14 changes: 8 additions & 6 deletions tools/build_script_generator/scons/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ This module generates two files:
- a `modm/SConscript` file: configures all required SCons tools with
the right settings (also using information from the `modm:build` module) to
compile the modm library.
- a top-level `SConstruct` file: configures additional, optional tools and sets
up all the relevant SCons functions for your target.
- a top-level BSD-licensed `SConstruct` file: configures additional, optional
tools and sets up all the relevant SCons functions for your target.

The `SConscript` file is self contained and does not depend on anything outside of
the `modm/` directory. This allows it to be combined with `SConscript` of other
Expand All @@ -20,12 +20,14 @@ In fact, if you look at your generated `SConstruct` file, you'll notice that
it doesn't contain a lot of logic or specific data, it is only meant for calling
the right SCons tool with the right arguments.

We do not intend to serve every possible use-case with this module.
**If you need something special, write your own SConstruct file, maybe
starting by modifying ours.**
We do not intend to serve every possible use-case with this module. **If you
need something special, write your own SConstruct file, maybe starting by
modifying ours.** It is intentionally BSD-licensed so that you do not have to
publish your changes to it.

Remember to set `modm:build:scons:include_sconstruct` to `False`, so that your
custom `SConstruct` does not get overwritten by `lbuild build`.
See the instructions inside our generated default `SConstruct`.
See the instructions inside our generated default `SConstruct` file.


## SCons Methods
Expand Down
31 changes: 22 additions & 9 deletions tools/build_script_generator/scons/resources/SConstruct.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
# Copyright (c) 2017-2018, Niklas Hauser
# Copyright (c) 2017-2021, Niklas Hauser
#
# This file is part of the modm project.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

#!/usr/bin/env python3
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import os
from os.path import join, abspath
Expand Down Expand Up @@ -36,15 +49,15 @@ sources = []

%% if has_image_source
# Generating image sources
env.Append(CPPPATH="{{ image_source }}")
env.Append(CPPPATH=abspath("{{ image_source }}"))
ignored.append("{{ image_source }}")
for image in env.FindFiles("{{ image_source }}", ".pbm"):
source, _ = env.Bitmap(str(image))
sources.append(source)
%% endif
%% if has_xpcc_generator
# Generating XPCC sources
env.Append(CPPPATH="{{ generator_path }}")
env.Append(CPPPATH=abspath("{{ generator_path }}"))
ignored.append("{{ generator_path }}")
sources += env.XpccCommunication(
xmlfile=abspath("{{ generator_source }}"),
Expand Down

0 comments on commit 98b1337

Please sign in to comment.