[PD-dev] general makefile question

IOhannes m zmoelnig zmoelnig at iem.at
Wed Dec 1 18:00:21 CET 2010


during the debian packaging of externals i once more stumbled across one
of my many problems with make, which i was never able to solve in a
satisfactory way.

it is:
the Makefile uses CFLAGS and LDFLAGS to set crucial flags to the build
process e.g. LDFLAGS uses "-Wl,--export-dynamic -shared" to build shared
libraries (in our case: externals)

however, some meta build processes (like debian packaging) explicitely
set these FLAGS to what they think are good optimization/debugging defaults
e.g. make get's called like
$ /usr/bin/make LDFLAGS="" CFLAGS="-I/usr/local/include"

this however effectively disables all the settings done within the
Makefile, which leads to not passing "-Wl,--export-dynamic  -shared" to
the linker, leading to a fatal error when linking.

what is the canonical way to use the passed FLAGS and at the same time
adding whatever is needed?
something like 'PD_LDFLAGS="-Wl,--export-dynamic  -shared $(LDFLAGS)"'
and then consequently using $(PD_LDFLAGS) in the linking stage?

this is such a fundamental thing that i'm sure there has to be an
elegant solution to this but i never came across one.
the PD_LDFLAGS seems a bit like a kludge to me.

fgmsdr
IOhannes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20101201/8b4a5cb5/attachment.bin>


More information about the Pd-dev mailing list