support MAKEVERBOSE

This commit is contained in:
lukem 2006-06-28 09:27:17 +00:00
parent d072c175eb
commit b1abc055c0

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2006/06/25 05:12:29 mrg Exp $ # $NetBSD: Makefile,v 1.7 2006/06/28 09:27:17 lukem Exp $
PROG= xxboot PROG= xxboot
SRCS= start.S main.c readufs.c readufs_ffs.c readufs_lfs.c milli_tiny.S SRCS= start.S main.c readufs.c readufs_ffs.c readufs_lfs.c milli_tiny.S
@ -33,6 +33,7 @@ LIBCRTEND=
LIBC= LIBC=
${PROG}: iplsum ${OBJS} ${PROG}: iplsum ${OBJS}
${_MKTARGET_LINK}
${LD} -Ttext 0 -Tdata 0 -e '$$START$$' -N -o $@1 $(OBJS) ${LD} -Ttext 0 -Tdata 0 -e '$$START$$' -N -o $@1 $(OBJS)
${LD} -Ttext 0x100 -Tdata 0x23456780 -e '$$START$$' -N -o $@2 $(OBJS) ${LD} -Ttext 0x100 -Tdata 0x23456780 -e '$$START$$' -N -o $@2 $(OBJS)
${SIZE} $@1 ${SIZE} $@1
@ -41,9 +42,11 @@ ${PROG}: iplsum ${OBJS}
cmp $@1.bin $@2.bin # should be same cmp $@1.bin $@2.bin # should be same
${OBJCOPY} -O binary -j .text $@1 $@2.bin ${OBJCOPY} -O binary -j .text $@1 $@2.bin
test ! -s $@2.bin # text section must be empty test ! -s $@2.bin # text section must be empty
${_MKMSG} " iplsum " ${.TARGET}
./iplsum $@1.bin $@ ./iplsum $@1.bin $@
iplsum: iplsum.c iplsum: iplsum.c
${_MKTARGET_LINK}
${HOST_CC} -o $@ ${.CURDIR}/iplsum.c ${HOST_CC} -o $@ ${.CURDIR}/iplsum.c
CLEANFILES+= ${PROG}1 ${PROG}2 ${PROG}1.bin ${PROG}2.bin ${PROG}.bin iplsum CLEANFILES+= ${PROG}1 ${PROG}2 ${PROG}1.bin ${PROG}2.bin ${PROG}.bin iplsum
@ -55,6 +58,7 @@ CLEANFILES+= ${SRCS:M*.c:S/.c$/.o.S/}
# Place code to data section. # Place code to data section.
.S.o: .S.o:
${_MKTARGET_COMPILE}
sed -e 's/\.code/.data/' \ sed -e 's/\.code/.data/' \
-e 's/\.bss/.section .bss,"aw",@nobits/' \ -e 's/\.bss/.section .bss,"aw",@nobits/' \
-e 's/\.allow$$/.level 1.0/' -e 's/\.allow/.level/' \ -e 's/\.allow$$/.level 1.0/' -e 's/\.allow/.level/' \
@ -63,6 +67,7 @@ CLEANFILES+= ${SRCS:M*.c:S/.c$/.o.S/}
# Place code to data section, and make sure all address calculations # Place code to data section, and make sure all address calculations
# are relative to $global$. # are relative to $global$.
.c.o: .c.o:
${_MKTARGET_COMPILE}
${CC} ${CFLAGS} ${CPPFLAGS} -o $@.S -S ${.IMPSRC} ${CC} ${CFLAGS} ${CPPFLAGS} -o $@.S -S ${.IMPSRC}
grep -i 'ldil' $@.S | egrep -v "ldil L'-?[0-9]*," > /dev/null 2>&1; \ grep -i 'ldil' $@.S | egrep -v "ldil L'-?[0-9]*," > /dev/null 2>&1; \
if [ $$? = 0 ]; then \ if [ $$? = 0 ]; then \