Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a28b557f30
Fetching contributors…

Cannot retrieve contributors at this time

126 lines (104 sloc) 3.047 kb
#
# Copyright (c) 2012 Joyent, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
PROTO_AREA = $(PWD)/../../../proto
KERNEL_SOURCE = $(PWD)/../../illumos
MDB_SOURCE = $(KERNEL_SOURCE)/usr/src/cmd/mdb
CTFBINDIR= $(KERNEL_SOURCE)/usr/src/tools/proto/*/opt/onbld/bin/i386
CSTYLE = $(KERNEL_SOURCE)/usr/src/tools/scripts/cstyle
CC = $(PROTO_AREA)/usr/bin/gcc
QEMU_CPPFLAGS = \
-DTARGET_PHYS_ADDR_BITS=64 \
-D__EXTENSIONS__
DMOD_CPPFLAGS = \
$(QEMU_CPPFLAGS) \
-D_KERNEL \
-DTEXT_DOMAIN="SUNW_OST_OSCMD" \
-D_TS_ERRNO \
-D_ELF64 \
-Ui386 \
-U__i386 \
-isystem $(PROTO_AREA)/usr/include \
-I. \
-Ihw
ALWAYS_CFLAGS = \
-fident \
-fno-builtin \
-nodefaultlibs \
-Wall \
-Werror \
-fno-inline-functions
USER_CFLAGS = \
-finline \
-gdwarf-2 \
-std=gnu89
DMOD_CFLAGS = \
$(ALWAYS_CFLAGS) \
$(USER_CFLAGS) \
-m64 \
-fno-strict-aliasing \
-fno-unit-at-a-time \
-fno-optimize-sibling-calls \
-O2 \
-fno-inline-small-functions \
-fno-inline-functions-called-once \
-mtune=opteron \
-ffreestanding \
-fPIC
DMOD_LDFLAGS = \
-m64 \
-shared \
-nodefaultlibs \
-Wl,-M$(KERNEL_SOURCE)/usr/src/common/mapfiles/common/map.pagealign \
-Wl,-M$(KERNEL_SOURCE)/usr/src/common/mapfiles/common/map.noexdata \
-Wl,-ztext \
-Wl,-zdefs \
-Wl,-M$(MDB_SOURCE)/common/modules/conf/mapfile-extern \
-L$(PROTO_AREA)/lib \
-L$(PROTO_AREA)/usr/lib
DMOD_LIBS = \
-lc
DMOD_SRCS = \
qemu_mdb.c
world: qemu qemu.so
config-host.mak:
PATH=$(CTFBINDIR):$(PATH) CONFIGURE_ONLY=1 ./build.sh
qemu: config-host.mak
echo "Building world"
PATH=$(CTFBINDIR):$(PATH) V=1 gmake all
qemu.so: $(DMOD_SRCS)
$(CC) $(DMOD_CPPFLAGS) $(DMOD_CFLAGS) $(DMOD_LDFLAGS) -o $@ \
$(DMOD_SRCS) $(DMOD_LIBS)
update:
git pull --rebase
manifest:
cp manifest $(DESTDIR)/$(DESTNAME)
install: world
DESTDIR=$(DESTDIR) PATH=$(CTFBINDIR):$(PATH) V=1 gmake install
clean:
gmake clean
rm -f qemu.so
xref:
find . -type f -name '*.[ch]' > cscope.files
cscope-fast -bq
check:
$(CSTYLE) qemu_mdb.c
.PHONY: manifest xref check clean
Jump to Line
Something went wrong with that request. Please try again.