Using Shared Libraries of Code with Multiple PSoC1 Projects | Cypress Semiconductor
Using Shared Libraries of Code with Multiple PSoC1 Projects
I've been working on a shared library of code for PSoC1/3/5 and needed to be able to reference
a shared respository of source code and include files that are located outside my project directory.
It took a little experimenting, but I did find a good solution, and will describe it below.
Solution description :
You have library of shared source code that you would like to re-use in several PSoC1 projects.
This library takes the form of :
C:/my_lib/include /* include (*.h) files */
C:/my_lib/src /* source (*.c) files
You would like these include file and source file to be part of several PSoC1 projects,
however, if you do a "Project -> Add File" in the PSoC Creator, it COPIES the files
to the local project directory, such that changes made in project are no longer reflected in
other projects. What you want is a "shared source code library".
For each of the projects that wants to use the "shared source code library",
do the following :
1) "Project -> Open local.mk for "YourProjectName" Project"
This will open a text edit window with a copy of that project's "local.mk" file.
2) Cut and paste the attached "local.mk" file into the text window,
and make whatever changes you need for your particular library path
and source file names.
3) "File -> Save All"
4) "Build -> Generate/Build 'YourProjectName' Project"
Now all of your include files will get included during compilation, and all of your source "C" files will get
compiled and built into your projects.