1# $NetBSD: Makefile.sun3,v 1.111 2023/06/03 08:52:57 lukem Exp $
2
3# Makefile for NetBSD
4#
5# This makefile is constructed from a machine description:
6#	config machineid
7# Most changes should be made in the machine description
8#	/sys/arch/sun3/conf/``machineid''
9# after which you should do
10#	config machineid
11# Machine generic makefile changes should be made in
12#	/sys/arch/sun3/conf/Makefile.sun3
13# after which config should be rerun for all machines of that type.
14#
15# To specify debugging, add the config line: makeoptions DEBUG="-g"
16# A better way is to specify -g only for a few files.
17#
18#	makeoptions DEBUGLIST="uvm* trap if_*"
19
20MACHINE_ARCH=m68k
21USETOOLS?=	no
22NEED_OWN_INSTALL_TARGET?=no
23.include <bsd.own.mk>
24
25##
26## (1) port identification
27##
28SUN3=		$S/arch/sun3
29GENASSYM_CONF=	${SUN3}/${MACHTYPE}/genassym.cf
30
31##
32## (2) compile settings
33##
34CPPFLAGS+=	-Dsun3
35CFLAGS+=	${CMACHFLAGS} -fno-defer-pop
36CFLAGS+=	-msoft-float
37AFLAGS+=	-x assembler-with-cpp
38COPTS.sunmon.c+=${CC_WNO_ADDRESS_OF_PACKED_MEMBER} ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-error=array-bounds :}
39
40##
41## (3) libkern and compat
42##
43OPT_MODULAR=   %MODULAR%
44
45##
46## (4) local objects, compile rules, and dependencies
47##
48MD_OBJS=	locore.o
49MD_CFILES=
50MD_SFILES=	${SUN3}/${MACHTYPE}/locore.s
51
52locore.o: ${SUN3}/${MACHTYPE}/locore.s
53	${NORMAL_S}
54
55.include "$S/arch/m68k/conf/Makefile.kern.m68k.inc"
56
57##
58## (5) link settings
59##
60.if ${MACHTYPE} == "sun3x"
61TEXTADDR?=	F8004000
62.else
63TEXTADDR?=	0E004000
64.endif
65LINKFORMAT=	-N
66
67##
68## (6) port specific target dependencies
69##
70
71# For cross-compilation, the "gcc -M" mkdep script is convenient,
72# but that does not correctly make rules from *.s files.  The
73# easiest work-around is to just list those dependencies here.
74locore.o:   assym.h m68k/asm.h m68k/trap.h
75copy.o:     assym.h m68k/asm.h $S/sys/errno.h
76bcopy.o:    assym.h m68k/asm.h
77copypage.o: assym.h m68k/asm.h
78lock_stubs.o: assym.h
79
80# depend on CPU configuration
81db_machdep.o dvma.o machdep.o pmap.o sun3_startup.o vm_machdep.o: Makefile
82
83# depends on DDB, etc.
84stub.o: Makefile
85
86##
87## (7) misc settings
88##
89
90##
91## (8) config(8) generated machinery
92##
93%INCLUDES
94
95%OBJS
96
97%CFILES
98
99%SFILES
100
101%LOAD
102
103%RULES
104
105##
106## (9) port independent kernel machinery
107##
108.include "$S/conf/Makefile.kern.inc"
109
110##
111## (10) Appending make options.
112##
113%MAKEOPTIONSAPPEND
114