]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - stand/kshim/kshim.mk
ident(1): Normalizing date format
[FreeBSD/FreeBSD.git] / stand / kshim / kshim.mk
1 #
2 # $FreeBSD$
3 #
4 # Copyright (c) 2013 Hans Petter Selasky.
5 # Copyright (c) 2014 SRI International
6 # All rights reserved.
7 #
8 # This software was developed by SRI International and the University of
9 # Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
10 # ("CTSRD"), as part of the DARPA CRASH research programme.
11 #
12 # Redistribution and use in source and binary forms, with or without
13 # modification, are permitted provided that the following conditions
14 # are met:
15 # 1. Redistributions of source code must retain the above copyright
16 #    notice, this list of conditions and the following disclaimer.
17 # 2. Redistributions in binary form must reproduce the above copyright
18 #    notice, this list of conditions and the following disclaimer in the
19 #    documentation and/or other materials provided with the distribution.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 # ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 # SUCH DAMAGE.
32 #
33
34 KSHIM_DIR:=     ${.PARSEDIR}
35 .PATH:          ${KSHIM_DIR}
36
37 CFLAGS+=        -I${KSHIM_DIR}
38 CFLAGS+=        -I${KSHIM_DIR}/../..
39 CFLAGS+=        -DUSB_GLOBAL_INCLUDE_FILE=\"bsd_global.h\"
40 CFLAGS+=        -DHAVE_ENDIAN_DEFS
41
42 #
43 # Single threaded BSD kernel
44 #
45 KSRCS+= bsd_kernel.c
46
47 #
48 # BUSSPACE implementation
49 #
50 KSRCS+= bsd_busspace.c
51
52 SRCS+=  sysinit_data.c
53 SRCS+=  sysuninit_data.c
54
55 CLEANFILES+= sysinit.bin
56 CLEANFILES+= sysinit_data.c
57 CLEANFILES+= sysuninit_data.c
58
59 SRCS+=  ${KSRCS}
60 SYSINIT_OBJS=   ${KSRCS:R:C/$/.osys/}
61 CLEANFILES+=    ${SYSINIT_OBJS}
62
63 #
64 # SYSINIT() and SYSUNINIT() handling
65 #
66
67 sysinit_data.c: sysinit.bin
68         sysinit -i sysinit.bin -o ${.TARGET} -k sysinit -s sysinit_data
69
70 sysuninit_data.c: sysinit.bin
71         sysinit -i sysinit.bin -o ${.TARGET} -R -k sysuninit -s sysuninit_data
72
73 .for KSRC in ${KSRCS:R}
74 ${KSRC}.osys: ${KSRC}.o
75         ${OBJCOPY} -j ".debug.sysinit" -O binary ${KSRC}.o ${KSRC}.osys
76 .endfor
77
78 sysinit.bin: ${SYSINIT_OBJS}
79         cat ${.ALLSRC} > sysinit.bin