adamgreen / gcc4mbed

Project to allow GCC compilation of code using mbed SDK libraries.
172 stars 68 forks source link

Add external sources directory #37

Closed garyservin closed 9 years ago

garyservin commented 9 years ago

Hi, I'm trying to add an external directory which contains some source files for a project, my project's folder structure is the following

The makefile has the following

PROJECT         := HelloWorld
DEVICES         := LPC1768
GCC4MBED_DIR    := <gcc4mbed_path>
NO_FLOAT_SCANF  := 1
NO_FLOAT_PRINTF := 1

include $(GCC4MBED_DIR)/build/gcc4mbed.mk

If my_lib folder is inside each project folder I can compile it fine, but it weights about 5M so it's not practical to have it copied in each directory. I would like to have something like

Is there a simple way to do this in the makefiles?

Thanks in advance!

adamgreen commented 9 years ago

There is currently no support for this in gcc4mbed. You currently have to do this the way that you originally describe.

I will keep this issue open to consider for the next gcc4mbed release. It should be possible to do this in a fashion similar to how the mbed SDK libraries are built.

Thanks,

Adam

adamgreen commented 9 years ago

I have added USER_LIBS support with commit bd4695b2fae2bf96dbf71edb2aeb66de233b0859 in the working branch. I will close this issue once I have merged into master during the next release.

garyservin commented 9 years ago

Wow! this is awesome! thanks! =D

adamgreen commented 9 years ago

Now merged into master.

daniel-bub commented 8 years ago

Hi Adam,

I do have an issue with the USER_LIBS parameter in case a lib contains subfolders with relevant source files. I just exported the HTTPClient lib from the old mbed website, which uses source-subfolders. Is there a quick fix for this?

Thanks,

Daniel

Update: Nevermind. I found a configuration issue on my side.