]> git.mdlowis.com Git - proto/acc.git/commitdiff
initial commit
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 31 Jan 2019 01:49:56 +0000 (20:49 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 31 Jan 2019 01:49:56 +0000 (20:49 -0500)
acc [new file with mode: 0755]

diff --git a/acc b/acc
new file mode 100755 (executable)
index 0000000..b554f11
--- /dev/null
+++ b/acc
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# predclare our variables
+declare -a objects
+declare -a libpaths
+declare -a libraries
+target=a.out
+compile=false
+
+# is this a compilation step or a link step?
+if [ "x$1" = "x-c" ]; then
+    shift;
+    compile=true
+fi
+
+# what's the name of our target?
+if [ "x$1" = "x-o" ]; then
+    target=$2
+    shift; shift
+fi
+
+# scan the rest of the options for lib paths, libs and objects
+for i do
+    case "$i" in
+        *.[ao]) # Add objects and static libs to object list
+            objects+=("$i") ;;
+
+        -L*) # Add libpaths to the search list
+            libpaths+=("$i") ;;
+    esac
+done
+
+# print what we have so far
+echo "libpaths:" ${libpaths[*]}
+echo "objects:" ${objects[*]}