xref: /illumos-gate/usr/src/lib/libfakekernel/Makefile.com (revision 66582b606a8194f7f3ba5b3a3a6dca5b0d346361)
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) $(LINTLIB)
53SRCS=   $(COBJS:%.o=$(SRCDIR)/%.c)
54
55$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
56
57CSTD =       $(CSTD_GNU99)
58C99LMODE =      -Xc99=%all
59
60CFLAGS +=	$(CCVERBOSE)
61
62# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc.
63# Also Note: intentionally override CPPFLAGS, not +=
64CPPFLAGS.first += -I../common
65CPPFLAGS= $(CPPFLAGS.first)
66
67INCS += -I$(SRC)/uts/common
68
69CPPFLAGS += $(INCS) -D_REENTRANT -D_FAKE_KERNEL
70CPPFLAGS += -D_FILE_OFFSET_BITS=64
71
72# Could make this $(NOT_RELEASE_BUILD) but as the main purpose of
73# this library is for debugging, let's always define DEBUG here.
74CPPFLAGS += -DDEBUG
75
76LINTCHECKFLAGS += -erroff=E_INCONS_ARG_DECL2
77LINTCHECKFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2
78LINTCHECKFLAGS += -erroff=E_INCONS_VAL_TYPE_USED2
79
80LDLIBS += -lumem -lcryptoutil -lsocket -lc
81
82.KEEP_STATE:
83
84all: $(LIBS)
85
86lint: lintcheck
87
88include ../../Makefile.targ
89