1 # $NetBSD: Makefile,v 1.11 2009/01/12 07:42:30 tsutsui Exp $
5 DIR_TOP
= ${.CURDIR
}/..
/..
/..
/..
/..
6 DIR_SA
= ${DIR_TOP}/lib
/libsa
7 DIR_KERN
= ${DIR_TOP}/lib
/libkern
8 DIR_KERN_MD
= ${DIR_TOP}/lib
/libkern
/arch
/$(MACHINE_ARCH
)
9 DIR_LIBC
= ${DIR_TOP}/..
/common
/lib
/libc
11 .PATH
: ${.CURDIR
}/..
/boot
$(DIR_SA
) $(DIR_KERN
) $(DIR_KERN_MD
) \
12 ${DIR_LIBC}/gen
${DIR_LIBC}/arch
/m68k
/gen \
13 ${DIR_LIBC}/inet
${DIR_LIBC}/arch
/m68k
/inet \
14 ${DIR_LIBC}/quad
${DIR_LIBC}/arch
/m68k
/quad \
15 ${DIR_LIBC}/string
${DIR_LIBC}/arch
/m68k
/string
18 # prefer our assembler versions over assembler, and assembler over C:
21 .SUFFIXES
: .out .o .po .so .s .S .c .
cc .C .f .y .l .ln .m4 .sh
23 FILES
= bootxx_ffs bootxx_fd
26 COBJS
= main.o console.o xd.o twiddle.o bzero.o gets.o
27 COBJS
+= lseek.o open.o read.o close.o dev.o errno.o
28 COBJS
+= ufs.o ustarfs.o panic.o vers.o files.o
30 SOBJS
= alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o
31 SOBJS
+= strlen.o strcmp.o fstat.o
32 SOBJS
+= libstubs.o memcmp.o memmove.o memset.o strncmp.o
34 OBJS
= $(SOBJS
) $(COBJS
)
36 DEFS
= -D_STANDALONE
-DSA_EXEC_ANYOWNER
-D_PRIMARY_BOOT
38 .NOPATH
: ${OBJS} x.out f.out libboot.a xxstart.o
42 realall
: machine m68k
${FILES}
44 CLEANFILES
+= bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a vers.c machine m68k
46 .
include <bsd.prog.mk
>
48 ### special rules for bootblocks ###
50 INCPATH
= -nostdinc
-I
${DIR_TOP} -I
${DIR_TOP}/lib
/libsa
-I
${.CURDIR
}
51 INCPATH
+= -I
${.CURDIR
}/..
/boot
-I
${.CURDIR
}/..
/..
/..
52 INCPATH
+= -I
${.CURDIR
}/..
/aout2bb
-I
${.OBJDIR
}
55 CAFLAGS
+= -Wa
,-l
-Wa
,-m68030
${INCPATH} -D_PRIMARY_BOOT
57 COPTIM
= -Os
-fomit-frame-pointer
-fcse-follow-jumps
-fcse-skip-blocks
-Wa
,-l
-m68060
-Wa
,-m68030
58 CFLAGS
= -ffreestanding
${COPTIM} ${INCPATH} ${DEFS} -Wall
#-Wstrict-prototypes
60 NETBSD_VERS
!= ${HOST_SH} ${.CURDIR
}/..
/..
/..
/..
/..
/conf
/osrelease.sh
61 DEFS
+= -DNETBSD_VERS
='"${NETBSD_VERS}"'
63 # Use small daddr_t to avoid code bloat
64 DEFS
+= -D__daddr_t
=int32_t
67 ${CC} ${CFLAGS} -S
$< -o
$*.s
68 ${TXLT} < $*.s |
${AS} ${AFLAGS} -o
$*.o
71 .s.o
: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp
-o
$@
-c
$<
73 .S.o
: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp
-o
$@
-c
$<
76 ${RELOC2BB} x.out
$@ ||
${NM} -u x.out
79 ${RELOC2BB} -F f.out
$@ ||
${NM} -u f.out
81 x.out
: xxstart.o libboot.a
82 ${LD} ${LDFLAGS} -r
-dc
-e _start
-o
$@
$>
86 f.out
: fdstart.o libboot.a
87 ${LD} ${LDFLAGS} -r
-dc
-e _start
-o
$@
$>
91 xxstart.o
: ${.CURDIR
}/..
/boot
/bbstart.s
92 ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
95 fdstart.o
: ${.CURDIR
}/..
/boot
//bbstart.s
96 ${CC} -DAUTOLOAD
=8192 ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
100 ${AR} r
$@
$> && ${RANLIB} $@
103 vers.c
: ${.CURDIR
}/..
/boot
/version
104 ${HOST_SH} ${DIR_TOP}/conf
/newvers_stand.sh
-NDM
${.CURDIR
}/..
/boot
/version
"amiga"
106 .if
!make
(obj
) && !make
(clean) && !make
(cleandir
)
107 .NOPATH
: machine m68k
112 ln
-s
${DIR_TOP}/arch
/amiga
/include $@
116 ln
-s
${DIR_TOP}/arch
/m68k
/include $@
119 # make sure these are built:
122 ${FILES}: ${RELOC2BB}
124 .
include "${.CURDIR}/../Makefile.booters"