From e374d767f013bf0e622c5c39687716dc66fc48fb Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 6 Mar 2013 00:32:53 +0100 Subject: [PATCH] Now supports "make clean" --- doc/docbook.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/docbook.sh b/doc/docbook.sh index d216402..a9d498c 100755 --- a/doc/docbook.sh +++ b/doc/docbook.sh @@ -1,6 +1,6 @@ #!/bin/sh #$Id$ -#Copyright (c) 2012 Pierre Pronchery +#Copyright (c) 2012-2013 Pierre Pronchery # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions are met: @@ -27,6 +27,7 @@ #variables PREFIX="/usr/local" . "../config.sh" +#executables DEBUG="_debug" INSTALL="install -m 0644" MKDIR="mkdir -m 0755 -p" @@ -46,16 +47,20 @@ _debug() #usage _usage() { - echo "Usage: docbook.sh [-i|-u][-P prefix] target" 1>&2 + echo "Usage: docbook.sh [-c|-i|-u][-P prefix] target..." 1>&2 return 1 } #main +clean=0 install=0 uninstall=0 -while getopts "iuP:" "name"; do +while getopts "ciuP:" name; do case "$name" in + c) + clean=1 + ;; i) uninstall=0 install=1 @@ -106,6 +111,9 @@ while [ $# -gt 0 ]; do ;; esac + #clean + [ "$clean" -ne 0 ] && continue + #uninstall if [ "$uninstall" -eq 1 ]; then $DEBUG $RM -- "$instdir/$target" || exit 2