9.2.6 Creating Dynamic Linked Foreign Resources Manually under UNIX

The only supported method for building foreign resources is by compiling and linking them with splfr. However, this is sometimes inconvenient, for instance when writing a Makefile for use with make. To figure out what needs to be done to build a foreign resource, you should build it once with splfr --verbose --keep ..., note what compiler and linker flags are used, and save away any generated files. You can then mimic the build commands used by splfr in your Makefile. You should repeat this process each time you upgrade SICStus, even if only the revision part of the SICStus version changes.