You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
srcdir=$(dirname "$0")
|
|
|
|
|
|
|
|
for i in "$@"
|
|
|
|
do
|
|
|
|
case $i in
|
|
|
|
--prefix=*)
|
|
|
|
PREFIX="${i#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--libdir=*)
|
|
|
|
LIBDIR="${i#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--includedir=*)
|
|
|
|
INCDIR="${i#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--libext=*)
|
|
|
|
LIBEXT="${i#*=}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
DEP_ARGS=$(pkg-config --cflags --libs somelib)
|
|
|
|
|
|
|
|
cat > Makefile << EOL
|
|
|
|
all: libfoo.$LIBEXT
|
|
|
|
|
|
|
|
libfoo.$LIBEXT:
|
|
|
|
$CC "$srcdir/libfoo.c" -shared -fPIC $DEP_ARGS -o \$@
|
|
|
|
|
|
|
|
install: libfoo.$LIBEXT
|
|
|
|
mkdir -p "\$(DESTDIR)$LIBDIR";
|
|
|
|
mkdir -p "\$(DESTDIR)$LIBDIR/pkgconfig";
|
|
|
|
mkdir -p "\$(DESTDIR)$INCDIR";
|
|
|
|
cp \$< "\$(DESTDIR)$LIBDIR";
|
|
|
|
cp "$srcdir/libfoo.h" "\$(DESTDIR)$INCDIR";
|
|
|
|
EOL
|