blob: 3b9857cd3e29835ac580ab11f2945a13d36851e7 (
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
71
|
# $OpenBSD: Makefile,v 1.14 2012/09/25 09:01:03 pascal Exp $
.include "${.CURDIR}/../Makefile.inc"
MAN= cdboot.8
.if ${MACHINE} == "amd64"
S =${.CURDIR}/../../../..
SADIR= ${.CURDIR}/..
PROG= cdboot
SRCS= srt0.S boot.c conf.c
LD?= ld
SIZE?= size
LDFLAGS+=-nostdlib -Bstatic -Ttext $(LINKADDR) -N -x -noinhibit-exec -nopie
LDFLAGS+=-melf_i386 -L/usr/libdata
INSTALL_STRIP=
.PATH: ${SADIR}/libsa
# i386 stuff (so, it will possibly load in the same 64k)
SRCS+= machdep.c dev_i386.c exec_i386.c cmd_i386.c
SRCS+= gidt.S alloca.S biosdev.c bioscons.c gateA20.c \
memprobe.c diskprobe.c time.c ## biosprobe.c
.PATH: ${S}/stand/boot
SRCS+= cmd.c vars.c bootarg.c
.PATH: ${S}/lib/libsa
SRCS+= alloc.c exit.c strcmp.c strlen.c \
strncmp.c memcmp.c memcpy.c memset.c printf.c snprintf.c \
strerror.c strncpy.c strtol.c strtoll.c ctime.c strlcpy.c
SRCS+= close.c closeall.c dev.c disklabel.c dkcksum.c fstat.c lseek.c \
open.c read.c stat.c cread.c readdir.c cons.c loadfile.c \
elf32.c elf64.c
SRCS+= ufs.c cd9660.c
.PATH: ${S}/lib/libkern/arch/i386 ${S}/lib/libkern
SRCS+= divdi3.c moddi3.c qdivrem.c
.PATH: ${S}/lib/libz
SRCS+= adler32.c crc32.c inflate.c inftrees.c
#LDADD= ${LIBSA} ${LIBZ}
#DPADD= ${LIBSA} ${LIBZ}
${PROG}: $(OBJS) $(DPADD)
$(LD) $(LDFLAGS) -o ${PROG} $(OBJS) $(LDADD)
@$(SIZE) $(PROG)
@if [ -x ${.OBJDIR}/${PROG} ]; then \
objcopy -O binary ${PROG} ${.OBJDIR}/.tmp;\
mv -f ${.OBJDIR}/.tmp ${.OBJDIR}/${PROG}; \
ls -l ${.OBJDIR}/${PROG}; \
fi
.else
NOPROG=
.endif
.include <bsd.prog.mk>
CPPFLAGS+=-DBOOTMAGIC=$(BOOTMAGIC) ${DEBUGFLAGS}
CPPFLAGS+=-DLINKADDR=${LINKADDR}
CPPFLAGS+=-DSLOW -DSMALL -DNOBYFOUR -DNO_GZIP -DDYNAMIC_CRC_TABLE
CPPFLAGS+=-I${S}/stand/boot
CFLAGS+=-m32
CFLAGS+=${SACFLAGS} -D__INTERNAL_LIBSA_CREAD
CFLAGS+=-DOSREV=\"${OSREV}\" -DMACHINE=\"${MACHINE}\"
CFLAGS+=-DKERNEL=\"/${OSREV}/${MACHINE}/bsd.rd\"
CFLAGS+=-fno-pie
AFLAGS+=-m32
AFLAGS+=-fno-pie
|