aboutsummaryrefslogtreecommitdiff
path: root/unix/hlib/mkmlist.sh
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/mkmlist.sh
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/hlib/mkmlist.sh')
-rwxr-xr-xunix/hlib/mkmlist.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/unix/hlib/mkmlist.sh b/unix/hlib/mkmlist.sh
new file mode 100755
index 00000000..7d61264b
--- /dev/null
+++ b/unix/hlib/mkmlist.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# MKMLIST -- Make a library member list on the standard output, e.g., for
+# inclusion in a MKPKG file.
+
+_ml1() {
+ ls *.[xfcs]
+ grep '^include' *.x
+}
+
+_ml2() {
+ _ml1 | grep -v '#' | grep -v '<syserr.h>' | sort | uniq |\
+ sed -e 's/^.*include./ /' | sed -e 's/\"//g' |\
+ sed -e 's/\.x/.x /' | tr -s '\n ' '\t'
+}
+
+echo -n " "
+_ml2 | sed -e 's/\( \)\([^<]\)/# \2/g' | tr '#' '\n' |\
+ sed -e 's/> </> </g'
+