Development Topics > Plugin Development

linking files

(1/1)

Vampire:
suppose MyPlugin.h has a dependency on MyClass.h

what's the standard way to link this file in?


[would it be something like:
DEPS = MyClass.h
OBJ = MyPlugin.o MyClass.o
in one of the Makefiles?
]

cannam:
The way the skeleton files in the v2.6 SDK are arranged, the platform-specific stuff goes in Makefile.osx, Makefile.linux etc and the platform-independent stuff goes into Makefile.inc, which is included by the other Makefiles.

In most cases, any header and object files you add are going to be needed regardless of platform, and so should go in Makefile.inc. There are variables PLUGIN_SOURCES and PLUGIN_HEADERS near the top that can be extended with further headers and .c/.cpp files (the .o files will be deduced from the .c/.cpp names) or you can add .o files directly to PLUGIN_OBJECTS further down.

I hope that addresses your question!

Vampire:
thanks Chris! - working well now

I found it useful

1. in Makefile.osx, define a variable
OTHER_SRC_DIR := PathToMyFolder

I actually just added a folder to the 'skeleton' folder example and copied source, but you could add a path to existing source also.

2. in Makefile.inc
CXXFLAGS   := <other flags> -I$(OTHER_SRC_DIR)

3. add to: PLUGIN_LDFLAGS   :=  <other stuff> -framework Accelerate

(as I used the Apple internal framework Accelerate)

4. as Chris explained above
PLUGIN_SOURCES := MyPlugin.cpp $(OTHER_SRC_DIR)/ExtraSrcCode.cpp

Then the command

make -f Makefile.osx

will generate required .o objects


I'm not using gmake (any reason to pursue that on Mac OS X?) over 'make -f ...'?

Navigation

[0] Message Index

Go to full version