1 # MINIX-specific servers/drivers options
4 # LSC: Our minimal c library has no putchar, which is called by the builtin
5 # functions of the compiler, so prevent using them.
7 AFLAGS
+= -D__ASSEMBLY__
10 # For MKCOVERAGE builds, enable coverage options.
11 .if
${MKCOVERAGE
:Uno
} == "yes"
12 CPPFLAGS
+= ${COVCPPFLAGS}
14 .
endif # ${MKCOVERAGE:Uno} == "yes"
16 # LSC Static linking, order matters!
17 # We can't use --start-group/--end-group as they are not supported by our
21 LDADD
:= -nodefaultlibs
${LDADD}
23 # 2. Services system library
27 # 3. Minimal C library, if libc had not yet been added
28 .if
${LDADD
:M-lc
} == ""
31 .
endif # empty(${LDADD:M-lc})
33 .if
${MACHINE_ARCH} == "earm"
35 # LSC: On ARM, when compiling statically, with gcc, lgcc_eh is required
36 .if
${PROG
:U
} != "kernel" && !empty
(CC
:M
*gcc
)
37 # gcc_eh uses abort(), which is provided by minc
38 LDFLAGS
+= ${${ACTIVE_CC} == "gcc":?
-lgcc_eh
:}
39 .
endif # ${PROG:U} != "kernel" && !empty(CC:M*gcc)
41 .
endif # ${MACHINE_ARCH} == "earm"
43 # Get (more) internal minix definitions and declarations.
44 CPPFLAGS
+= -D_MINIX_SYSTEM
=1
46 # For MKMAGIC builds, link services against libmagicrt and run the magic pass
47 # on them, unless they have specifically requested to be built without bitcode.
48 .if
${USE_BITCODE
:Uno
} == "yes" && ${USE_MAGIC
:Uno
} == "yes"
49 LIBMAGICST?
= ${DESTDIR}${LIBDIR}/libmagicrt.bcc
50 MAGICPASS?
= ${NETBSDSRCDIR}/minix
/llvm
/bin
/magic.so
52 DPADD
+= ${LIBMAGICST} ${MAGICPASS}
54 .for _P in
${PROGS
:U
${PROG}}
55 BITCODE_LD_FLAGS_1ST.
${_P}?
= ${LIBMAGICST}
59 OPTFLAGS
+= -load
${MAGICPASS} -magic
${MAGICFLAGS}
61 # For MKASR builds, generate an additional set of rerandomized service
63 .if
${USE_ASR
:Uno
} == "yes"
64 ASRPASS?
= ${NETBSDSRCDIR}/minix
/llvm
/bin
/asr.so
66 ASRDIR?
= /usr
/service
/asr
70 OPTFLAGS
+= -load
${ASRPASS} -asr
72 # Produce a variable _RANGE that contains "1 2 3 .. ${ASRCOUNT}". We do not
73 # want to invoke a shell command to do this; what if the host platform does not
74 # have seq(1) ? So, we do it with built-in BSD make features instead. There
75 # are probably substantially better ways to do this, though. Right now the
76 # maximum ASRCOUNT is 65536 (16**4), which should be plenty. An ASRCOUNT of 0
77 # is not supported, nor would it be very useful.
80 _G
= ${_G0
:S
/x
/${_G0}/g
:S
/x
/${_G0}/g
:S
/x
/${_G0}/g
}
81 .for _X in
${_G
:C
/^
(.
{${ASRCOUNT}}).
*/\
1/:S
/x
/x
/g
}
82 _RANGE
:= ${_RANGE} ${_RANGE
:[#]}
84 _RANGE
:= ${_RANGE
:[2..
-1]}
86 # Add progname-1, progname-2, progname-3 (etc) to the list of programs to
87 # generate, and install (just) these to ASRDIR.
91 .for _P in
${_PROGLIST}
93 SRCS.
${_P}-${_N}= ${SRCS.
${_P}:U
${SRCS}}
94 BITCODE_LD_FLAGS_1ST.
${_P}-${_N}:= ${BITCODE_LD_FLAGS_1ST.
${_P}}
95 BINDIR.
${_P}-${_N}= ${ASRDIR}
99 .
endif # ${USE_ASR:Uno} == "yes"
100 .
endif # ${USE_BITCODE:Uno} == "yes" && ${USE_MAGIC:Uno} == "yes"
102 .
include <bsd.prog.mk
>