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