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