blob: b65c88b9a82bbad919bf7875b0ac6b7942c7c9e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# $NetBSD: Makefile,v 1.18 2021/03/24 02:53:16 rin Exp $
S= ${.CURDIR}/../../../..
PROG= altboot
FILES+= ${PROG}.bin ${PROG}.img
NOMAN= # defined
SRCS= entry.S main.c brdsetup.c pci.c devopen.c dev_net.c memfs.c
SRCS+= nif.c fxp.c tlp.c rge.c skg.c stg.c
SRCS+= dsk.c pciide.c siisata.c
SRCS+= exception.c
CLEANFILES+= ${PROG} ${PROG}.bin ${PROG}.img
CFLAGS+= -Wall -Wno-main -ffreestanding
CFLAGS+= ${${ACTIVE_CC} == "gcc":? -msoft-float :}
CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT
#CPPFLAGS+= -DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200
#CPPFLAGS+= -DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600
CPPFLAGS+= -nostdinc -I. -I${.OBJDIR} -I${S}
DBG= -Os
.include <bsd.own.mk>
.include <bsd.klinks.mk>
# XXX SHOULD NOT NEED TO DEFINE THESE!
LIBCRT0=
LIBCRTI=
LIBC=
LIBCRTBEGIN=
LIBCRTEND=
STRIPFLAG=
BINMODE= 444
RELOC= 1000000
ENTRY= _start
### find out what to use for libkern
KERN_AS= library
.include "${S}/lib/libkern/Makefile.inc"
LIBKERN= ${KERNLIB}
### find out what to use for libz
Z_AS= library
.include "${S}/lib/libz/Makefile.inc"
LIBZ= ${ZLIB}
### find out what to use for libsa
SA_AS= library
SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
.include "${S}/lib/libsa/Makefile.inc"
LIBSA= ${SALIB}
cleandir distclean: .WAIT cleanlibdir
cleanlibdir:
-rm -rf lib
${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
${_MKTARGET_LINK}
${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin
${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \
-a 0x${RELOC} -n ${PROG} ${PROG}.bin ${PROG}.img
VERSIONFLAGS+=-k
.include "${S}/conf/newvers_stand.mk"
.include <bsd.prog.mk>
|