vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

commit 790fc2398ccd303674edc622e8ca856cf98aeed8
parent ecea705d6cb9ec87efe9bd24b6b3e604ed699dd6
Author: Jesus Galan Lopez (yiyus) <yiyu.jgl@gmail.com>
Date:   Sun, 10 Oct 2010 16:53:32 +0200

simpler handling of boot files in Makefrag

--HG--
rename : src/9vx/bootcode.9 => src/9vx/boot.9

Diffstat:
Msrc/9vx/Makefrag | 33++++++++-------------------------
Rsrc/9vx/bootcode.9 -> src/9vx/boot.9 | 0
Msrc/9vx/boot/mkfile | 6+++---
Msrc/9vx/mkbootinitc | 5+++--
4 files changed, 14 insertions(+), 30 deletions(-)

diff --git a/src/9vx/Makefrag b/src/9vx/Makefrag @@ -24,11 +24,11 @@ endif # Boot files # Do not remove: -# - bootcode, needed to boot +# - boot, needed to boot # - factotum, used by libauth PLAN9BOOT=\ 9660srv \ - bootcode \ + boot \ bzfs \ factotum \ fossil \ @@ -267,29 +267,12 @@ PLAN9_DEPS = \ 9vx/data2s: 9vx/data2s.c $(HOST_CC) -o $@ $< -9vx/9660srv.S: 9vx/data2s 9vx/9660srv.9 - ./9vx/data2s _9660srv < 9vx/9660srv.9 >$@_ && mv $@_ $@ +# We need the sed command to have a correct variable name for 9660srv +9vx/%.S: 9vx/data2s 9vx/%.9 + ./9vx/data2s `echo $* | sed 's/^[0-9]/_&/'` < $< >$@_ && mv $@_ $@ -9vx/bootcode.S: 9vx/data2s 9vx/bootcode.9 - ./9vx/data2s boot < 9vx/bootcode.9 >$@_ && mv $@_ $@ - -9vx/bzfs.S: 9vx/data2s 9vx/bzfs.9 - ./9vx/data2s bzfs < 9vx/bzfs.9 >$@_ && mv $@_ $@ - -9vx/factotum.S: 9vx/data2s 9vx/factotum.9 - ./9vx/data2s factotum < 9vx/factotum.9 >$@_ && mv $@_ $@ - -9vx/fossil.S: 9vx/data2s 9vx/fossil.9 - ./9vx/data2s fossil < 9vx/fossil.9 >$@_ && mv $@_ $@ - -9vx/kfs.S: 9vx/data2s 9vx/kfs.9 - ./9vx/data2s kfs < 9vx/kfs.9 >$@_ && mv $@_ $@ - -9vx/rootfs.S: 9vx/data2s 9vx/rootfs.bz2 - ./9vx/data2s rootfs < 9vx/rootfs.bz2 >$@_ && mv $@_ $@ - -9vx/venti.S: 9vx/data2s 9vx/venti.9 - ./9vx/data2s venti < 9vx/venti.9 > $@_ && mv $@_ $@ +9vx/%.S: 9vx/data2s 9vx/%.bz2 + ./9vx/data2s `echo $* | sed 's/^[0-9]/_&/'` < $< >$@_ && mv $@_ $@ 9vx/a/errstr.h: 9vx/a/error.h sed 's/extern //; s!;.*/\* ! = "!; s! \*\/!";!' 9vx/a/error.h >9vx/a/errstr.h @@ -325,7 +308,7 @@ CLEAN_FILES += \ 9vx/bootinit.c \ 9vx/data2s \ 9vx/9660srv.S \ - 9vx/bootcode.S \ + 9vx/boot.S \ 9vx/bzfs.S \ 9vx/factotum.S \ 9vx/fossil.S \ diff --git a/src/9vx/bootcode.9 b/src/9vx/boot.9 Binary files differ. diff --git a/src/9vx/boot/mkfile b/src/9vx/boot/mkfile @@ -5,11 +5,11 @@ CWD=`{pwd} EDFILES=`{ls *.ed} SRCFILES=${EDFILES:%.ed=%} -bootcode.9: files +boot.9: files bind -bc $CWD $SRC9/boot cd $SRC9/pc mk bootpcf.out 'CONF=pcf' && - mv bootpcf.out $CWD/bootcode.9 + mv bootpcf.out $CWD/boot.9 unmount $CWD $SRC9/boot unmount $SRC9/boot $SRC9/boot @@ -24,4 +24,4 @@ files:V: $SRCFILES cp $SRC9/boot/$stem $stem.orig clean:V: - rm -f bootcode.9 libboot.a8 *.[ch] *.orig + rm -f boot.9 libboot.a8 *.[ch] *.orig diff --git a/src/9vx/mkbootinitc b/src/9vx/mkbootinitc @@ -15,8 +15,9 @@ bootinit(void) echo $* | awk ' { for(i = 1; i <= NF; i++){ - a[i] = ($i ~ "bootcode") ? "boot" : $i - b[i] = ($i ~ /^[0-9]/) ? "_"$i : a[i] + a[i] = $i + # C var names cannot start with a digit + b[i] = ($i ~ /^[0-9]/) ? "_"$i : $i print " extern uchar "b[i]"code[];" print " extern long "b[i]"len;" }