1# $NetBSD: Makefile.hppa,v 1.9 2023/08/08 06:27:32 mrg 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/hppa/conf/``machineid''
9# after which you should do
10#	config machineid
11# Machine generic makefile changes should be made in
12#	/sys/arch/hppa/conf/Makefile.hppa
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=hppa
21NEED_OWN_INSTALL_TARGET?=no
22.include <bsd.own.mk>
23
24##
25## (1) port identification
26##
27HPPA=		$S/arch/hppa
28GENASSYM_CONF=	${HPPA}/hppa/genassym.cf
29
30##
31## (2) compile settings
32##
33CPPFLAGS+=	-Dhppa
34CFLAGS+=	-mpa-risc-1-1 -msoft-float -mdisable-fpregs
35
36.include "${HPPA}/spmath/Makefile.inc"
37
38.ifndef PROF
39LIBSPMATH=	${SPMATH}
40.else
41LIBSPMATH=	${SPMATH_PROF}
42.endif
43
44CFLAGS+=	-mno-space-regs -mfast-indirect-calls -mportable-runtime
45AFLAGS+=	-x assembler-with-cpp -P -traditional
46
47OPT_DDB=	%DDB%
48.if !empty(OPT_DDB)
49CFLAGS+=	-fno-omit-frame-pointer
50.endif
51
52##
53## (3) libkern and compat
54##
55OPT_MODULAR=	%MODULAR%
56
57##
58## (4) local objects, compile rules, and dependencies
59##
60MD_OBJS=	locore.o
61MD_LIBS=	${LIBSPMATH}
62MD_CFILES=
63MD_SFILES=	${HPPA}/hppa/locore.S
64
65locore.o: ${HPPA}/hppa/locore.S
66	${NORMAL_S}
67
68##
69## (5) link settings
70##
71KERNLDSCRIPT=	${HPPA}/conf/ld.script
72TEXTADDR?=	00200000
73LINKFLAGS_NORMAL=       -X
74EXTRA_LINKFLAGS= -Map $@.map
75
76##
77## (6) port specific target dependencies
78##
79
80# depend on CPU configuration
81db_machdep.o machdep.o pmap.o vm_machdep.o: Makefile
82
83# depends on KGDBDEV, KGDBRATE, DDB, etc.
84com_gsc.o clock.o pdc.o autoconf.o machdep.o: Makefile
85
86##
87## (7) misc settings
88##
89
90# GCC 12 gets this wrong
91COPTS.pdc.c+=	${CC_WNO_ARRAY_BOUNDS}
92
93##
94## (8) config(8) generated machinery
95##
96%INCLUDES
97
98%OBJS
99
100%CFILES
101
102%SFILES
103
104%LOAD
105
106%RULES
107
108##
109## (9) port independent kernel machinery
110##
111.include "$S/conf/Makefile.kern.inc"
112
113##
114## (10) Appending make options.
115##
116%MAKEOPTIONSAPPEND
117