-ggdb3 make slightly bigger .elf files, but allows gdb to understand
macros, which libopenocm3 uses somewhat extensively. Make this the
default, and pull it up to the common base makefile, so it can be easily
substituted.
When full path of a source directory has spaces in it, that makes
shell and Make split the path, so special treatment is
necessary. Additionally, @F doesn't honour the escaping, so has to be
avoided.
Reported-by: Roman Faizullin <roman@faizullin.info>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Use fixed variables for things that can't change, instead of variables
like SRCLIBDIR that was causing a shell call for every single use.
Use less functions in general and less shell expansions.
Use builtin functions like $(realpath blah) instead of $(shell
pwd)/blah In particular, this was important for me trying to build on
windows with git-shell. This should help a lot on smaller build
machines, but doesn't make a huge difference on my own.
Remove redundant clean print messages. These also cause more needless
shell expansions.
the "make clean" target showed a constant "stm32/f1" debug message
instead of the current relative directory. this is fixed by showing the
relevant portion of the current directory instead, relevant being
determined by evaluating the current makefile's relative position and
stripping that part off.
vector.o, nvic.o, scb.o and assert.o are available on every platform,
but at least some of them differ between the implementations. they
already got built explicityly on some platforms; now adding them to the
common Makefile.include.
Add object files to Makefile to include new modules into lib.
Correct typo in pwr.c
Add two new functions to timer.c to preset the counter (for use
with deadman style timeouts) and to identify an interrupt
source.
Also noticed lib/makefile.include didn't clean lib/stm32, which
isn't a target. Added a fix.
- The library files are now being built into the lib subdirectory of the
source.
- The linker files for each library are being copied into the lib source
subdirectory.
Motivation: The relative locations of files in the source directory after make
are now the same as after make install now. This makes it easier to
reuse examples with their makefiles outside of the libopencm3
sourcecode directory.
Changed the license to LGPL3+ for some makefiles that got ommited in the
previous big patch commit.
Corrected a find and replace error in a linker file.
This is the first working example code which is tested on hardware.
The LED on the Olimex STM-H103 eval board is happily blinking.
We use a dummy "delay" function (basically a busy-waiting for-loop), which
will only work if you use -O0 in CFLAGS (-O2, -O3, or -Os will not work as
the compiler optimizes the loop away).
We use some arbitrary value for stack size (2 KB) and use main()
directly as the reset vector function. This will change later.
Also, we do the GPIO and clock init as well as the GPIO toggling for the
LED blinking fully "manually" for now, but there may be more higher-level
functions for doing that at some later date.
This is intended as a small blink example for the Olimex STM32-H103 board.
It doesn't do anything useful (yet), but it builds fine.
There's a sample Makefile and a preliminary ld script (which probably
needs some more work).