Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Dec 12, 2024
1 parent 4aa54ff commit cd8ed7c
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions libs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,18 @@ void jswrap_hello_world() {

You can add more files here if you need. It's up to you!

## Modify the `Makefile`

Find the text
```
# ---------------------------------------------------------------------------------
# When adding stuff here, also remember build_pininfo, platform_config.h, jshardware.c
# TODO: Load more of this out of the BOARDNAME.py files if at all possible (see next section)
# ---------------------------------------------------------------------------------
```
and add those two lines just before it
## Ensure they are built in

In the `BOARD.py` file you're targeting in the `boards` folder, add the following lines to `info.build.makefile`


```make
INCLUDE += -I$(ROOT)/libs/hello
WRAPPERSOURCES += libs/hello/jswrap_hello.c #you can add more files here if your library depend on them
```
'INCLUDE += -I$(ROOT)/libs/hello',
'WRAPPERSOURCES += libs/hello/jswrap_hello.c', #you can add more files here if your library depend on them
```

For instance to build for a 'local' build that'll run on your PC you can add the lines to `boards/LINUX.py`

If you want to make a pull request for your new library you'll need to make a `ifdef` guard for it,
and specify which platforms should have access to your library.
To see it in action, follow the `USE_TRIGGER` definition.

## Compile and test!

Expand Down

0 comments on commit cd8ed7c

Please sign in to comment.