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 
  17 LIBRARY =       libfakekernel.a
  18 VERS =          .1
  19 
  20 COBJS = \
  21         cred.o \
  22         clock.o \
  23         cond.o \
  24         copy.o \
  25         buf.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         taskq.o \
  38         thread.o \
  39         uio.o
  40 
  41 OBJECTS=        $(COBJS)
  42 
  43 include ../../Makefile.lib
  44 
  45 # libfakekernel must be installed in the root filesystem for libzfs
  46 include ../../Makefile.rootfs
  47 
  48 SRCDIR=         ../common
  49 
  50 LIBS =          $(DYNLIB) $(LINTLIB)
  51 SRCS=   $(COBJS:%.o=$(SRCDIR)/%.c)
  52 
  53 $(LINTLIB) :=   SRCS = $(SRCDIR)/$(LINTSRC)
  54 
  55 C99MODE =       -xc99=%all
  56 C99LMODE =      -Xc99=%all
  57 
  58 # Note: need our sys includes _before_ ENVCPPFLAGS, proto etc.
  59 CPPFLAGS.first += -I../common
  60 
  61 CFLAGS +=       $(CCVERBOSE)
  62 CPPFLAGS += $(INCS) -D_REENTRANT -D_FAKE_KERNEL
  63 CPPFLAGS += -D_FILE_OFFSET_BITS=64
  64 
  65 # Could make this $(NOT_RELEASE_BUILD) but as the main purpose of
  66 # this library is for debugging, let's always define DEBUG here.
  67 CPPFLAGS += -DDEBUG
  68 
  69 LINTCHECKFLAGS += -erroff=E_INCONS_ARG_DECL2
  70 LINTCHECKFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2
  71 LINTCHECKFLAGS += -erroff=E_INCONS_VAL_TYPE_USED2
  72 
  73 LDLIBS += -lumem -lcryptoutil -lsocket -lc
  74 
  75 .KEEP_STATE:
  76 
  77 all: $(LIBS)
  78 
  79 lint: lintcheck
  80 
  81 include ../../Makefile.targ