mkdir -p -- . /usr/local/lib
/bin/sh ./libtool --mode=install /usr/bin/install -c libmad.la /usr/local/lib/libmad.la
/usr/bin/install -c .libs/libmad.lai /usr/local/lib/libmad.la
/usr/bin/install -c .libs/libmad.a /usr/local/lib/libmad.a
ranlib /usr/local/lib/libmad.a
chmod 644 /usr/local/lib/libmad.a
I'm not certain whether you've managed to create the DLL. In case not use the following "Makefile" for generic DLL creation (don't forget to make sure that the tabs are expanded):
CC=gcc
LIBDIR=/usr/local/lib
LDFLAGS=-Wl,--enable-auto-import
LDLIBS=-lwsock32
%.dll.a: %.dll
test -f $@ && touch $@
%.dll: %.def $(LIBDIR)/%.a
$(CC) -shared -o $@ -Wl,--out-implib,$@.a $^ $(LDFLAGS) $(LDLIBS)
%.def: $(LIBDIR)/%.a
echo "EXPORTS" > $@
nm $<|sed -n "s/.* \(D\|R\) _\(.*\)/\2 DATA/p" >> $@
nm $<|sed -n "s/.* T _//p" >> $@
.PHONY: clean
clean:
rm -f *.dll.a *.dll *.def
Assuming that static "libmad.a" exists in "/usr/local/lib" just call "make libmad.dll":
pbelkner ~/tmp
$ make libmad.dll
echo "EXPORTS" > libmad.def
nm /usr/local/lib/libmad.a|sed -n "s/.* \(D\|R\) _\(.*\)/\2 DATA/p" >> libmad.def
nm /usr/local/lib/libmad.a|sed -n "s/.* T _//p" >> libmad.def
gcc -shared -o libmad.dll -Wl,--out-implib,libmad.dll.a libmad.def /usr/local/lib/libmad.a -Wl,--enable-auto-import -lwsock32
Creating library file: libmad.dll.a
rm libmad.def
pbelkner ~/tmp
$ ls
Makefile libmad.dll libmad.dll.a
pbelkner ~/tmp
$ _