aboutsummaryrefslogtreecommitdiff
path: root/unix/hlib/util.csh/mksrc
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /unix/hlib/util.csh/mksrc
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/hlib/util.csh/mksrc')
-rwxr-xr-xunix/hlib/util.csh/mksrc117
1 files changed, 117 insertions, 0 deletions
diff --git a/unix/hlib/util.csh/mksrc b/unix/hlib/util.csh/mksrc
new file mode 100755
index 00000000..648b8e7c
--- /dev/null
+++ b/unix/hlib/util.csh/mksrc
@@ -0,0 +1,117 @@
+#!/bin/csh -f
+#
+# MKSRC -- Make a pure source tree and configure the links for the
+# current architecture.
+
+
+unset noclobber
+onintr cleanup_
+unalias cd cp cmp echo ln mv rm sed set grep ls chmod chown pwd touch sort which
+
+setenv path "(/sbin /usr/sbin /bin /usr/bin /usr/5bin /usr/ucb /etc /usr/etc $path /usr/local/bin /opt/local/bin /local/bin /home/local/bin /usr/openwin/bin /usr/X11R6/bin /usr/X11/bin)"
+
+# Utility aliases.
+alias PUT "mv -f \!*; chown $user \!$ " # [MACHDEP]
+alias BOLD_ON "(tput bold)"
+alias BOLD_OFF "(tput sgr0)"
+alias SO_ON "(tput smso)"
+alias SO_OFF "(tput sgr0)"
+
+alias DO_OK "(echo -n '[ '; BOLD_ON; echo -n ' OK '; BOLD_OFF; echo ' ]')"
+alias DO_WARN "(echo -n '[ '; BOLD_ON; echo -n 'WARN'; BOLD_OFF; echo ' ]')"
+alias DO_FAIL "(echo -n '[ '; SO_ON; echo -n 'FAIL'; SO_OFF; echo ' ]')"
+
+alias ERRMSG "(echo -n ' ';BOLD_ON;echo -n 'ERROR: ' ;BOLD_OFF; echo \!*)"
+alias WARNING "(echo -n ' ';BOLD_ON;echo -n 'WARNING: ';BOLD_OFF; echo \!*)"
+alias NEWLINE "(echo '')"
+
+
+
+# set echo
+
+
+if (! $?iraf) then
+ echo ""
+ echo "Error: You must have the iraf env variable defined !"
+ echo ""
+ exit 1
+endif
+
+
+set exec = yes
+set arch = `$iraf/unix/hlib/irafarch.csh`
+
+
+#=============================================================================
+# Process any command line arguments.
+#=============================================================================
+while ("$1" != "")
+ switch ("$1")
+ case -n: # no execute
+ set exec = no
+ breaksw
+ default:
+ ERRMSG "$0: unknown argument $1"
+ breaksw
+ endsw
+
+ if ("$2" == "") then
+ break
+ else
+ shift
+ endif
+end
+
+
+
+
+
+#----------------------------------
+# Determine platform architecture.
+#----------------------------------
+
+echo -n "Clean host directories ...."
+ if ($exec == "yes") then
+ /bin/rm -f unix/bin.*/[agm-z]*.e unix/bin.*/lib[bco]*.a >& /dev/null
+ else
+ /bin/ls -l unix/bin.*/[agm-z]*.e unix/bin.*/lib[bco]*.a
+ endif
+echo " Done"
+
+
+
+echo -n "Clean src directories ...."
+foreach i (local math pkg sys noao)
+ if ($exec == "yes") then
+ find $i -type f -name \*.a -exec /bin/rm -f {} \; >& /dev/null
+ find $i -type f -name \*.e -exec /bin/rm -f {} \; >& /dev/null
+ find $i -type f -name \*.o -exec /bin/rm -f {} \; >& /dev/null
+ find $i -type f -name OBJS\* -exec /bin/ls -l {} \; >& /dev/null
+ else
+ find $i -type f -name \*.a -exec /bin/ls -l {} \;
+ find $i -type f -name \*.e -exec /bin/ls -l {} \;
+ find $i -type f -name \*.o -exec /bin/ls -l {} \;
+ find $i -type f -name OBJS\* -exec /bin/ls -l {} \;
+ endif
+end
+echo " Done"
+
+
+echo -n "Clean bin directories ...."
+if ($exec == "yes") then
+ /bin/rm -rf bin.*/*.[aeoZ] noao/bin.*/*.[aeoZ] OBJS* >& /dev/null
+else
+ /bin/ls -l bin.*/*.[aeoZ] noao/bin.*/*.[aeoZ] OBJS*
+endif
+echo " Done"
+
+
+echo -n "Cleaning spool files ...."
+if ($exec == "yes") then
+ find . -name spool\* -print -exec /bin/rm -f {} \; >& /dev/null
+ find . -name _spool\* -print -exec /bin/rm -f {} \; >& /dev/null
+else
+ find . -name spool\* -print
+ find . -name _spool\* -print
+endif
+echo " Done"