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