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