Makefile.usermode revision 1.11
1# $NetBSD: Makefile.usermode,v 1.11 2011/08/21 15:06:27 reinoud Exp $
2
3MACHINE_ARCH=			usermode
4USETOOLS?=			no
5NEED_OWN_INSTALL_TARGET?=	no
6.include <bsd.own.mk>
7
8##
9## (1) port identification
10##
11USERMODE=	$S/arch/usermode
12GENASSYM_CONF=	${USERMODE}/usermode/genassym.cf
13
14##
15## (2) compile settings
16##
17USERMODE_LIBS=	-lrt
18
19DEFCOPTS=	-O2 -fno-omit-frame-pointer
20CPPFLAGS+=	-Dusermode
21CPPFLAGS.init_main.c+=	-Dmain=kernmain
22
23CPPFLAGS.thunk.c+=	-U_KERNEL -I/usr/include
24
25##
26## (3) libkern and compat
27##
28KERN_AS=	obj
29COMPAT_AS=	obj
30
31##
32## (4) local objects, compile rules, and dependencies
33##
34MD_OBJS=	thunk.o
35MD_CFILES=	${USERMODE}/usermode/thunk.c
36MD_SFILES=
37
38##
39## (5) link settings
40##
41SYSTEM_LD=	@${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}"; \
42		${_MKSHECHO}\
43		${CC} ${COPTS} -Wl,-Map,$@.map,-Bstatic -o $@ '$${SYSTEM_OBJ}' '$${EXTRA_OBJ}' vers.o ${USERMODE_LIBS}; \
44		${CC} ${COPTS} -Wl,-Map,$@.map,-Bstatic -o $@ ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o ${USERMODE_LIBS}
45NVFLAGS=	-n
46
47##
48## (6) port specific target dependencies
49##
50
51.if !make(obj) && !make(clean) && !make(cleandir)
52.BEGIN:
53	@rm -f i386 && \
54		ln -s $S/arch/i386/include i386
55.endif
56
57thunk.o: ${USERMODE}/usermode/thunk.c
58	${CC} ${COPTS} -I${.CURDIR} -c -o $@ ${USERMODE}/usermode/thunk.c
59
60##
61## (7) misc settings
62##
63
64##
65## (8) config(8) generated machinery
66%INCLUDES
67
68%OBJS
69
70%CFILES
71
72%SFILES
73
74%LOAD
75
76%RULES
77
78##
79## (9) port independent kernel machinery
80##
81.include "$S/conf/Makefile.kern.inc"
82
83##
84## (10) appending make options
85##
86%MAKEOPTIONSAPPEND
87