shithub: mc

Download patch

ref: 644e4fd2b841d47dc914c614501ef0e01674f267
parent: 05c90edfb988054f51dd360b5459cd0ca81693f8
author: Ori Bernstein <[email protected]>
date: Thu Sep 27 08:06:59 EDT 2012

Update to libmyr's build script. Make clean now works.

--- a/libmyr/Makefile
+++ b/libmyr/Makefile
@@ -1,9 +1,12 @@
 include ../config.mk
 
-all: 
+all: libstd.a
+
+libstd.a:
 	./bld.sh
 .PHONY: clean
 clean:
+	./bld.sh clean
 
 install:
 	mkdir -p  $(INST_ROOT)/myr/lib/
--- a/libmyr/bld.sh
+++ b/libmyr/bld.sh
@@ -53,19 +53,22 @@
 
 OBJ="$(echo $ASM | sed 's/\.s/.o /g') $(echo $MYR | sed 's/\.myr/.o /g')"
 USE="$(echo $MYR | sed 's/\.myr/.use /g' | sed "s/-$SYS//g")"
-rm -f $OBJ test libstd.a
-assem $ASM
-use $MYR
-build $MYR
+if [ "$1" = "clean" ]; then
+    echo rm -f $OBJ test libstd.a
+    rm -f $OBJ test libstd.a
+else 
+    assem $ASM
+    use $MYR
+    build $MYR
 
-echo $MU -mo std $USE
-$MU -mo std $USE
-echo ar -rcs libstd.a $OBJ
-ar -rcs libstd.a $OBJ
+    echo $MU -mo std $USE
+    $MU -mo std $USE
+    echo ar -rcs libstd.a $OBJ
+    ar -rcs libstd.a $OBJ
 
-# build test program
-build test.myr
-COMP="$CC -o test test.o -L. -lstd"
-echo $COMP
-$COMP
-
+    # build test program
+    build test.myr
+    COMP="$CC -o test test.o -L. -lstd"
+    echo $COMP
+    $COMP
+fi