Added a Makefile to replace install.sh
This commit is contained in:
parent
09a1f4371f
commit
fe54377ea3
2 changed files with 43 additions and 61 deletions
43
Makefile
Normal file
43
Makefile
Normal file
|
@ -0,0 +1,43 @@
|
|||
## Xbox/Xbox360 USB Gamepad Userspace Driver
|
||||
## Copyright (C) 2010 Ingo Ruhnke <grumbel@gmx.de>
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation, either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
DESTDIR =
|
||||
PREFIX = "/usr/local"
|
||||
DATADIR = "${PREFIX}/share/xboxdrv"
|
||||
MANDIR = "${PREFIX}/share/man"
|
||||
BINDIR = "${PREFIX}/bin"
|
||||
|
||||
xboxdrv:
|
||||
scons
|
||||
|
||||
clean:
|
||||
scons -c
|
||||
rm -rf .sconf_temp/
|
||||
rm -f .sconsign.dblite
|
||||
rm -f config.log
|
||||
|
||||
install: install-exec install-man
|
||||
|
||||
install-exec: xboxdrv
|
||||
install -D xboxdrv "${DESTDIR}${BINDIR}/xboxdrv"
|
||||
|
||||
install-man:
|
||||
install -D doc/xboxdrv-daemon.1 "${DESTDIR}${MANDIR}/man1/xboxdrv-daemon.1"
|
||||
install -D doc/xboxdrv.1 "${DESTDIR}${MANDIR}/man1/xboxdrv.1"
|
||||
|
||||
.PHONY : clean install install-exec install-man
|
||||
|
||||
# EOF #
|
61
install.sh
61
install.sh
|
@ -1,61 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
PREFIX="/usr/local/"
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
echo "Usage: install.sh [OPTION]"
|
||||
echo ""
|
||||
echo " --prefix Prefix of the install location"
|
||||
echo " --bindir Install location for executables"
|
||||
echo " --mandir Install location for manpages"
|
||||
echo ""
|
||||
exit 0
|
||||
;;
|
||||
--prefix)
|
||||
PREFIX="$2"
|
||||
shift 2
|
||||
;;
|
||||
--bindir)
|
||||
USERBINDIR="$2"
|
||||
shift 2
|
||||
;;
|
||||
--mandir)
|
||||
USERMANDIR="$2"
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "$0: invalid option: $1"
|
||||
echo "Use '$0 --help' to get a list of options."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$USERMANDIR" ]; then
|
||||
MANDIR="${PREFIX}/share/man"
|
||||
else
|
||||
MANDIR="$USERMANDIR"
|
||||
fi
|
||||
|
||||
if [ -z "$USERBINDIR" ]; then
|
||||
BINDIR="${PREFIX}/bin"
|
||||
else
|
||||
BINDIR="$USERBINDIR"
|
||||
fi
|
||||
|
||||
if [ -z "$DRYRUN" ]; then
|
||||
install -v -d "${BINDIR}"
|
||||
install -v -d "${MANDIR}/man1"
|
||||
install -v xboxdrv "${BINDIR}"
|
||||
install -v xboxdrv-daemon "${BINDIR}"
|
||||
install -v doc/xboxdrv.1 "${MANDIR}/man1/"
|
||||
install -v doc/xboxdrv-daemon.1 "${MANDIR}/man1/"
|
||||
echo ""
|
||||
echo "xboxdrv install complete"
|
||||
fi
|
||||
|
||||
# EOF #
|
Loading…
Add table
Reference in a new issue