You could use the Pd-extended build stuff, then only have to maintain one target for all platforms (GNU/Linux, Mac OS X, and Windows) and you get automatic inclusion into Pd-extended, nightly builds on all these platforms, as well as automatic handling of global CPU optimization flags.
Here's a bit for building [hid] from externals/Makefile with some stuff stripped out that's not relevant to what you describe.
-------------
HID_SRC = input_arrays.c hid_$(OS_NAME).c hid.c
HID_OBJECTS := $(patsubst %.c, $(externals_src)/hcs/hid/%.o, $(HID_SRC))
$(HID_OBJECTS) : %.o : %.c
$(CC) $(CFLAGS) -o "$*.o" -c "$*.c"
$(externals_src)/hcs/hid/hid.$(EXTENSION): $(HID_OBJECTS)
$(CC) $(LDFLAGS) -o $(externals_src)/hcs/hid/hid.$(EXTENSION) $(HID_OBJECTS)
$(STRIP) $(externals_src)/hcs/hid/hid.$(EXTENSION)
--------------
The sources are all in $(externals_src)/hcs/hid. The resulting file is: $(externals_src)/hcs/hid/hid.$(EXTENSION)
This would make the most sense if you put your code into the Pd CVS layout (or even checked it into the Pd CVS). Like make a folder in pure-data/externals, put your code there, then make a target in pure-data/externals/Makefile using the template that's in there.
.hc
On Dec 4, 2006, at 10:56 AM, Eric Lyon wrote:
Greetings,
I need some advice for how to modify the Pd Makefile for when I need to compile more than one code file into an external, yet do not wish to create a separate library. Say I have a main file for the external, "tightdsp~.c" another file containing support functions, " dsphelper1.c" and a third file with even more functions, "dsphelper2.c". How would I modify the following Makefile so that it would compile the code together, just as if I had copied the contents of the two helper files into the main code file?
TIA,
Eric
===
NAME=tightdsp~
CSYM=tightdsp_tilde
current: pd_darwin
# ----------------------- Mac OSX -----------------------
pd_darwin: $(NAME).pd_darwin
.SUFFIXES: .pd_darwin
DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \
-Wno-unused -Wno-parentheses -Wno-switch
.c.pd_darwin:
cc $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
cc -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o
rm -f $*.o ../$*.pd_darwin
cp $*.pd_darwin $(DEST)
# ----------------------------------------------------------
_______________________________________________
PD-dev mailing list
------------------------------------------------------------------------
"[W]e have invented the technology to eliminate scarcity, but we are deliberately throwing it away to benefit those who profit from scarcity." -John Gilmore