head	1.6;
access;
symbols
	netbsd-11-0-RC3:1.6
	netbsd-11-0-RC2:1.6
	netbsd-11-0-RC1:1.6
	perseant-exfatfs-base-20250801:1.6
	netbsd-11:1.6.0.4
	netbsd-11-base:1.6
	netbsd-10-1-RELEASE:1.3.30.1
	perseant-exfatfs-base-20240630:1.6
	perseant-exfatfs:1.6.0.2
	perseant-exfatfs-base:1.6
	netbsd-8-3-RELEASE:1.2
	netbsd-9-4-RELEASE:1.3
	netbsd-10-0-RELEASE:1.3.30.1
	netbsd-10-0-RC6:1.3.30.1
	netbsd-10-0-RC5:1.3.30.1
	netbsd-10-0-RC4:1.3.30.1
	netbsd-10-0-RC3:1.3.30.1
	netbsd-10-0-RC2:1.3.30.1
	thorpej-ifq:1.4.0.4
	thorpej-ifq-base:1.4
	thorpej-altq-separation:1.4.0.2
	thorpej-altq-separation-base:1.4
	netbsd-10-0-RC1:1.3.30.1
	netbsd-10:1.3.0.30
	netbsd-10-base:1.3
	bouyer-sunxi-drm:1.3.0.28
	bouyer-sunxi-drm-base:1.3
	netbsd-9-3-RELEASE:1.3
	thorpej-i2c-spi-conf2:1.3.0.26
	thorpej-i2c-spi-conf2-base:1.3
	thorpej-futex2:1.3.0.24
	thorpej-futex2-base:1.3
	thorpej-cfargs2:1.3.0.22
	thorpej-cfargs2-base:1.3
	cjep_sun2x-base1:1.3
	cjep_sun2x:1.3.0.20
	cjep_sun2x-base:1.3
	cjep_staticlib_x-base1:1.3
	netbsd-9-2-RELEASE:1.3
	cjep_staticlib_x:1.3.0.18
	cjep_staticlib_x-base:1.3
	thorpej-i2c-spi-conf:1.3.0.16
	thorpej-i2c-spi-conf-base:1.3
	thorpej-cfargs:1.3.0.14
	thorpej-cfargs-base:1.3
	thorpej-futex:1.3.0.12
	thorpej-futex-base:1.3
	netbsd-9-1-RELEASE:1.3
	bouyer-xenpvh-base2:1.3
	phil-wifi-20200421:1.3
	bouyer-xenpvh-base1:1.3
	phil-wifi-20200411:1.3
	bouyer-xenpvh:1.3.0.10
	bouyer-xenpvh-base:1.3
	is-mlppp:1.3.0.8
	is-mlppp-base:1.3
	phil-wifi-20200406:1.3
	netbsd-8-2-RELEASE:1.2
	ad-namecache-base3:1.3
	netbsd-9-0-RELEASE:1.3
	netbsd-9-0-RC2:1.3
	ad-namecache-base2:1.3
	ad-namecache-base1:1.3
	ad-namecache:1.3.0.6
	ad-namecache-base:1.3
	netbsd-9-0-RC1:1.3
	phil-wifi-20191119:1.3
	netbsd-9:1.3.0.4
	netbsd-9-base:1.3
	phil-wifi-20190609:1.3
	netbsd-8-1-RELEASE:1.2
	netbsd-8-1-RC1:1.2
	isaki-audio2:1.3.0.2
	isaki-audio2-base:1.3
	pgoyette-compat-merge-20190127:1.2.16.1
	pgoyette-compat-20190127:1.3
	pgoyette-compat-20190118:1.3
	pgoyette-compat-1226:1.3
	pgoyette-compat-1126:1.3
	pgoyette-compat-1020:1.2
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.2
	netbsd-7-2-RELEASE:1.1
	pgoyette-compat-0728:1.2
	netbsd-8-0-RELEASE:1.2
	phil-wifi:1.2.0.18
	phil-wifi-base:1.2
	pgoyette-compat-0625:1.2
	netbsd-8-0-RC2:1.2
	pgoyette-compat-0521:1.2
	pgoyette-compat-0502:1.2
	pgoyette-compat-0422:1.2
	netbsd-8-0-RC1:1.2
	pgoyette-compat-0415:1.2
	pgoyette-compat-0407:1.2
	pgoyette-compat-0330:1.2
	pgoyette-compat-0322:1.2
	pgoyette-compat-0315:1.2
	netbsd-7-1-2-RELEASE:1.1
	pgoyette-compat:1.2.0.16
	pgoyette-compat-base:1.2
	netbsd-7-1-1-RELEASE:1.1
	tls-maxphys-base-20171202:1.2
	matt-nb8-mediatek:1.2.0.14
	matt-nb8-mediatek-base:1.2
	nick-nhusb-base-20170825:1.2
	perseant-stdc-iso10646:1.2.0.12
	perseant-stdc-iso10646-base:1.2
	netbsd-8:1.2.0.10
	netbsd-8-base:1.2
	prg-localcount2-base3:1.2
	prg-localcount2-base2:1.2
	prg-localcount2-base1:1.2
	prg-localcount2:1.2.0.8
	prg-localcount2-base:1.2
	pgoyette-localcount-20170426:1.2
	bouyer-socketcan-base1:1.2
	jdolecek-ncq:1.2.0.6
	jdolecek-ncq-base:1.2
	pgoyette-localcount-20170320:1.2
	netbsd-7-1:1.1.0.18
	netbsd-7-1-RELEASE:1.1
	netbsd-7-1-RC2:1.1
	nick-nhusb-base-20170204:1.2
	netbsd-7-nhusb-base-20170116:1.1
	bouyer-socketcan:1.2.0.4
	bouyer-socketcan-base:1.2
	pgoyette-localcount-20170107:1.2
	netbsd-7-1-RC1:1.1
	nick-nhusb-base-20161204:1.2
	pgoyette-localcount-20161104:1.2
	netbsd-7-0-2-RELEASE:1.1
	nick-nhusb-base-20161004:1.2
	localcount-20160914:1.2
	netbsd-7-nhusb:1.1.0.16
	netbsd-7-nhusb-base:1.1
	pgoyette-localcount-20160806:1.2
	pgoyette-localcount-20160726:1.2
	pgoyette-localcount:1.2.0.2
	pgoyette-localcount-base:1.2
	nick-nhusb-base-20160907:1.2
	nick-nhusb-base-20160529:1.2
	netbsd-7-0-1-RELEASE:1.1
	nick-nhusb-base-20160422:1.2
	nick-nhusb-base-20160319:1.2
	nick-nhusb-base-20151226:1.1
	netbsd-7-0:1.1.0.14
	netbsd-7-0-RELEASE:1.1
	nick-nhusb-base-20150921:1.1
	netbsd-7-0-RC3:1.1
	netbsd-7-0-RC2:1.1
	netbsd-7-0-RC1:1.1
	nick-nhusb-base-20150606:1.1
	nick-nhusb-base-20150406:1.1
	nick-nhusb:1.1.0.12
	nick-nhusb-base:1.1
	tls-maxphys-base:1.1
	tls-maxphys:1.1.0.10
	netbsd-7:1.1.0.8
	netbsd-7-base:1.1
	yamt-pagecache:1.1.0.6
	rmind-smpnet-base:1.1
	rmind-smpnet:1.1.0.4
	rmind-smpnet-nbase:1.1
	yamt-pagecache-base9:1.1
	tls-earlyentropy:1.1.0.2
	tls-earlyentropy-base:1.1
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1
	riastradh-drm2-base3:1.1;
locks; strict;
comment	@# @;


1.6
date	2024.04.29.07.34.27;	author skrll;	state Exp;
branches;
next	1.5;
commitid	bkP7EkqGwlGLI08F;

1.5
date	2024.04.29.07.31.18;	author skrll;	state Exp;
branches;
next	1.4;
commitid	SIfdvsePPU5AH08F;

1.4
date	2023.01.13.18.43.43;	author martin;	state Exp;
branches;
next	1.3;
commitid	FY88cZvt2DTMAp9E;

1.3
date	2018.11.13.21.22.38;	author skrll;	state Exp;
branches
	1.3.30.1;
next	1.2;
commitid	IOArA7HT7mPdoPZA;

1.2
date	2016.02.21.14.50.05;	author christos;	state Exp;
branches
	1.2.16.1
	1.2.18.1;
next	1.1;
commitid	PMSerU7sVtZUeNVy;

1.1
date	2014.02.24.07.23.43;	author skrll;	state Exp;
branches
	1.1.4.1
	1.1.6.1
	1.1.10.1
	1.1.12.1;
next	;
commitid	HknWmBfzukaU7kqx;

1.3.30.1
date	2023.05.15.10.34.58;	author martin;	state Exp;
branches;
next	;
commitid	nY4FK72dhK3eY2pE;

1.2.16.1
date	2018.11.26.01.52.25;	author pgoyette;	state Exp;
branches;
next	;
commitid	Zj4q5SspGdKXto1B;

1.2.18.1
date	2019.06.10.22.06.20;	author christos;	state Exp;
branches;
next	;
commitid	jtc8rnCzWiEEHGqB;

1.1.4.1
date	2014.02.24.07.23.43;	author rmind;	state dead;
branches;
next	1.1.4.2;
commitid	mL5ZYSzpqK6QS2Bx;

1.1.4.2
date	2014.05.18.17.45.11;	author rmind;	state Exp;
branches;
next	;
commitid	mL5ZYSzpqK6QS2Bx;

1.1.6.1
date	2014.02.24.07.23.43;	author yamt;	state dead;
branches;
next	1.1.6.2;
commitid	VUUXuyNWnt3AKwBx;

1.1.6.2
date	2014.05.22.11.39.51;	author yamt;	state Exp;
branches;
next	;
commitid	VUUXuyNWnt3AKwBx;

1.1.10.1
date	2014.02.24.07.23.43;	author tls;	state dead;
branches;
next	1.1.10.2;
commitid	jTnpym9Qu0o4R1Nx;

1.1.10.2
date	2014.08.20.00.03.05;	author tls;	state Exp;
branches;
next	1.1.10.3;
commitid	jTnpym9Qu0o4R1Nx;

1.1.10.3
date	2017.12.03.11.36.17;	author jdolecek;	state Exp;
branches;
next	;
commitid	XcIYRZTAh1LmerhA;

1.1.12.1
date	2016.03.19.11.30.00;	author skrll;	state Exp;
branches;
next	;
commitid	2PHKtPSg1vDV9fZy;


desc
@@


1.6
log
@Whitespace
@
text
@#	$NetBSD: Makefile,v 1.5 2024/04/29 07:31:18 skrll Exp $

NODEBUG=	yes
PROG=		xxboot
NOMAN=		# defined
SRCS=		start.S main.c readufs.c readufs_ffs.c readufs_lfs.c milli_tiny.S

.PATH:	${.CURDIR}/../common

CPPFLAGS+=	-I${.CURDIR}/../../../.. -I. -D_STANDALONE
# configuration for readufs module
CPPFLAGS+=	-DUSE_LFS -DUSE_FFS -DUSE_UFS1 -DUSE_UFS2
# IODC can handle only 2GB, so this is enough
CPPFLAGS+=	-D__daddr_t=int32_t -D__ino_t=uint32_t
# ANSI C feature prevents from being relocatable
#CPPFLAGS+=	-traditional	# would be best
CPPFLAGS+=	-Dconst=
COPTS+=		-Os -fno-delete-null-pointer-checks -funsigned-char -mdisable-fpregs -mpa-risc-1-0

# Make sure we override any optimization options specified by the user
DBG=		# empty

.include <bsd.own.mk>

LINKS=	${BINDIR}/${PROG} ${BINDIR}/sdboot

BINDIR=		/usr/mdec
STRIPFLAG=
BINMODE=	444

# standalone program
LIBCRTBEGIN=
LIBCRT0=
LIBCRTI=
LIBCRTEND=
LIBC=

S=		${.CURDIR}/../../../..

${PROG}: iplsum ${OBJS}
	${_MKTARGET_LINK}
	${LD} -Ttext 0 -Tdata 0 -e '$$START$$' -N -o $@@1 $(OBJS)
	${LD} -Ttext 0x100 -Tdata 0x23456780 -e '$$START$$' -N -o $@@2 $(OBJS)
	${SIZE} $@@1
	${OBJCOPY} -O binary -j .data $@@1 $@@1.bin
	${OBJCOPY} -O binary -j .data $@@2 $@@2.bin
	cmp $@@1.bin $@@2.bin	# should be same
	${OBJCOPY} -O binary -j .text $@@1 $@@2.bin
	test ! -s $@@2.bin	# text section must be empty
	${_MKMSG} " iplsum " ${.TARGET}
	./iplsum $@@1.bin $@@

iplsum: iplsum.c
	${_MKTARGET_LINK}
	${HOST_CC} -o $@@ ${.CURDIR}/iplsum.c

CLEANFILES+=	${PROG}1 ${PROG}2 ${PROG}1.bin ${PROG}2.bin ${PROG}.bin iplsum
CLEANFILES+=	${SRCS:M*.c:S/.c$/.o.S/}

.include <bsd.prog.mk>
.include <bsd.klinks.mk>

# override default rules

# Place code to data section.
.S.o:
	${_MKTARGET_COMPILE}
	${TOOL_SED} -e 's/\.code/.data/' \
	-e 's/\.bss/.section .bss,"aw",@@nobits/' \
	-e 's/\.allow$$/.level	1.0/' -e 's/\.allow/.level/' \
	 ${.IMPSRC} | ${AS} -o ${.TARGET}

# Place code to data section, and make sure all address calculations
# are relative to $global$.
.c.o:
	${_MKTARGET_COMPILE}
	${CC} ${CFLAGS} ${CPPFLAGS} -o $@@.S -S ${.IMPSRC}
	grep -i 'ldil' $@@.S | egrep -v "ldil L'-?[0-9]*," > /dev/null 2>&1; \
		if [ $$? = 0 ]; then \
			echo 'found non-relocatable code' >&2 && exit 1; \
		fi
	${TOOL_SED} -e 's/\.text/.data/' $@@.S | ${AS} -o ${.TARGET}
@


1.5
log
@Ensure a user specified DBG isn't used for xxboot.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.4 2023/01/13 18:43:43 martin Exp $
d3 4
a6 4
NODEBUG=yes
PROG=	xxboot
NOMAN=	# defined
SRCS=	start.S main.c readufs.c readufs_ffs.c readufs_lfs.c milli_tiny.S
@


1.4
log
@Avoid 64bit math in the hppa first stage bootloader. Ok chs@@
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.3 2018/11/13 21:22:38 skrll Exp $
d20 3
@


1.3
log
@Apply -fno-delete-null-pointer-checks so PAGE0 is handled correctly

netinstall.lif works again
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.2 2016/02/21 14:50:05 christos Exp $
d14 1
a14 1
CPPFLAGS+=	-D__daddr_t=int32_t
@


1.3.30.1
log
@Pull up following revision(s) (requested by chs in ticket #168):

	sys/sys/types.h: revision 1.106
	sys/arch/hppa/stand/xxboot/Makefile: revision 1.4

Avoid 64bit math in the hppa first stage bootloader. Ok chs@@
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.3 2018/11/13 21:22:38 skrll Exp $
d14 1
a14 1
CPPFLAGS+=	-D__daddr_t=int32_t -D__ino_t=uint32_t
@


1.2
log
@move the NODEBUG to the boot blocks only.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.1 2014/02/24 07:23:43 skrll Exp $
d18 1
a18 1
COPTS+=		-Os -funsigned-char -mdisable-fpregs -mpa-risc-1-0
@


1.2.18.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.3 2018/11/13 21:22:38 skrll Exp $
d18 1
a18 1
COPTS+=		-Os -fno-delete-null-pointer-checks -funsigned-char -mdisable-fpregs -mpa-risc-1-0
@


1.2.16.1
log
@Sync with HEAD, resolve a couple of conflicts
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.3 2018/11/13 21:22:38 skrll Exp $
d18 1
a18 1
COPTS+=		-Os -fno-delete-null-pointer-checks -funsigned-char -mdisable-fpregs -mpa-risc-1-0
@


1.1
log
@Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.19 2014/01/12 15:26:29 tsutsui Exp $
d3 1
@


1.1.12.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.2 2016/02/21 14:50:05 christos Exp $
a2 1
NODEBUG=yes
@


1.1.10.1
log
@file Makefile was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
@
text
@d1 78
@


1.1.10.2
log
@Rebase to HEAD as of a few days ago.
@
text
@a0 78
#	$NetBSD$

PROG=	xxboot
NOMAN=	# defined
SRCS=	start.S main.c readufs.c readufs_ffs.c readufs_lfs.c milli_tiny.S

.PATH:	${.CURDIR}/../common

CPPFLAGS+=	-I${.CURDIR}/../../../.. -I. -D_STANDALONE
# configuration for readufs module
CPPFLAGS+=	-DUSE_LFS -DUSE_FFS -DUSE_UFS1 -DUSE_UFS2
# IODC can handle only 2GB, so this is enough
CPPFLAGS+=	-D__daddr_t=int32_t
# ANSI C feature prevents from being relocatable
#CPPFLAGS+=	-traditional	# would be best
CPPFLAGS+=	-Dconst=
COPTS+=		-Os -funsigned-char -mdisable-fpregs -mpa-risc-1-0

.include <bsd.own.mk>

LINKS=	${BINDIR}/${PROG} ${BINDIR}/sdboot

BINDIR=		/usr/mdec
STRIPFLAG=
BINMODE=	444

# standalone program
LIBCRTBEGIN=
LIBCRT0=
LIBCRTI=
LIBCRTEND=
LIBC=

S=		${.CURDIR}/../../../..

${PROG}: iplsum ${OBJS}
	${_MKTARGET_LINK}
	${LD} -Ttext 0 -Tdata 0 -e '$$START$$' -N -o $@@1 $(OBJS)
	${LD} -Ttext 0x100 -Tdata 0x23456780 -e '$$START$$' -N -o $@@2 $(OBJS)
	${SIZE} $@@1
	${OBJCOPY} -O binary -j .data $@@1 $@@1.bin
	${OBJCOPY} -O binary -j .data $@@2 $@@2.bin
	cmp $@@1.bin $@@2.bin	# should be same
	${OBJCOPY} -O binary -j .text $@@1 $@@2.bin
	test ! -s $@@2.bin	# text section must be empty
	${_MKMSG} " iplsum " ${.TARGET}
	./iplsum $@@1.bin $@@

iplsum: iplsum.c
	${_MKTARGET_LINK}
	${HOST_CC} -o $@@ ${.CURDIR}/iplsum.c

CLEANFILES+=	${PROG}1 ${PROG}2 ${PROG}1.bin ${PROG}2.bin ${PROG}.bin iplsum
CLEANFILES+=	${SRCS:M*.c:S/.c$/.o.S/}

.include <bsd.prog.mk>
.include <bsd.klinks.mk>

# override default rules

# Place code to data section.
.S.o:
	${_MKTARGET_COMPILE}
	${TOOL_SED} -e 's/\.code/.data/' \
	-e 's/\.bss/.section .bss,"aw",@@nobits/' \
	-e 's/\.allow$$/.level	1.0/' -e 's/\.allow/.level/' \
	 ${.IMPSRC} | ${AS} -o ${.TARGET}

# Place code to data section, and make sure all address calculations
# are relative to $global$.
.c.o:
	${_MKTARGET_COMPILE}
	${CC} ${CFLAGS} ${CPPFLAGS} -o $@@.S -S ${.IMPSRC}
	grep -i 'ldil' $@@.S | egrep -v "ldil L'-?[0-9]*," > /dev/null 2>&1; \
		if [ $$? = 0 ]; then \
			echo 'found non-relocatable code' >&2 && exit 1; \
		fi
	${TOOL_SED} -e 's/\.text/.data/' $@@.S | ${AS} -o ${.TARGET}
@


1.1.10.3
log
@update from HEAD
@
text
@a2 1
NODEBUG=yes
@


1.1.6.1
log
@file Makefile was added on branch yamt-pagecache on 2014-05-22 11:39:51 +0000
@
text
@d1 78
@


1.1.6.2
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@a0 78
#	$NetBSD$

PROG=	xxboot
NOMAN=	# defined
SRCS=	start.S main.c readufs.c readufs_ffs.c readufs_lfs.c milli_tiny.S

.PATH:	${.CURDIR}/../common

CPPFLAGS+=	-I${.CURDIR}/../../../.. -I. -D_STANDALONE
# configuration for readufs module
CPPFLAGS+=	-DUSE_LFS -DUSE_FFS -DUSE_UFS1 -DUSE_UFS2
# IODC can handle only 2GB, so this is enough
CPPFLAGS+=	-D__daddr_t=int32_t
# ANSI C feature prevents from being relocatable
#CPPFLAGS+=	-traditional	# would be best
CPPFLAGS+=	-Dconst=
COPTS+=		-Os -funsigned-char -mdisable-fpregs -mpa-risc-1-0

.include <bsd.own.mk>

LINKS=	${BINDIR}/${PROG} ${BINDIR}/sdboot

BINDIR=		/usr/mdec
STRIPFLAG=
BINMODE=	444

# standalone program
LIBCRTBEGIN=
LIBCRT0=
LIBCRTI=
LIBCRTEND=
LIBC=

S=		${.CURDIR}/../../../..

${PROG}: iplsum ${OBJS}
	${_MKTARGET_LINK}
	${LD} -Ttext 0 -Tdata 0 -e '$$START$$' -N -o $@@1 $(OBJS)
	${LD} -Ttext 0x100 -Tdata 0x23456780 -e '$$START$$' -N -o $@@2 $(OBJS)
	${SIZE} $@@1
	${OBJCOPY} -O binary -j .data $@@1 $@@1.bin
	${OBJCOPY} -O binary -j .data $@@2 $@@2.bin
	cmp $@@1.bin $@@2.bin	# should be same
	${OBJCOPY} -O binary -j .text $@@1 $@@2.bin
	test ! -s $@@2.bin	# text section must be empty
	${_MKMSG} " iplsum " ${.TARGET}
	./iplsum $@@1.bin $@@

iplsum: iplsum.c
	${_MKTARGET_LINK}
	${HOST_CC} -o $@@ ${.CURDIR}/iplsum.c

CLEANFILES+=	${PROG}1 ${PROG}2 ${PROG}1.bin ${PROG}2.bin ${PROG}.bin iplsum
CLEANFILES+=	${SRCS:M*.c:S/.c$/.o.S/}

.include <bsd.prog.mk>
.include <bsd.klinks.mk>

# override default rules

# Place code to data section.
.S.o:
	${_MKTARGET_COMPILE}
	${TOOL_SED} -e 's/\.code/.data/' \
	-e 's/\.bss/.section .bss,"aw",@@nobits/' \
	-e 's/\.allow$$/.level	1.0/' -e 's/\.allow/.level/' \
	 ${.IMPSRC} | ${AS} -o ${.TARGET}

# Place code to data section, and make sure all address calculations
# are relative to $global$.
.c.o:
	${_MKTARGET_COMPILE}
	${CC} ${CFLAGS} ${CPPFLAGS} -o $@@.S -S ${.IMPSRC}
	grep -i 'ldil' $@@.S | egrep -v "ldil L'-?[0-9]*," > /dev/null 2>&1; \
		if [ $$? = 0 ]; then \
			echo 'found non-relocatable code' >&2 && exit 1; \
		fi
	${TOOL_SED} -e 's/\.text/.data/' $@@.S | ${AS} -o ${.TARGET}
@


1.1.4.1
log
@file Makefile was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
@
text
@d1 78
@


1.1.4.2
log
@sync with head
@
text
@a0 78
#	$NetBSD$

PROG=	xxboot
NOMAN=	# defined
SRCS=	start.S main.c readufs.c readufs_ffs.c readufs_lfs.c milli_tiny.S

.PATH:	${.CURDIR}/../common

CPPFLAGS+=	-I${.CURDIR}/../../../.. -I. -D_STANDALONE
# configuration for readufs module
CPPFLAGS+=	-DUSE_LFS -DUSE_FFS -DUSE_UFS1 -DUSE_UFS2
# IODC can handle only 2GB, so this is enough
CPPFLAGS+=	-D__daddr_t=int32_t
# ANSI C feature prevents from being relocatable
#CPPFLAGS+=	-traditional	# would be best
CPPFLAGS+=	-Dconst=
COPTS+=		-Os -funsigned-char -mdisable-fpregs -mpa-risc-1-0

.include <bsd.own.mk>

LINKS=	${BINDIR}/${PROG} ${BINDIR}/sdboot

BINDIR=		/usr/mdec
STRIPFLAG=
BINMODE=	444

# standalone program
LIBCRTBEGIN=
LIBCRT0=
LIBCRTI=
LIBCRTEND=
LIBC=

S=		${.CURDIR}/../../../..

${PROG}: iplsum ${OBJS}
	${_MKTARGET_LINK}
	${LD} -Ttext 0 -Tdata 0 -e '$$START$$' -N -o $@@1 $(OBJS)
	${LD} -Ttext 0x100 -Tdata 0x23456780 -e '$$START$$' -N -o $@@2 $(OBJS)
	${SIZE} $@@1
	${OBJCOPY} -O binary -j .data $@@1 $@@1.bin
	${OBJCOPY} -O binary -j .data $@@2 $@@2.bin
	cmp $@@1.bin $@@2.bin	# should be same
	${OBJCOPY} -O binary -j .text $@@1 $@@2.bin
	test ! -s $@@2.bin	# text section must be empty
	${_MKMSG} " iplsum " ${.TARGET}
	./iplsum $@@1.bin $@@

iplsum: iplsum.c
	${_MKTARGET_LINK}
	${HOST_CC} -o $@@ ${.CURDIR}/iplsum.c

CLEANFILES+=	${PROG}1 ${PROG}2 ${PROG}1.bin ${PROG}2.bin ${PROG}.bin iplsum
CLEANFILES+=	${SRCS:M*.c:S/.c$/.o.S/}

.include <bsd.prog.mk>
.include <bsd.klinks.mk>

# override default rules

# Place code to data section.
.S.o:
	${_MKTARGET_COMPILE}
	${TOOL_SED} -e 's/\.code/.data/' \
	-e 's/\.bss/.section .bss,"aw",@@nobits/' \
	-e 's/\.allow$$/.level	1.0/' -e 's/\.allow/.level/' \
	 ${.IMPSRC} | ${AS} -o ${.TARGET}

# Place code to data section, and make sure all address calculations
# are relative to $global$.
.c.o:
	${_MKTARGET_COMPILE}
	${CC} ${CFLAGS} ${CPPFLAGS} -o $@@.S -S ${.IMPSRC}
	grep -i 'ldil' $@@.S | egrep -v "ldil L'-?[0-9]*," > /dev/null 2>&1; \
		if [ $$? = 0 ]; then \
			echo 'found non-relocatable code' >&2 && exit 1; \
		fi
	${TOOL_SED} -e 's/\.text/.data/' $@@.S | ${AS} -o ${.TARGET}
@


