1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 #
  22 # uts/intel/hwa1480_fw/Makefile
  23 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 #
  27 #       This makefile drives the production of the hwa1480_fw kernel module.
  28 #
  29 #
  30 #       Path to the base of the uts directory tree (usually /usr/src/uts).
  31 #
  32 UTSBASE = ../..
  33 
  34 #
  35 #       Define the module and object file sets.
  36 #
  37 MODULE          = hwa1480_fw
  38 OBJECTS         = $(WUSB_FWMOD_OBJS:%=$(OBJS_DIR)/%)
  39 LINTS           = $(WUSB_FWMOD_OBJS:%.o=$(LINTS_DIR)/%.ln)
  40 ROOTMODULE      = $(ROOT_MISC_DIR)/$(MODULE)
  41 WARLOCK_OUT     = $(WUSB_FWMOD_OBJS:%.o=%.ll)
  42 WARLOCK_OK      = $(MODULE).ok
  43 
  44 FWOBJ           = $(OBJS_DIR)/$(MODULE).o
  45 
  46 OBJECTS         += $(FWOBJ)
  47 
  48 #
  49 #       Include common rules.
  50 #
  51 include $(UTSBASE)/intel/Makefile.intel
  52 
  53 LDFLAGS = 
  54 #
  55 #       Define targets
  56 #
  57 ALL_TARGET      = $(BINARY)
  58 LINT_TARGET     = $(MODULE).lint
  59 INSTALL_TARGET  = $(BINARY) $(ROOTMODULE)
  60 
  61 #
  62 # For now, disable these lint checks; maintainers should endeavor
  63 # to investigate and remove these for maximum lint coverage.
  64 # Please do not carry these forward to new Makefiles.
  65 #
  66 LINTTAGS        += -erroff=E_BAD_PTR_CAST_ALIGN
  67 LINTTAGS        += -erroff=E_PTRDIFF_OVERFLOW
  68 LINTTAGS        += -erroff=E_ASSIGN_NARROW_CONV
  69 LINTTAGS        += -erroff=E_STATIC_UNUSED
  70 
  71 CLEANFILES      += $(WARLOCK_OUT) $(WARLOCK_OK)
  72 CLOBBERFILES    += $(BINSRC)/$(MODULE)
  73 
  74 #
  75 #       Default build targets.
  76 #
  77 .KEEP_STATE:
  78 
  79 def:            $(DEF_DEPS) $(FWOBJ)
  80 
  81 all:            $(ALL_DEPS)
  82 
  83 clean:          $(CLEAN_DEPS)
  84 
  85 clobber:        $(CLOBBER_DEPS)
  86 
  87 lint:           $(LINT_DEPS)
  88 
  89 modlintlib:     $(MODLINTLIB_DEPS)
  90 
  91 clean.lint:     $(CLEAN_LINT_DEPS)
  92 
  93 install:        $(INSTALL_DEPS)
  94 
  95 
  96 # customized section for transforming firmware binary
  97 ELFWRAP         = elfwrap
  98 BINSRC          = $(UTSBASE)/common/io/usb/clients/hwa1480_fw/i1480
  99 ORIGIN_SRC      = i1480-usb-0.0.bin
 100 
 101 #get build type, 32/64
 102 WRAPTYPE        = $(CLASS:%=-%)
 103 
 104 #set elfwrap option
 105 WRAPOPT         = $(WRAPTYPE:-32=)
 106 
 107 $(FWOBJ):
 108         cp $(BINSRC)/$(ORIGIN_SRC) $(BINSRC)/$(MODULE)
 109         $(ELFWRAP) $(WRAPOPT) -o $@ $(BINSRC)/$(MODULE)
 110 
 111 #
 112 #       Include common targets.
 113 #
 114 include $(UTSBASE)/intel/Makefile.targ
 115 
 116 #
 117 #       Defines for local commands.
 118 #
 119 WLCC            = wlcc
 120 TOUCH           = touch
 121 WARLOCK         = warlock
 122 
 123 #
 124 #       Warlock targets
 125 #
 126 warlock: $(WARLOCK_OK)
 127 
 128 $(WARLOCK_OK):  $(WARLOCK_OUT)
 129         $(TOUCH) $@
 130 
 131 %.ll: $(UTSBASE)/common/io/usb/clients/hwa1480_fw/%.c
 132         $(WLCC) $(CPPFLAGS) -DDEBUG -o $@ $<