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 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23 # Use is subject to license terms.
  24 #
  25 # uts/sun4u/makaha/Makefile
  26 #
  27 #     This makefile drives the production of all Makaha system
  28 #     dependent modules for the sun4u architecture.
  29 #
  30 
  31 #
  32 #       Path to the base of the uts directory tree (usually /usr/src/uts).
  33 #
  34 UTSBASE         = ../..
  35 
  36 #
  37 #       Include common rules.
  38 #
  39 include $(UTSBASE)/sun4u/makaha/Makefile.makaha
  40 
  41 def             :=      TARGET= def
  42 all             :=      TARGET= all
  43 install         :=      TARGET= install
  44 install_h       :=      TARGET= install_h
  45 clean           :=      TARGET= clean
  46 clobber         :=      TARGET= clobber
  47 lint            :=      TARGET= lint
  48 lintlib         :=      TARGET= lintlib
  49 modlintlib      :=      TARGET= modlintlib
  50 modlist         :=      TARGET= modlist
  51 modlist         :=      NO_STATE= -K $$MODSTATE$$$$
  52 clean.lint      :=      TARGET= clean.lint
  53 check           :=      TARGET= check
  54 
  55 #
  56 #       Default build targets.
  57 #
  58 .KEEP_STATE:
  59 
  60 def all clean.lint clean clobber modlist: $(MAKAHA_KMODS)
  61 
  62 modlintlib:     $(MAKAHA_KMODS)
  63 
  64 install:        $(ROOT_MAKAHA_DIR) $(USR_MAKAHA_DIR) \
  65                                 $(USR_MAKAHA_INC_DIR) \
  66                                 $(USR_MAKAHA_SBIN_DIR) \
  67                                 $(USR_MAKAHA_LIB_DIR) \
  68                                 $(ROOT_SPUTNIK_DIR) \
  69                                 $(USR_SPUTNIK_DIR) \
  70                                 $(USR_SPUTNIK_INC_DIR) \
  71                                 $(USR_SPUTNIK_SBIN_DIR) \
  72                                 $(USR_SPUTNIK_LIB_DIR) \
  73                                 .WAIT $(MAKAHA_KMODS) \
  74                                 scsb acebus pcf8574 \
  75                                 acebus.conf se.conf scsb.conf \
  76                                 ttymux_dacf ttymux.conf
  77 
  78 acebus.conf:    $(ROOT_MAKAHA_DRV_DIR_32)
  79                 -@$(RM) $(ROOT_MAKAHA_DRV_DIR_32)/$@
  80                 $(CP) $(UTSBASE)/sun4u/makaha/io/$@ \
  81                 $(ROOT_MAKAHA_DRV_DIR_32)/$@
  82                 $(CHMOD) $(CFILEMODE) $(ROOT_MAKAHA_DRV_DIR_32)/$@
  83 
  84 pcf8574:        $(ROOT_MAKAHA_DRV_DIR_64)
  85                 -@$(RM) $(ROOT_MAKAHA_DRV_DIR_64)/$@
  86                 $(SYMLINK) $(ROOT_MAKAHA_DRV_LINK_64)/$@ \
  87                 $(ROOT_MAKAHA_DRV_DIR_64)/$@
  88 
  89 acebus:         $(ROOT_MAKAHA_DRV_DIR_64)
  90                 -@$(RM) $(ROOT_MAKAHA_DRV_DIR_64)/$@
  91                 $(SYMLINK) $(ROOT_MAKAHA_DRV_LINK_64)/$@ \
  92                 $(ROOT_MAKAHA_DRV_DIR_64)/$@
  93 
  94 scsb:           $(ROOT_MAKAHA_DRV_DIR_64)
  95                 -@$(RM) $(ROOT_MAKAHA_DRV_DIR_64)/$@
  96                 $(SYMLINK) $(ROOT_MAKAHA_DRV_LINK_64)/$@ \
  97                 $(ROOT_MAKAHA_DRV_DIR_64)/$@
  98 
  99 scsb.conf:      $(ROOT_MAKAHA_DRV_DIR_32)
 100                 -@$(RM) $(ROOT_MAKAHA_DRV_DIR_32)/$@
 101                 $(SYMLINK) $(ROOT_MAKAHA_DRV_LINK_32)/$@ \
 102                 $(ROOT_MAKAHA_DRV_DIR_32)/$@
 103 
 104 se.conf:        $(ROOT_MAKAHA_DRV_DIR_32)
 105                 -@$(RM) $(ROOT_MAKAHA_DRV_DIR_32)/$@
 106                 $(SYMLINK) $(ROOT_MAKAHA_DRV_LINK_32)/$@ \
 107                 $(ROOT_MAKAHA_DRV_DIR_32)/$@
 108 
 109 ttymux_dacf:    $(ROOT_MAKAHA_DACF_DIR_64) \
 110                 $(ROOT_SPUTNIK_DACF_DIR_64)
 111                 -@$(RM) $(ROOT_MAKAHA_DACF_DIR_64)/$@
 112                 -@$(RM) $(ROOT_SPUTNIK_DACF_DIR_64)/$@
 113                 $(SYMLINK) $(ROOT_MAKAHA_DACF_LINK_64)/$@ \
 114                 $(ROOT_MAKAHA_DACF_DIR_64)/$@
 115                 $(SYMLINK) $(ROOT_SPUTNIK_DACF_LINK_64)/$@ \
 116                 $(ROOT_SPUTNIK_DACF_DIR_64)/$@
 117 
 118 
 119 ttymux.conf:    $(ROOT_MAKAHA_DRV_DIR_32) $(ROOT_SPUTNIK_DRV_DIR_32)
 120                 -@$(RM) $(ROOT_MAKAHA_DRV_DIR_32)/$@
 121                 -@$(RM) $(ROOT_SPUTNIK_DRV_DIR_32)/$@
 122                 $(SYMLINK) $(ROOT_MAKAHA_DRV_LINK_32)/$@ \
 123                 $(ROOT_MAKAHA_DRV_DIR_32)/$@
 124                 $(SYMLINK) $(ROOT_MAKAHA_DRV_LINK_32)/$@ \
 125                 $(ROOT_SPUTNIK_DRV_DIR_32)/$@
 126 
 127 install_h check:
 128 
 129 lint:           modlintlib
 130 
 131 #
 132 # The 'lint.platmod' target lints the makaha platform module against
 133 # the sun4u kernel.  This ends up doing all the kernel cross-checks,
 134 # so it takes a couple of minutes.
 135 # Due to the low ROI, it's not run by default, but it's a good
 136 # idea to run this if you change os/makaha.c.
 137 #
 138 LINT_LIBS        = $(LINT_LIB) \
 139                    -L$(MAKAHA_LINT_LIB_DIR) \
 140                    -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \
 141                        $(CLOSED_LINT_KMODS:%=-l%) \
 142                    -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%)
 143 
 144 lint.platmod:   modlintlib
 145         @-$(ECHO) "\nMakaha Platform-dependent module: global crosschecks:"
 146         @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
 147 
 148 $(MAKAHA_KMODS): FRC
 149         @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
 150 
 151 #
 152 #       Include common targets.
 153 #
 154 include $(UTSBASE)/sun4u/makaha/Makefile.targ