#!/bin/sh # # Copyright (c) 1994, 1995, 1996 Gunther Schadow. All rights reserved. # # 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 2 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, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. THISDIR=`dirname $0` PROTOGEN=$THISDIR/pgpl GETOPT=getopt set -- `$GETOPT :d:D:l:m:p:P:M:t:T:h $*` use="-g banner" run="" while [ -n "$1" ] do case $1 in -d) shift assrt="asserta(path0(tree,'$1/'))" if [ -z "$use" ] then use="-g $assrt" else use="$use,$assrt" fi ;; -D) shift assrt="asserta(path0(flat,'$1/'))" if [ -z "$use" ] then use="-g $assrt" else use="$use,$assrt" fi ;; -T) shift TOPDIR=`cd $1 ; pwd` assrt="asserta(topdir('$TOPDIR'))" if [ -z "$use" ] then use="-g $assrt" else use="$use,$assrt" fi ;; -l) shift if [ -z "$use" ] then use="-g ensure_loaded('$1')" else use="$use,ensure_loaded('$1')" fi ;; -m) shift if [ -z "$use" ] then use="-g use_module('$1')" else use="$use,use_module('$1')" fi ;; -p) shift a1=`expr "$1" : '\([^-]*\)'` a2=`expr "$1" : '[^-]*-\(.*\)'` if [ -z "$use" ] then use="-g use_package('$a1','$a2')" else use="$use,use_package('$a1','$a2')" fi ;; -P) shift a1=`expr "$1" : '\([^-]*\)'` a2=`expr "$1" : '[^-]*-\(.*\)'` if [ -z "$use" ] then use="-g make_package('$a1','$a2')" else use="$use,make_package('$a1','$a2')" fi ;; -M) shift a1=`expr "$1" : '\([^,]*\)'` a2=`expr "$1" : '[^,]*,\(.*\)'` assrt="asserta(pg_module('$a1','$a2'))" if [ -z "$use" ] then use="-g $assrt" else use="$use,$assrt" fi ;; -t) shift if [ -z "$run" ] then run="-t '$1'" else run="$run,'$1'" fi ;; --) ;; *) echo "usage: $0 [-d directory] [-l library] [-m module] [-t target]" >&2 exit 1 ;; esac shift done echo $PROTOGEN $use $run $PROTOGEN $use $run