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 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  22 # Use is subject to license terms.
  23 # Copyright 2019 Peter Tribble.
  24 #
  25 # Copyright 2018 Joyent, Inc.
  26 #
  27 UTSBASE = ../..
  28 
  29 #
  30 # include global definitions
  31 #
  32 include ../Makefile.sun4u
  33 
  34 #
  35 # Override defaults.
  36 #
  37 FILEMODE         = 644
  38 
  39 SUN4_HDRS=                      \
  40         async.h                 \
  41         clock.h                 \
  42         cmp.h                   \
  43         cpc_ultra.h             \
  44         cpu_sgnblk_defs.h       \
  45         ddi_subrdefs.h          \
  46         dvma.h                  \
  47         eeprom.h                \
  48         errclassify.h           \
  49         fcode.h                 \
  50         fc_plat.h               \
  51         ht.h                    \
  52         idprom.h                \
  53         intr.h                  \
  54         intreg.h                \
  55         ivintr.h                \
  56         memlist_plat.h          \
  57         memnode.h               \
  58         nexusdebug.h            \
  59         prom_debug.h            \
  60         scb.h                   \
  61         sun4asi.h               \
  62         tod.h                   \
  63         trapstat.h              \
  64         vis.h                   \
  65         vm_machparam.h          \
  66         x_call.h                \
  67         xc_impl.h               \
  68         zsmach.h
  69 
  70 HDRS=   \
  71         cheetahregs.h           \
  72         cpr_impl.h              \
  73         cpu_impl.h              \
  74         ecc_kstat.h             \
  75         envctrl.h               \
  76         envctrl_gen.h           \
  77         envctrl_ue250.h         \
  78         envctrl_ue450.h         \
  79         gpio_87317.h            \
  80         iocache.h               \
  81         iommu.h                 \
  82         machasi.h               \
  83         machclock.h             \
  84         machcpuvar.h            \
  85         machparam.h             \
  86         machsystm.h             \
  87         machthread.h            \
  88         mem_cache.h             \
  89         mmu.h                   \
  90         opl_module.h            \
  91         prom_plat.h             \
  92         pte.h                   \
  93         sbd_ioctl.h             \
  94         spitregs.h              \
  95         sysioerr.h              \
  96         sysiosbus.h             \
  97         todmostek.h             \
  98         traptrace.h
  99 
 100 I2CHDRS =       clients/max1617.h misc/i2c_svc.h clients/i2c_client.h   \
 101                 clients/hpc3130.h clients/lm75.h        \
 102                 clients/pcf8591.h clients/ssc050.h
 103 
 104 I2C_DIRS=       clients misc
 105 USR_PSM_ISYS_I2C_ROOT=  $(USR_PSM_ISYS_DIR)/i2c
 106 USR_PSM_ISYS_I2C_DIRS=  $(USR_PSM_ISYS_I2C_ROOT) \
 107                         $(I2C_DIRS:%=$(USR_PSM_ISYS_I2C_ROOT)/%)
 108 
 109 ROOTI2CHDRS=            $(I2CHDRS:%=$(USR_PSM_ISYS_I2C_ROOT)/%)
 110 
 111 MONHDRS=
 112 #MONHDRS=       eeprom.h    idprom.h    keyboard.h  password.h
 113 
 114 USR_PSM_MON_DIR=        $(USR_PSM_ISYS_DIR)/mon
 115 
 116 ROOTHDRS=               $(HDRS:%=$(USR_PSM_ISYS_DIR)/%)
 117 
 118 SUN4_ROOTHDRS=          $(SUN4_HDRS:%=$(USR_PSM_ISYS_DIR)/%)
 119 
 120 ROOTMONHDRS=            $(MONHDRS:%=$(USR_PSM_MON_DIR)/%)
 121 
 122 ROOTDIR=                $(ROOT)/usr/share/src
 123 ROOTDIRS=               $(ROOTDIR)/uts $(ROOTDIR)/uts/$(PLATFORM)
 124 
 125 ROOTLINK=               $(ROOTDIR)/uts/$(PLATFORM)/sys
 126 LINKDEST=               ../../../../platform/$(PLATFORM)/include/sys
 127 
 128 CHECKHDRS=              $(HDRS:%.h=%.check) \
 129                         $(MONHDRS:%.h=mon/%.check) \
 130                         $(SUN4_HDRS:%.h=%.cmncheck)
 131 
 132 .KEEP_STATE:
 133 
 134 .PARALLEL: $(CHECKHDRS) $(ROOTHDRS) $(ROOTMONHDRS) $(SUN4_ROOTHDRS)
 135 
 136 install_h: $(ROOTDIRS) $(USR_PSM_ISYS_I2C_DIRS) .WAIT \
 137                 $(ROOTHDRS) $(ROOTI2CHDRS) \
 138                 $(ROOTMONHDRS) \
 139                 $(SUN4_ROOTHDRS) $(ROOTLINK)
 140 
 141 check:  $(CHECKHDRS)
 142 
 143 #
 144 # install rules
 145 #
 146 $(USR_PSM_MON_DIR):     $(USR_PSM_ISYS_DIR)
 147         $(INS.dir)
 148 
 149 $(USR_PSM_ISYS_I2C_DIRS):
 150         $(INS.dir)
 151 
 152 $(USR_PSM_ISYS_DIR)/%:  ../../sfmmu/sys/% $(USR_PSM_ISYS_DIR)
 153         $(INS.file)
 154 
 155 $(USR_PSM_ISYS_DIR)/%:  ../../sun4/sys/% $(USR_PSM_ISYS_DIR)
 156         $(INS.file)
 157 
 158 $(USR_PSM_MON_DIR)/%:   mon/% $(USR_PSM_MON_DIR)
 159         $(INS.file)
 160 
 161 $(ROOTDIRS):
 162         $(INS.dir)
 163 
 164 # -r because this used to be a directory and is now a link.
 165 $(ROOTLINK):    $(ROOTDIRS)
 166         -$(RM) -r $@; $(SYMLINK) $(LINKDEST) $@
 167 
 168 mon/%.check:    mon/%.h
 169         $(DOT_H_CHECK)
 170 
 171 %.check:        ../../sfmmu/sys/%.h
 172         $(DOT_H_CHECK)
 173 %.cmncheck:     ../../sun4/sys/%.h
 174         $(DOT_H_CHECK)
 175 
 176 FRC:
 177 
 178 include ../../Makefile.targ