New way of running configuration scripts

This commit is contained in:
Pierre Pronchery 2010-12-31 15:23:40 +00:00
parent 9518267e4c
commit ecc4da49a6
2 changed files with 23 additions and 3 deletions

View File

@ -18,7 +18,7 @@ INSTALL = install
all: $(TARGETS)
../data/Init.h: ../data/Init.interface
./appbroker.sh "../data/Init.h"
./appbroker.sh -P "$(PREFIX)" -- "../data/Init.h"
Init_OBJS = init.o main.o service.o session.o
Init_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)

View File

@ -4,7 +4,7 @@
#usage
usage()
_usage()
{
echo "Usage: ./appbroker.sh target" 1>&2
return 1
@ -12,8 +12,28 @@ usage()
#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
usage
_usage
exit $?
fi
APPINTERFACE="${1%%.h}.interface"