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 clock.o \ 22 cond.o \ 23 copy.o \ 24 cred.o \ 25 cyclic.o \ 26 kiconv.o \ 27 kmem.o \ 28 kmisc.o \ 29 ksid.o \ 30 ksocket.o \ 31 kstat.o \ 32 mutex.o \ 33 printf.o \ 34 random.o \ 35 rwlock.o \ 36 sema.o \ 37 strext.o \ 38 taskq.o \ 39 thread.o \ 40 uio.o 41 42OBJECTS= $(COBJS) 43 44include ../../Makefile.lib 45 46# libfakekernel must be installed in the root filesystem for libzpool 47include ../../Makefile.rootfs 48 49SRCDIR= ../common 50 51LIBS = $(DYNLIB) $(LINTLIB) 52SRCS= $(COBJS:%.o=$(SRCDIR)/%.c) 53 54$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) 55 56CSTD = $(CSTD_GNU99) 57C99LMODE = -Xc99=%all 58 59CFLAGS += $(CCVERBOSE) 60 61# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc. 62# Also Note: intentionally override CPPFLAGS, not += 63CPPFLAGS.first += -I../common 64CPPFLAGS= $(CPPFLAGS.first) 65 66INCS += -I$(SRC)/uts/common 67 68CPPFLAGS += $(INCS) -D_REENTRANT -D_FAKE_KERNEL 69CPPFLAGS += -D_FILE_OFFSET_BITS=64 70 71# Could make this $(NOT_RELEASE_BUILD) but as the main purpose of 72# this library is for debugging, let's always define DEBUG here. 73CPPFLAGS += -DDEBUG 74 75LINTCHECKFLAGS += -erroff=E_INCONS_ARG_DECL2 76LINTCHECKFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2 77LINTCHECKFLAGS += -erroff=E_INCONS_VAL_TYPE_USED2 78 79LDLIBS += -lumem -lcryptoutil -lsocket -lc 80 81.KEEP_STATE: 82 83all: $(LIBS) 84 85lint: lintcheck 86 87include ../../Makefile.targ 88