Commit Graph

15 Commits

Author SHA1 Message Date
Denis Feklushkin f5192dbcb5 mk: genlink: simplify variable usage 2020-11-28 22:13:25 +00:00
Darrell Harmon 3c34f0033c genlink: avoid creating blank linker script if gcc fails
When piping to a file, if arm-none-eabi-gcc is not present in the path,
a blank linker script is created with genlink. After sourcing a bash
script to add GCC to the path, the linker script doesn't get rebuilt
due to a fresh timestamp despite failing to generate.
2019-12-11 09:42:05 +00:00
Karl Palsson f700781975 genlinkk-config: fix missing .a suffix
Fixes: 96d094af13 mk/genlink-config: provide LIBNAME in devices autogeneration

The initial fix had fixed the examples repo, but broke the tests and the
template repo.  Restore the suffix properly.
2019-05-25 21:28:04 +00:00
Karl Palsson 96d094af13 mk/genlink-config: provide LIBNAME in devices autogeneration
This makes the generic rules workk happily regardless of whether the
linkerscript generation is being used or not.

Notably, in the examples repo, use of the linker script autogeneration
was retriggering library builds as LIBNAME was unset and therefore the
libraries lib<blank>.a couldn't be found.
2019-05-22 12:09:35 +00:00
Christian Tacke d14033c744 genlink: provide LIBDEPS for libopencm3 itself
If $(OPENCM3_DIR)/lib/libopencm3_*.a exists, it will be linked in.
If we do that, we should also add it to the deps.
That way a newer *.a will result in a relink.

To use this, you should add a dependency to $(LIBDEPS) where you are
using $(LDFLAGS) and $(LDLIBS) now.

eg, old (wouldn't relink if the library changed)

$(PROJECT).elf: $(OBJS) $(LDSCRIPT)
        @printf "  LD\t$@\n"
        $(Q)$(LD) $(TGT_LDFLAGS) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@

new (will relink when the library changes)

$(PROJECT).elf: $(OBJS) $(LDSCRIPT) $(LIBDEPS)
        @printf "  LD\t$@\n"
        $(Q)$(LD) $(TGT_LDFLAGS) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@

Tested-by:  Karl Palsson <karlp@tweak.net.au>

Originally tracked via: https://github.com/libopencm3/libopencm3/pull/887
2018-08-17 00:15:01 +00:00
George Jiglau 396701808d genlink: Rewrite genlink script from awk to python
This removes the dependency on awk and should fix #732
python was already a dependency, for the irq generation
2018-04-14 18:40:54 +00:00
Christian Tacke 0b3adfb9b3 Let the created ld script depend on devices.data
If devices.data changes, rebuild the linker scripts, so they have all the
new information in it.
2018-02-22 21:38:56 +01:00
Karl Palsson 953bf531ea awk->gawk: Make the gawk dependency explicit
Until https://github.com/libopencm3/libopencm3/issues/732 has been
fixed, it's not enough to just have it in the README that you need GNU
awk.  Explicitly use the "gawk" command name.  This exists on (sane)
systems that have gawk as awk, and for systems that use mawk as default,
the gawk name should also exist.

This should make it significantly easier to diagnost the cause of build
problems.
2017-11-19 20:52:05 +00:00
Karl Palsson 13d430268a genlink: stop silencing errors
The $() form only captures stdout anyway, so explicitly silencing stderr
simply meant we lost useful debug information when things went wrong.
2016-08-18 22:08:59 +00:00
Karl Palsson e2dbcd7653 genlink: use a "generated" prefix on files made
This makes it easier to gitignore them, and clean them
2016-08-18 22:07:36 +00:00
Jonas Meyer 6aeb55c5d7 mk rules: Improve behaviour when DEVICE is set to family. Improved Warning
The warning now uses family instead of subfamily, which is available
sooner.
2016-08-18 22:07:36 +00:00
Jonas Meyer c025dc0327 mk/genlink: change devices.data format to remove gcc specific options
As discussed with karlp on irc the devices.data file should not contain
gcc specific command line options.

For that reason the command line options for gcc are now generated from
the variables CPU and FPU by the rules in the mk directory.

This breaks the genlink tests.

genlink: simplified devices.data

devices.data already had the information about the family name.
By using the first field (by the pattern used to match it) as family name information that data doesn't
have to be provided explicitly. The same data is used to generate the
CPPFLAGS, such as -DSTM32F1

The architectures block of the devices.data file was redundant.

genlink-config.mk uses family and subfamily to figure out which libopencm3
variant actually exists.
2016-08-18 22:07:36 +00:00
Anatol Pomozov ae41782e1a Fix misspellings using codespell tool 2016-03-08 08:52:54 -08:00
Frantisek Burian cac25258e1 * [BUILD] Add build system module GENLINK, update README how to use it. 2014-02-07 07:47:54 +01:00
Frantisek Burian 78eff1210e [BUILD] Add build system module makefiles, add README how to use it. 2014-02-07 07:47:54 +01:00