1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
14# Copyright 2017 RackTop Systems.
15#
16
17LIBRARY =	libfakekernel.a
18VERS =		.1
19
20COBJS = \
21	callout.o \
22	clock.o \
23	cond.o \
24	copy.o \
25	cred.o \
26	cyclic.o \
27	kiconv.o \
28	kmem.o \
29	kmisc.o \
30	ksid.o \
31	ksocket.o \
32	kstat.o \
33	mutex.o \
34	printf.o \
35	random.o \
36	rwlock.o \
37	sema.o \
38	strext.o \
39	taskq.o \
40	thread.o \
41	uio.o
42
43OBJECTS=	$(COBJS)
44
45include ../../Makefile.lib
46
47# libfakekernel must be installed in the root filesystem for libzpool
48include ../../Makefile.rootfs
49
50SRCDIR=		../common
51
52LIBS =		$(DYNLIB)
53SRCS=   $(COBJS:%.o=$(SRCDIR)/%.c)
54
55CSTD =       $(CSTD_GNU99)
56
57CFLAGS +=	$(CCVERBOSE)
58
59# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc.
60# Also Note: intentionally override CPPFLAGS, not +=
61CPPFLAGS.first += -I../common
62CPPFLAGS= $(CPPFLAGS.first)
63
64INCS += -I$(SRC)/uts/common -I$(ROOT)/usr/include
65
66CPPFLAGS += $(INCS) -D_REENTRANT -D_FAKE_KERNEL
67CPPFLAGS += -D_FILE_OFFSET_BITS=64
68
69# Could make this $(NOT_RELEASE_BUILD) but as the main purpose of
70# this library is for debugging, let's always define DEBUG here.
71CPPFLAGS += -DDEBUG
72
73# libfakekernel isn't delivered, and is a special case, disable global data
74# complaints
75ZGUIDANCE= -Wl,-zguidance=noasserts
76
77LDLIBS += -lumem -lcryptoutil -lsocket -lc
78
79.KEEP_STATE:
80
81all: $(LIBS)
82
83
84include ../../Makefile.targ
85