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