Makefile.sun2 revision 1.11
1# $NetBSD: Makefile.sun2,v 1.11 2001/12/01 15:23:18 fredette 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/sun2/conf/``machineid''
9# after which you should do
10#	config machineid
11# Machine generic makefile changes should be made in
12#	/sys/arch/sun2/conf/Makefile.sun2
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=m68000
21USETOOLS?=	no
22NEED_OWN_INSTALL_TARGET?=no
23.include <bsd.own.mk>
24
25##
26## (1) port identification
27##
28SUN2=		$S/arch/sun2
29GENASSYM=	${SUN2}/sun2/genassym.cf
30
31##
32## (2) compile settings
33##
34# Override CPP defaults entirely, so cross-compilation works.
35# Keep -nostdinc before all -I flags, similar for -undef ...
36XDEFS=		-undef -D__NetBSD__ -Dm68k -Dmc68000 -D__ELF__ -D__SVR4_ABI__
37DEFINES=	-Dsun2
38CPPFLAGS+=	${XDEFS} ${DEFINES}
39CFLAGS+=	-msoft-float -fno-defer-pop
40APPFLAGS=	-x assembler-with-cpp -P -traditional ${CPPFLAGS} -D_LOCORE
41
42# Do NOT assume the compiler does "-x funny_format" (gcc-specific)
43# This needs an intermediate file.  The original file is always
44# safe in some far away directory, so just use the base name.
45NORMAL_S=	${CPP} ${APPFLAGS} $< > $*.s ;\
46		${AS} -o $@ $*.s ; rm $*.s
47
48##
49## (3) libkern and compat
50##
51KERN_AS=	obj
52# XXX lib/libkern/arch/m68k/Makefile.inc needs to know that
53# XXX our MACHINE_ARCH is m68000, and not m68k.  --fredette
54KERNMISCMAKEFLAGS=	MACHINE_ARCH=${MACHINE_ARCH}
55
56##
57## (4) local objects, compile rules, and dependencies
58##
59MD_OBJS=	locore.o
60MD_CFILES=
61MD_SFILES=	${SUN2}/sun2/locore.s
62
63locore.o: ${SUN2}/sun2/locore.s
64	${NORMAL_S}
65
66##
67## (5) link settings
68##
69LINKFORMAT=	-N
70TEXTADDR?=	00006000
71
72##
73## (6) port specific target dependencies
74##
75
76# For cross-compilation, the "gcc -M" mkdep script is convenient,
77# but that does not correctly make rules from *.s files.  The
78# easiest work-around is to just list those dependencies here.
79locore.o:   assym.h m68k/asm.h m68k/trap.h
80copy.o:     assym.h m68k/asm.h $S/sys/errno.h
81bcopy.o:    assym.h m68k/asm.h
82copypage.o: assym.h m68k/asm.h
83
84# depend on CPU configuration
85db_machdep.o dvma.o machdep.o pmap.o sun2_startup.o vm_machdep.o: Makefile
86
87# depends on DDB, etc.
88stub.o: Makefile
89
90##
91## (7) misc settings
92##
93MKDEP_AFLAGS=	${APPFLAGS}
94
95##
96## (8) config(8) generated machinery
97##
98%INCLUDES
99
100%OBJS
101
102%CFILES
103
104%SFILES
105
106%LOAD
107
108%RULES
109
110##
111## (9) port independent kernel machinery
112##
113.include "$S/conf/Makefile.kern.inc"
114