aboutsummaryrefslogtreecommitdiff
path: root/makemk
diff options
context:
space:
mode:
Diffstat (limited to 'makemk')
-rwxr-xr-xmakemk29
1 files changed, 29 insertions, 0 deletions
diff --git a/makemk b/makemk
new file mode 100755
index 0000000..0669f81
--- /dev/null
+++ b/makemk
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+MKFILE=target.mk
+SRCDIR=src/
+ARDIR=bin/archive/
+SHDIR=bin/shared/
+
+cat > $MKFILE << EOF
+# See LICENSE file for copyright and license details.
+
+EOF
+
+for srcf in `find $SRCDIR -name '*.c'`
+do
+ TARGETAR=`echo $srcf | sed -E "s|$SRCDIR(.*).c|$ARDIR\1.o|"`
+ TARGETSH=`echo $srcf | sed -E "s|$SRCDIR(.*).c|$SHDIR\1.o|"`
+ LINEAR='${CC} ${CFLAGS} -c '$srcf' -o $@'
+ LINESH='${CC} ${CFLAGS} -fPIC -c '$srcf' -o $@'
+
+cat >> $MKFILE << EOF
+$TARGETAR: $srcf
+ $LINEAR
+
+$TARGETSH: $srcf
+ $LINESH
+
+EOF
+
+done