lib/Tools/mkdir
changeset 8198 73a5877ca517
parent 8194 0c5d9d23b715
child 8199 9e45cf2e6cf7
     1.1 --- a/lib/Tools/mkdir	Sat Feb 05 16:58:58 2000 +0100
     1.2 +++ b/lib/Tools/mkdir	Sat Feb 05 16:59:50 2000 +0100
     1.3 @@ -15,6 +15,7 @@
     1.4    echo "Usage: $PRG [LOGIC] NAME"
     1.5    echo
     1.6    echo "  Options are:"
     1.7 +  echo "    -I FILE      alternative IsaMakefile output"
     1.8    echo "    -b           setup build mode (session outputs heap image)"
     1.9    echo "    -d           setup document"
    1.10    echo "    -p           include parent logic target"
    1.11 @@ -36,13 +37,17 @@
    1.12  
    1.13  # options
    1.14  
    1.15 +ISAMAKEFILE="IsaMakefile"
    1.16  BUILD=""
    1.17  DOCUMENT=""
    1.18  PARENT=""
    1.19  
    1.20 -while getopts "bdp" OPT
    1.21 +while getopts "I:bdp" OPT
    1.22  do
    1.23    case "$OPT" in
    1.24 +    I)
    1.25 +      ISAMAKEFILE="$OPTARG"
    1.26 +      ;;
    1.27      b)
    1.28        BUILD=true
    1.29        ;;
    1.30 @@ -94,8 +99,8 @@
    1.31    USEDIR="\$(USEDIR)"
    1.32  fi
    1.33  
    1.34 -if [ -f IsaMakefile ]; then
    1.35 -  echo "keeping $PWD/IsaMakefile" >&2
    1.36 +if [ "$ISAMAKEFILE" != - -a -f "$ISAMAKEFILE" ]; then
    1.37 +  echo "keeping $PWD/$ISAMAKEFILE" >&2
    1.38  else
    1.39    { echo
    1.40      echo "## targets"
    1.41 @@ -138,7 +143,13 @@
    1.42      echo "clean:"
    1.43      echo -e "\t@rm -f $TARGET"
    1.44      echo
    1.45 -  } >IsaMakefile
    1.46 +  } | {
    1.47 +    if [ -z "$ISAMAKEFILE" -o "$ISAMAKEFILE" = - ]; then
    1.48 +      cat
    1.49 +    else
    1.50 +      cat > "$ISAMAKEFILE"
    1.51 +    fi
    1.52 +  }
    1.53  fi
    1.54  
    1.55