>Right now I’m building a dll file on Windows using the following make file:
all: sum.dll
sum.o: sum.c
gcc -c sum.c
sum.dll: sum.o
gcc -shared -o sum.dll sum.o
To build a so file on Unix I have to change the first and last lines to read sum.so instead of sum.dll. The same thing applies on OS X, but there I want to build sum.dylib. Does anyone know if there is a little flag or such that I can use to let GCC add the right file extension to the resulting file without having to play around with environment variables and such?