ref: f487eae6bc8746528822547f827094d273867006
parent: e7753379f41991512b2ba815d879800e1b7c725b
author: Ori Bernstein <[email protected]>
date: Thu Sep 27 11:18:32 EDT 2012
Add in '_start' to libstd.
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
mi \
6 \
util \
- libmyr
+ libstd
include mk/c.mk
include config.mk
--- a/libstd/bld.sh
+++ b/libstd/bld.sh
@@ -7,7 +7,8 @@
export PATH=.:$PATH
export MC=../6/6m
export MU=../util/muse
-export CC=cc
+export AS=as
+export LD=ld
export ASOPT="-g"
case `uname` in
Darwin) export SYS=osx;;
@@ -26,21 +27,22 @@
function build {
for i in $@; do
- N=`basename $i .myr`
-
- echo $MC $i && \
- $MC -I. $i
+ echo $MC $i
+ $MC -I. $i
done
}
function assem {
for i in $@; do
- $CC $ASOPT -c $i
+ N=`basename $i .s`
+
+ echo $AS -o $N.o $ASOPT $i
+ $AS -o $N.o $ASOPT $i
done
}
# Library source.
-ASM=syscall-$SYS.s
+ASM="syscall-$SYS.s start-$SYS.s"
MYR="types.myr \
sys-$SYS.myr \
die.myr \
@@ -65,7 +67,7 @@
# build test program
build test.myr
-COMP="$CC -o test test.o -L. -lstd"
+COMP="$LD -o test test.o -L. -lstd"
echo $COMP
$COMP