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 (c) 2018, Joyent, Inc.
  14 #
  15 
  16 #
  17 #       Path to the base of the uts directory tree (usually /usr/src/uts).
  18 #
  19 UTSBASE = ../..
  20 
  21 #
  22 #       Define the module and object file sets.
  23 #
  24 MODULE          = usbgem
  25 OBJECTS         = $(USBGEM_OBJS:%=$(OBJS_DIR)/%)
  26 LINTS           = $(USBGEM_OBJS:%.o=$(LINTS_DIR)/%.ln)
  27 ROOTMODULE      = $(ROOT_MISC_DIR)/$(MODULE)
  28 
  29 #
  30 #       Include common rules.
  31 #
  32 include $(UTSBASE)/intel/Makefile.intel
  33 
  34 #
  35 #       The USBGEM has support for various different features. We use
  36 #       these pre-processor macros to define the set we care about.
  37 #
  38 CPPFLAGS        += \
  39                 -DUSBGEM_CONFIG_GLDv3 \
  40                 -DMODULE \
  41                 -DGEN_CONFIG_FMA \
  42                 -DUSBGEM_CONFIG_MAC_PROP \
  43                 -DVERSION=\"1.6\"
  44 
  45 CERRWARN        += $(CNOWARN_UNINIT)
  46 CERRWARN        += -_gcc=-Wno-parentheses
  47 CERRWARN        += -_gcc=-Wno-switch
  48 CERRWARN        += -_gcc=-Wno-unused-variable
  49 CERRWARN        += -_gcc=-Wno-unused-label
  50 CERRWARN        += -_gcc=-Wno-unused-function
  51 
  52 # needs work
  53 SMOFF += all_func_returns
  54 
  55 LINTTAGS        += -erroff=E_FUNC_VAR_UNUSED
  56 LINTTAGS        += -erroff=E_FUNC_ARG_UNUSED
  57 LINTTAGS        += -erroff=E_STATIC_UNUSED
  58 LINTTAGS        += -erroff=E_FUNC_SET_NOT_USED
  59 LINTTAGS        += -erroff=E_FUNC_RET_MAYBE_IGNORED2
  60 LINTTAGS        += -erroff=E_FUNC_RET_ALWAYS_IGNOR2
  61 LINTTAGS        += -erroff=E_BAD_FORMAT_ARG_TYPE2
  62 LINTTAGS        += -erroff=E_ASSIGN_NARROW_CONV
  63 
  64 LDFLAGS         += -dy -N misc/mac -N drv/ip -N misc/usba
  65 
  66 #
  67 #       Define targets
  68 #
  69 ALL_TARGET      = $(BINARY)
  70 LINT_TARGET     = $(MODULE).lint
  71 INSTALL_TARGET  = $(BINARY) $(ROOTMODULE)
  72 
  73 #
  74 #       Default build targets.
  75 #
  76 .KEEP_STATE:
  77 
  78 def:            $(DEF_DEPS)
  79 
  80 all:            $(ALL_DEPS)
  81 
  82 clean:          $(CLEAN_DEPS)
  83 
  84 clobber:        $(CLOBBER_DEPS)
  85 
  86 lint:           $(LINT_DEPS)
  87 
  88 modlintlib:     $(MODLINTLIB_DEPS)
  89 
  90 clean.lint:     $(CLEAN_LINT_DEPS)
  91 
  92 install:        $(INSTALL_DEPS)
  93 
  94 #       Include common targets.
  95 #
  96 include $(UTSBASE)/intel/Makefile.targ