blob: 4bbabc7b17c3057ee2250d433cdc4908f3f38389 (
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
|
# $OpenBSD: Makefile,v 1.10 2012/08/29 22:23:08 pascal Exp $
.include "${.CURDIR}/../Makefile.inc"
MAN= cdboot.8
.if ${MACHINE} == "i386"
PROG= cdboot
LD?= ld
SIZE?= size
LDFLAGS+=-nostdlib -Bstatic
INSTALL_STRIP=
LDFLAGS+=-Ttext $(LINKADDR) -N -x -noinhibit-exec -nopie
CLEANFILES+= crt0.o ${PROG}.whole
SRCS= srt0.S
SRCS+= boot.c cmd.c vars.c bootarg.c conf.c
S =${.CURDIR}/../../../..
SADIR= ${.CURDIR}/..
LDADD= ${LIBSA} ${LIBZ}
DPADD= ${LIBSA} ${LIBZ}
.PATH: ${S}/lib/libkern/arch/i386 ${S}/lib/libkern
SRCS+= strlcpy.c moddi3.c divdi3.c qdivrem.c
.PATH: ${S}/stand/boot
${PROG}: $(OBJS) $(DPADD)
$(LD) $(LDFLAGS) -o ${PROG} $(OBJS) $(LDADD)
@$(SIZE) ${PROG}
cp ${PROG} ${PROG}.whole
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}
CFLAGS+=${SACFLAGS} -D__INTERNAL_LIBSA_CREAD
CFLAGS+=-DOSREV=\"${OSREV}\" -DMACHINE=\"${MACHINE}\"
CFLAGS+=-DKERNEL=\"/${OSREV}/${MACHINE}/bsd.rd\"
CFLAGS+=-fno-pie
#AFLAGS+=-Wa,-R
# AFLAGS+=-Wa,-a
AFLAGS+=-fno-pie
|