Update readme for reuse and multi source

This commit is contained in:
Karl Palsson
2018-05-04 09:55:32 +00:00
parent bc9ad8df08
commit 6bca6aaf02

View File

@@ -131,19 +131,27 @@ repository)
git submodule add https://github.com/libopencm3/libopencm3 git submodule add https://github.com/libopencm3/libopencm3
2. Build the library, some of the code is generated.
```
make -C libopencm3 -j5
```
3. Grab a copy of the basic rules 3. Grab a copy of the basic rules
These urls grab the latest from the libopencm3-examples repository These urls grab the latest from the libopencm3-examples repository
wget \ ```
https://raw.githubusercontent.com/libopencm3/libopencm3-examples/master/examples/rules.mk \ wget -O libopencm3.rules.mk \
-O libopencm3.rules.mk https://raw.githubusercontent.com/libopencm3/libopencm3-examples/master/examples/rules.mk
```
4. Grab a copy of your target Makefile in this case, for STM32L1 4. Grab a copy of your target Makefile in this case, for STM32L1
wget \ ```
https://raw.githubusercontent.com/libopencm3/libopencm3-examples/master/examples/stm32/l1/Makefile.include \ wget -O libopencm3.target.mk \
-O libopencm3.target.mk https://raw.githubusercontent.com/libopencm3/libopencm3-examples/master/examples/stm32/l1/Makefile.include
```
5. Edit paths in `libopencm3.target.mk` 5. Edit paths in `libopencm3.target.mk`
Edit the _last_ line of `libopencm3.target.mk` and change the include to read Edit the _last_ line of `libopencm3.target.mk` and change the include to read
@@ -176,6 +184,11 @@ Add the path to OPENCM3\_DIR, and modify the path to makefile include
You're done :) You're done :)
You need to run "make" inside the libopencm3 directory once to build the 7. If you need extra source files, just add them as their object form to your project makefile
library, then you can just run make/make clean in your project directory as ```make
often as you like. ...
BINARY=miniblink
OBJS=extra.o other_extra.o
OPENCM3_DIR=../libopencm3
...
```