kernel: cleanup makefile for $CONF.$O target
This commit is contained in:
parent
04c4a9ca8b
commit
77a7e3f8fc
14 changed files with 48 additions and 71 deletions
|
@ -74,14 +74,13 @@ LIB=\
|
|||
|
||||
9:V: $p$CONF s$p$CONF
|
||||
|
||||
$p$CONF:DQ: $CONF.c $OBJ $LIB mkfile
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$p$CONF:DQ: $OBJ $CONF.$O $LIB
|
||||
echo '# linking raw kernel' # H6: no headers, data segment aligned
|
||||
$LD -l -o $target -H6 -R4096 -T$loadaddr $OBJ $CONF.$O $LIB
|
||||
$LD -l -o $target -H6 -R4096 -T$loadaddr $prereq
|
||||
|
||||
s$p$CONF:DQ: $CONF.$O $OBJ $LIB
|
||||
s$p$CONF:DQ: $OBJ $CONF.$O $LIB
|
||||
echo '# linking kernel with symbols'
|
||||
$LD -l -o $target -R4096 -T$loadaddr $OBJ $CONF.$O $LIB
|
||||
$LD -l -o $target -R4096 -T$loadaddr $prereq
|
||||
size $target
|
||||
|
||||
$p$CONF.gz:D: $p$CONF
|
||||
|
|
|
@ -69,14 +69,13 @@ LIB=\
|
|||
|
||||
9:V: $p$CONF s$p$CONF
|
||||
|
||||
$p$CONF:DQ: $CONF.c $OBJ $LIB mkfile
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$p$CONF:DQ: $OBJ $CONF.$O $LIB
|
||||
echo '# linking raw kernel' # H6: no headers, data segment aligned
|
||||
$LD -s -l -o $target -H6 -R0x10000 -T$loadaddr $OBJ $CONF.$O $LIB
|
||||
$LD -s -l -o $target -H6 -R0x10000 -T$loadaddr $prereq
|
||||
|
||||
s$p$CONF:DQ: $CONF.$O $OBJ $LIB
|
||||
s$p$CONF:DQ: $OBJ $CONF.$O $LIB
|
||||
echo '# linking kernel with symbols'
|
||||
$LD -l -o $target -R0x10000 -T$loadaddr $OBJ $CONF.$O $LIB
|
||||
$LD -l -o $target -R0x10000 -T$loadaddr $prereq
|
||||
size $target
|
||||
|
||||
$p$CONF.gz:D: $p$CONF
|
||||
|
|
|
@ -64,12 +64,11 @@ LIB=\
|
|||
/$objtype/lib/libmp.a\
|
||||
/$objtype/lib/libc.a\
|
||||
|
||||
$p$CONF.u:D: $p$CONF
|
||||
$p$CONF.u:D: $p$CONF
|
||||
aux/aout2uimage $p$CONF
|
||||
|
||||
$p$CONF:D: $CONF.c $OBJ $LIB mkfile
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
|
||||
$p$CONF:D: $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -T$KTZERO -l $prereq
|
||||
|
||||
<../boot/bootmkfile
|
||||
<../port/portmkfile
|
||||
|
|
|
@ -74,16 +74,13 @@ LIB=\
|
|||
|
||||
9:V: $p$CONF s$p$CONF
|
||||
|
||||
$p$CONF:DQ: $CONF.c $OBJ $LIB mkfile
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$p$CONF:DQ: $OBJ $CONF.$O $LIB
|
||||
echo '# linking raw kernel'
|
||||
# sleep 1 # avoid relinking later
|
||||
$LD -o $target -H0 -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -H0 -R4096 -T$loadaddr -l $prereq
|
||||
|
||||
s$p$CONF:DQ: $CONF.$O $OBJ $LIB
|
||||
s$p$CONF:DQ: $OBJ $CONF.$O $LIB
|
||||
echo '# linking kernel with symbols'
|
||||
# sleep 1 # avoid relinking later
|
||||
$LD -o $target -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -R4096 -T$loadaddr -l $prereq
|
||||
size $target
|
||||
|
||||
$p$CONF.gz:D: $p$CONF
|
||||
|
|
|
@ -66,9 +66,8 @@ SDEV=`{echo devsd.c sd*.c | sed 's/\.c/.'$O'/g'}
|
|||
|
||||
loadaddr = 0x80004020
|
||||
|
||||
$p$CONF: $CONF.c $OBJ $LIB
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$LD -R4 -o $target -T$loadaddr -l $OBJ $CONF.$O $LIB
|
||||
$p$CONF: $OBJ $CONF.$O $LIB
|
||||
$LD -R4 -o $target -T$loadaddr -l $prereq
|
||||
ls -l $target
|
||||
|
||||
install:V: $p$CONF
|
||||
|
|
|
@ -70,15 +70,13 @@ LIB=\
|
|||
|
||||
9:V: $p$CONF s$p$CONF
|
||||
|
||||
$p$CONF:DQ: $CONF.c $OBJ $LIB mkfile
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$p$CONF:DQ: $OBJ $CONF.$O $LIB
|
||||
echo '# linking raw kernel'
|
||||
$LD -o $target -H0 -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -H0 -R4096 -T$loadaddr -l $prereq
|
||||
|
||||
s$p$CONF:DQ: $CONF.$O $OBJ $LIB
|
||||
s$p$CONF:DQ: $OBJ $CONF.$O $LIB
|
||||
echo '# linking kernel with symbols'
|
||||
# $LD -o $target -R4096 -T$loadaddr -l -a $OBJ $CONF.$O $LIB >$target.list
|
||||
$LD -o $target -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -R4096 -T$loadaddr -l $prereq
|
||||
size $target
|
||||
|
||||
$p$CONF.gz:D: $p$CONF
|
||||
|
|
|
@ -76,9 +76,8 @@ AUDIO=`{echo devaudio.c audio*.c | sed 's/\.c/.'$O'/g'}
|
|||
VGA=`{echo devvga.c screen.c vga*.c | sed 's/\.c/.'$O'/g'}
|
||||
SDEV=`{echo devsd.c sd*.c | sed 's/\.c/.'$O'/g'}
|
||||
|
||||
$p$CONF: $CONF.c $OBJ $LIB
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
|
||||
$p$CONF: $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -T$KTZERO -l $prereq
|
||||
size $target
|
||||
|
||||
# don't strip the gzipped kernels -- too frustrating when that's all you have!
|
||||
|
|
|
@ -74,9 +74,8 @@ AUDIO=`{cd ../pc; echo devaudio.c audio*.c | sed 's/\.c/.'$O'/g'}
|
|||
VGA=`{cd ../pc; echo devvga.c screen.c vga*.c | sed 's/\.c/.'$O'/g'}
|
||||
SDEV=`{cd ../pc; echo devsd.c sd*.c | sed 's/\.c/.'$O'/g'}
|
||||
|
||||
$p$CONF: $CONF.c $OBJ $LIB
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$LD -o $target -T$KTZERO -R4096 -l $OBJ $CONF.$O $LIB
|
||||
$p$CONF: $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -T$KTZERO -R4096 -l $prereq
|
||||
size $target
|
||||
|
||||
install:V: $p$CONF
|
||||
|
|
|
@ -42,13 +42,13 @@ nuke:V: clean
|
|||
|
||||
%.$O: /$objtype/include/u.h ../port/lib.h mem.h dat.h fns.h io.h ../port/error.h ../port/portdat.h ../port/portfns.h
|
||||
|
||||
../port/systab.h: /sys/src/libc/9syscall/sys.h ../port/mksystab
|
||||
../port/systab.h:D: /sys/src/libc/9syscall/sys.h ../port/mksystab
|
||||
rc ../port/mksystab > ../port/systab.h
|
||||
|
||||
$CONF.$O: $CONF.c
|
||||
$CONF.$O: $CONF.c $OBJ $LIB
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
|
||||
$CONF.c: ../port/mkdevc $CONF
|
||||
$CONF.c:D: ../port/mkdevc $CONF
|
||||
rc ../port/mkdevc $CONF > $CONF.c
|
||||
{echo 'uchar configfile[]={'
|
||||
xd -1x $CONF |
|
||||
|
@ -59,13 +59,13 @@ $CONF.c: ../port/mkdevc $CONF
|
|||
errstr.h:D: ../port/mkerrstr ../port/error.h
|
||||
rc ../port/mkerrstr > errstr.h
|
||||
|
||||
%.i: %.out
|
||||
%.i:D: %.out
|
||||
{echo 'uchar '^$stem^'[]={'
|
||||
xd -1x <$stem.out |
|
||||
sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
|
||||
echo '};'} > $target
|
||||
|
||||
%.db: main.$O
|
||||
%.db:D: main.c
|
||||
$CC -s$stem main.c | dbfmt > $stem.db
|
||||
|
||||
alloc.$O ucalloc.$O devswap.$O devproc.$O: /sys/include/pool.h
|
||||
|
|
|
@ -72,14 +72,12 @@ AFLAGS=$AFLAGS -D$CONF'conf='$CONF
|
|||
|
||||
it:V: $p$CONF
|
||||
|
||||
9blast: $CONF.c $OBJ $LIB
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$LD -o $target -T$loadaddr -R4096 -l $OBJ $CONF.$O $LIB
|
||||
size $p$CONF
|
||||
9blast: $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -T$loadaddr -R4096 -l $prereq
|
||||
size $target
|
||||
|
||||
9ucu: $CONF.c $OBJ $LIB
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$LD -R0x1000 -H5 -o $target -T$loadaddr -l $OBJ $CONF.$O $LIB
|
||||
9ucu: $OBJ $CONF.$O $LIB
|
||||
$LD -R0x1000 -H5 -o $target -T$loadaddr -l $prereq
|
||||
|
||||
install:V: $p$CONF
|
||||
cp $p$CONF /$objtype/$p$CONF
|
||||
|
|
|
@ -68,9 +68,8 @@ LIB=\
|
|||
/$objtype/lib/libip.a\
|
||||
/$objtype/lib/libc.a\
|
||||
|
||||
$p$CONF: $OBJ $CONF.c $LIB
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$LD -o $target -l -R8 -H3 -T$KTZERO $OBJ $CONF.$O $LIB
|
||||
$p$CONF: $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -l -R8 -H3 -T$KTZERO $prereq
|
||||
size $target
|
||||
|
||||
install:V: $p$CONF
|
||||
|
|
|
@ -83,15 +83,13 @@ LIB=\
|
|||
|
||||
9:V: $p$CONF s$p$CONF
|
||||
|
||||
$p$CONF:DQ: $CONF.c $OBJ $LIB mkfile
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$p$CONF:DQ: $OBJ $CONF.$O $LIB
|
||||
echo '# linking raw kernel' # H6: no headers, data segment aligned
|
||||
$LD -o $target -H6 -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -H6 -R4096 -T$loadaddr -l $prereq
|
||||
|
||||
s$p$CONF:DQ: $CONF.$O $OBJ $LIB
|
||||
s$p$CONF:DQ: $OBJ $CONF.$O $LIB
|
||||
echo '# linking 9 kernel with symbols'
|
||||
# $LD -o $target -R4096 -T$loadaddr -l -a $OBJ $CONF.$O $LIB >$target.list
|
||||
$LD -o $target -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -R4096 -T$loadaddr -l $prereq
|
||||
size $target
|
||||
|
||||
$p$CONF.gz:D: $p$CONF
|
||||
|
|
|
@ -93,19 +93,13 @@ SDEV=`{echo devsd.c sd*.c | sed 's/\.c/.'$O'/g'}
|
|||
PAE=`{echo $PAE | sed 's/yes/yes[extended-cr3]/'}
|
||||
XENELF='LOADER=generic,XEN_VER=xen-3.0,ELF_PADDR_OFFSET=0,VIRT_BASE='$KZERO',VIRT_ENTRY='$KTZERO',PAE='$PAE
|
||||
|
||||
#$p$CONF: $CONF.c $OBJ $LIB xenbin.$cputype
|
||||
# $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
# $LD -o $target.tmp -T$KTZERO -l $OBJ $CONF.$O $LIB
|
||||
# ./xenbin.$cputype <$target.tmp >$target
|
||||
# rm $target.tmp
|
||||
# size $target
|
||||
|
||||
$p$CONF: $CONF.c $OBJ $LIB xenelf.$cputype
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$LD -o $target.elf -H5 -T$KTZERO -P$KPZERO -l $OBJ $CONF.$O $LIB
|
||||
./xenelf.$cputype $target.elf $target __xen_guest ''$XENELF''
|
||||
$p$CONF:D: $p$CONF.elf xenelf.$cputype
|
||||
./xenelf.$cputype $prereq(1) $target __xen_guest ''$XENELF''
|
||||
size $target
|
||||
|
||||
$p$CONF.elf:D: $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -H5 -T$KTZERO -P$KPZERO -l $prereq
|
||||
|
||||
$p$CONF.gz: $p$CONF
|
||||
#strip -o /fd/1 $p$CONF | gzip -9 > $p$CONF.gz
|
||||
gzip -9 $p$CONF > $p$CONF.gz
|
||||
|
|
|
@ -64,9 +64,8 @@ LIB=\
|
|||
/$objtype/lib/libmp.a\
|
||||
/$objtype/lib/libc.a\
|
||||
|
||||
$p$CONF:D: $CONF.c $OBJ $LIB mkfile
|
||||
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
|
||||
$LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
|
||||
$p$CONF:D: $OBJ $CONF.$O $LIB
|
||||
$LD -o $target -T$KTZERO -l $prereq
|
||||
|
||||
<../boot/bootmkfile
|
||||
<../port/portmkfile
|
||||
|
|
Loading…
Reference in a new issue