forked from TritonDataCenter/illumos-kvm
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
150 lines (134 loc) · 6.46 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#
# Copyright (c) 2010 Joyent Inc., All Rights Reserved.
#
# Use the gcc compiler and Sun linker.
KERNEL_SOURCE=/ws/illumos-gate
PROTO_AREA=/ws/illumos-kvm-proto
GCC=/usr/sfw/bin/gcc
CC=$(GCC) -m64 -mcmodel=kernel -msave-args
LD=/usr/bin/ld
CTFBINDIR=$(KERNEL_SOURCE)/usr/src/tools/proto/*/opt/onbld/bin/i386
CTFCONVERT=$(CTFBINDIR)/ctfconvert
CTFMERGE=$(CTFBINDIR)/ctfmerge
DESTDIR=
CFLAGS += -D_KERNEL -D_MACHDEP -Dx86 -DDEBUG -c -g -DCONFIG_SOLARIS -O2 -fident -fno-inline -fno-inline-functions -fno-builtin -fno-asm -nodefaultlibs -D__sun -O -D_ASM_INLINES -ffreestanding -Wall -Wno-unknown-pragmas -Wpointer-arith -Wno-unused -gdwarf-2 -std=gnu99 -fno-dwarf2-indirect-strings -Werror -DDIS_MEM -D_KERNEL -ffreestanding -D_SYSCALL32 -D_DDI_STRICT -Di86pc -D_MACHDEP -DOPTERON_ERRATUM_88 -DOPTERON_ERRATUM_91 -DOPTERON_ERRATUM_93 -DOPTERON_ERRATUM_95 -DOPTERON_ERRATUM_99 -DOPTERON_ERRATUM_100 -DOPTERON_ERRATUM_101 -DOPTERON_ERRATUM_108 -DOPTERON_ERRATUM_109 -DOPTERON_ERRATUM_121 -DOPTERON_ERRATUM_122 -DOPTERON_ERRATUM_123 -DOPTERON_ERRATUM_131 -DOPTERON_WORKAROUND_6336786 -DOPTERON_WORKAROUND_6323525 -DOPTERON_ERRATUM_172 -DOPTERON_ERRATUM_298 -I$(KERNEL_SOURCE)/usr/src/uts/common -nostdinc -c -DUTS_RELEASE="5.11" -DUTS_VERSION="joyent.147" -DUTS_PLATFORM="i86pc" -mno-red-zone
INCLUDEDIR= -I $(KERNEL_SOURCE)/usr/src/uts/intel -I $(KERNEL_SOURCE)/usr/src/uts/i86pc -I $(KERNEL_SOURCE)/usr/src/uts/common
CSTYLE=$(KERNEL_SOURCE)/usr/src/tools/scripts/cstyle
HDRCHK=tools/hdrchk
HDRCHK_USRFLAG="$(GCC)"
HDRCHK_SYSFLAG="$(GCC) -D_KERNEL"
HEADERS= \
kvm.h \
kvm_bitops.h \
kvm_cache_regs.h \
kvm_coalesced_mmio.h \
kvm_cpuid.h \
kvm_emulate.h \
kvm_host.h \
kvm_i8254.h \
kvm_impl.h \
kvm_ioapic.h \
kvm_iodev.h \
kvm_irq.h \
kvm_lapic.h \
kvm_mmu.h \
kvm_msidef.h \
kvm_msr.h \
kvm_paging_tmpl.h \
kvm_timer.h \
kvm_types.h \
kvm_vmx.h \
kvm_svm.h \
kvm_glue_alloc.h \
kvm_x86host.h \
kvm_x86impl.h \
kvm_x86.h
HDRCHK_USRHDRS= \
kvm.h \
kvm_types.h \
kvm_x86.h
HDRCHK_SYSHDRS= \
kvm_bitops.h \
kvm_cache_regs.h \
kvm_cpuid.h \
kvm_host.h \
kvm_impl.h \
kvm_ioapic.h \
kvm_iodev.h \
kvm_irq.h \
kvm_msidef.h \
kvm_mmu.h \
kvm_timer.h \
kvm_types.h \
kvm_vmx.h \
kvm_svm.h \
kvm_glue_alloc.h \
kvm_x86host.h \
kvm_x86impl.h
world: kvm kvm.so JOY_kvm_link.so
kvm: kvm.c kvm_x86.c kvm_emulate.c kvm_irq.c kvm_i8254.c kvm_lapic.c kvm_mmu.c kvm_iodev.c kvm_ioapic.c kvm_vmx.c kvm_svm.c kvm_glue_alloc.c kvm_i8259.c kvm_coalesced_mmio.c kvm_irq_comm.c kvm_cache_regs.c kvm_bitops.c $(HEADERS)
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_x86.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_emulate.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_irq.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_i8254.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_lapic.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_mmu.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_iodev.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_ioapic.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_vmx.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_svm.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_glue_alloc.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_i8259.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_coalesced_mmio.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_irq_comm.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_cache_regs.c
$(CC) $(CFLAGS) $(INCLUDEDIR) kvm_bitops.c
$(CTFCONVERT) -i -L VERSION kvm.o
$(CTFCONVERT) -i -L VERSION kvm_x86.o
$(CTFCONVERT) -i -L VERSION kvm_emulate.o
$(CTFCONVERT) -i -L VERSION kvm_irq.o
$(CTFCONVERT) -i -L VERSION kvm_i8254.o
$(CTFCONVERT) -i -L VERSION kvm_lapic.o
$(CTFCONVERT) -i -L VERSION kvm_mmu.o
$(CTFCONVERT) -i -L VERSION kvm_iodev.o
$(CTFCONVERT) -i -L VERSION kvm_ioapic.o
$(CTFCONVERT) -i -L VERSION kvm_vmx.o
$(CTFCONVERT) -i -L VERSION kvm_svm.o
$(CTFCONVERT) -i -L VERSION kvm_glue_alloc.o
$(CTFCONVERT) -i -L VERSION kvm_i8259.o
$(CTFCONVERT) -i -L VERSION kvm_coalesced_mmio.o
$(CTFCONVERT) -i -L VERSION kvm_irq_comm.o
$(CTFCONVERT) -i -L VERSION kvm_cache_regs.o
$(CTFCONVERT) -i -L VERSION kvm_bitops.o
$(LD) -r -o kvm kvm.o kvm_x86.o kvm_emulate.o kvm_irq.o kvm_i8254.o kvm_lapic.o kvm_mmu.o kvm_iodev.o kvm_ioapic.o kvm_vmx.o kvm_svm.o kvm_glue_alloc.o kvm_i8259.o kvm_coalesced_mmio.o kvm_irq_comm.o kvm_cache_regs.o kvm_bitops.o
$(CTFMERGE) -L VERSION -o kvm kvm.o kvm_x86.o kvm_emulate.o kvm_irq.o kvm_i8254.o kvm_lapic.o kvm_mmu.o kvm_iodev.o kvm_ioapic.o kvm_vmx.o kvm_svm.o kvm_glue_alloc.o kvm_i8259.o kvm_coalesced_mmio.o kvm_irq_comm.o kvm_cache_regs.o kvm_bitops.o
kvm.so: kvm_mdb.c
$(GCC) -m64 -shared \
-fPIC $(CFLAGS) $(INCLUDEDIR) -I/usr/include -o $@ kvm_mdb.c
JOY_kvm_link.so: kvm_link.c
/opt/SUNWspro/bin/cc -O -xspace -Xa -xildoff -errtags=yes -errwarn=%all -erroff=E_EMPTY_TRANSLATION_UNIT -erroff=E_STATEMENT_NOT_REACHED -xc99=%none -W0,-xglobalstatic -v -K pic -DTEXT_DOMAIN=\"SUNW_OST_OSCMD\" -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I$(KERNEL_SOURCE)/usr/src/cmd/devfsadm/ -I$(KERNEL_SOURCE)/usr/src/cmd/devfsadm/../../uts/common -I$(KERNEL_SOURCE)/usr/src/cmd/devfsadm/../modload -c -o kvm_link.o kvm_link.c
/opt/SUNWspro/bin/cc -o JOY_kvm_link.so -G -ztext -zdefs -Bdirect -M$(KERNEL_SOURCE)/usr/src/cmd/devfsadm/mapfile-vers -M$(KERNEL_SOURCE)/usr/src/common/mapfiles/common/map.pagealign -M$(KERNEL_SOURCE)/usr/src/common/mapfiles/common/map.noexdata -h JOY_kvm_link.so kvm_link.o -L$(PROTO_AREA)/lib -L$(PROTO_AREA)/usr/lib -ldevinfo -lc
install: world
@echo "==> Installing kvm module (to $(DESTDIR)/)"
@mkdir -p $(DESTDIR)/usr/kernel/drv/amd64
@cp kvm $(DESTDIR)/usr/kernel/drv/amd64/kvm
@cp kvm.conf $(DESTDIR)/usr/kernel/drv
@mkdir -p $(DESTDIR)/usr/lib/mdb/kvm/amd64
@cp kvm.so $(DESTDIR)/usr/lib/mdb/kvm/amd64
@cp JOY_kvm_link.so $(DESTDIR)/usr/lib/devfsadm/linkmod
check:
@$(CSTYLE) kvm.c kvm_mdb.c kvm_emulate.c kvm_x86.c kvm_irq.c kvm_lapic.c kvm_i8254.c kvm_mmu.c kvm_iodev.c kvm_ioapic.c kvm_vmx.c kvm_svm.c kvm_glue_alloc.c kvm_i8259.c kvm_coalesced_mmio.c kvm_irq_comm.c kvm_cache_regs.c kvm_bitops.c $(HEADERS) kvm_link.c
@./tools/xxxcheck kvm_x86.c kvm.c kvm_irq.c kvm_lapic.c kvm_i8254.c kvm_mmu.c kvm_iodev.c kvm_ioapic.c kvm_vmx.c kvm_svm.c kvm_glue_alloc.c kvm_i8259.c kvm_coalesced_mmio.c kvm_irq_comm.c kvm_cache_regs.c kvm_bitops.c
@$(HDRCHK) $(HDRCHK_USRFLAG) $(HDRCHK_USRHDRS)
@$(HDRCHK) $(HDRCHK_SYSFLAG) $(HDRCHK_SYSHDRS)
update:
git pull --rebase
clean:
@pfexec rm -f *.o kvm kvm.so JOY_kvm_link.so
manifest:
cp manifest $(DESTDIR)/$(DESTNAME)
uninstall:
@pfexec rem_drv kvm || /bin/true
@pfexec rm -f /usr/kernel/drv/kvm* /usr/kernel/drv/amd64/kvm*
.PHONY: manifest