New way to run configuration scripts

This commit is contained in:
Pierre Pronchery 2010-12-31 16:09:48 +00:00
parent 21fa41c390
commit 77a164257c
2 changed files with 24 additions and 4 deletions

View File

@ -18,7 +18,7 @@ INSTALL = install
all: $(TARGETS) all: $(TARGETS)
../data/VPN.h: ../data/VPN.interface ../data/VPN.h: ../data/VPN.interface
./appbroker.sh "../data/VPN.h" ./appbroker.sh -P "$(PREFIX)" -- "../data/VPN.h"
VPN_OBJS = vpn.o main.o VPN_OBJS = vpn.o main.o
VPN_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) VPN_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)

View File

@ -4,16 +4,36 @@
#usage #usage
usage() _usage()
{ {
echo "Usage: ./appbroker.sh target" 1>&2 echo "Usage: appbroker.sh target" 1>&2
return 1 return 1
} }
#main #main
args=`getopt P: $*`
if [ $? -ne 0 ]; then
_usage
exit $?
fi
set -- $args
while [ $# -gt 0 ]; do
case "$1" in
-P)
#we can ignore it
shift
;;
--)
shift
break
;;
esac
shift
done
if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then
usage _usage
exit $? exit $?
fi fi
APPINTERFACE="${1%%.h}.interface" APPINTERFACE="${1%%.h}.interface"