1*2fcbc377Syt160523# 2*2fcbc377Syt160523# CDDL HEADER START 3*2fcbc377Syt160523# 4*2fcbc377Syt160523# The contents of this file are subject to the terms of the 5*2fcbc377Syt160523# Common Development and Distribution License (the "License"). 6*2fcbc377Syt160523# You may not use this file except in compliance with the License. 7*2fcbc377Syt160523# 8*2fcbc377Syt160523# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*2fcbc377Syt160523# or http://www.opensolaris.org/os/licensing. 10*2fcbc377Syt160523# See the License for the specific language governing permissions 11*2fcbc377Syt160523# and limitations under the License. 12*2fcbc377Syt160523# 13*2fcbc377Syt160523# When distributing Covered Code, include this CDDL HEADER in each 14*2fcbc377Syt160523# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*2fcbc377Syt160523# If applicable, add the following below this CDDL HEADER, with the 16*2fcbc377Syt160523# fields enclosed by brackets "[]" replaced with your own identifying 17*2fcbc377Syt160523# information: Portions Copyright [yyyy] [name of copyright owner] 18*2fcbc377Syt160523# 19*2fcbc377Syt160523# CDDL HEADER END 20*2fcbc377Syt160523# 21*2fcbc377Syt160523 22*2fcbc377Syt160523# 23*2fcbc377Syt160523# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24*2fcbc377Syt160523# Use is subject to license terms. 25*2fcbc377Syt160523# 26*2fcbc377Syt160523# ident "%Z%%M% %I% %E% SMI" 27*2fcbc377Syt160523# 28*2fcbc377Syt160523 29*2fcbc377Syt160523# 30*2fcbc377Syt160523# This makefile drives the production of the 31*2fcbc377Syt160523# "/kernel/drv/ahci" kernel module. 32*2fcbc377Syt160523# 33*2fcbc377Syt160523# intel architecture dependent 34*2fcbc377Syt160523# 35*2fcbc377Syt160523 36*2fcbc377Syt160523# 37*2fcbc377Syt160523# Path to the base of the uts directory tree (usually /usr/src/uts). 38*2fcbc377Syt160523# 39*2fcbc377Syt160523UTSBASE = ../.. 40*2fcbc377Syt160523 41*2fcbc377Syt160523# 42*2fcbc377Syt160523# Define the module and object file sets. 43*2fcbc377Syt160523# 44*2fcbc377Syt160523MODULE = ahci 45*2fcbc377Syt160523OBJECTS = $(AHCI_OBJS:%=$(OBJS_DIR)/%) 46*2fcbc377Syt160523LINTS = $(AHCI_OBJS:%.o=$(LINTS_DIR)/%.ln) 47*2fcbc377Syt160523ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) 48*2fcbc377Syt160523CONF_SRCDIR = $(UTSBASE)/common/io/sata/adapters/ahci 49*2fcbc377Syt160523WARLOCK_OUT = $(AHCI_OBJS:%.o=%.ll) 50*2fcbc377Syt160523WARLOCK_OK = $(MODULE).ok 51*2fcbc377Syt160523WLCMD_DIR = $(UTSBASE)/common/io/warlock 52*2fcbc377Syt160523 53*2fcbc377Syt160523# 54*2fcbc377Syt160523# Include common rules. 55*2fcbc377Syt160523# 56*2fcbc377Syt160523include $(UTSBASE)/intel/Makefile.intel 57*2fcbc377Syt160523 58*2fcbc377Syt160523# 59*2fcbc377Syt160523# Define targets 60*2fcbc377Syt160523# 61*2fcbc377Syt160523ALL_TARGET = $(BINARY) 62*2fcbc377Syt160523LINT_TARGET = $(MODULE).lint 63*2fcbc377Syt160523INSTALL_TARGET = $(BINARY) $(ROOTMODULE) 64*2fcbc377Syt160523 65*2fcbc377Syt160523# 66*2fcbc377Syt160523# Overrides. 67*2fcbc377Syt160523# 68*2fcbc377Syt160523DEBUG_FLGS = 69*2fcbc377Syt160523DEBUG_DEFS += $(DEBUG_FLGS) 70*2fcbc377Syt160523 71*2fcbc377Syt160523# 72*2fcbc377Syt160523# lint pass one enforcement 73*2fcbc377Syt160523# 74*2fcbc377Syt160523CFLAGS += $(CCVERBOSE) 75*2fcbc377Syt160523 76*2fcbc377Syt160523# 77*2fcbc377Syt160523# 78*2fcbc377Syt160523# we depend on the sata module 79*2fcbc377Syt160523LDFLAGS += -dy -N misc/sata 80*2fcbc377Syt160523 81*2fcbc377Syt160523# 82*2fcbc377Syt160523# For now, disable these lint checks; maintainers should endeavor 83*2fcbc377Syt160523# to investigate and remove these for maximum lint coverage. 84*2fcbc377Syt160523# Please do not carry these forward to new Makefiles. 85*2fcbc377Syt160523# 86*2fcbc377Syt160523LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN 87*2fcbc377Syt160523LINTTAGS += -erroff=E_STATIC_UNUSED 88*2fcbc377Syt160523LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV 89*2fcbc377Syt160523 90*2fcbc377Syt160523# 91*2fcbc377Syt160523# Default build targets. 92*2fcbc377Syt160523# 93*2fcbc377Syt160523.KEEP_STATE: 94*2fcbc377Syt160523 95*2fcbc377Syt160523def: $(DEF_DEPS) 96*2fcbc377Syt160523 97*2fcbc377Syt160523all: $(ALL_DEPS) 98*2fcbc377Syt160523 99*2fcbc377Syt160523clean: $(CLEAN_DEPS) 100*2fcbc377Syt160523 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK) 101*2fcbc377Syt160523 102*2fcbc377Syt160523clobber: $(CLOBBER_DEPS) 103*2fcbc377Syt160523 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK) 104*2fcbc377Syt160523 105*2fcbc377Syt160523lint: $(LINT_DEPS) 106*2fcbc377Syt160523 107*2fcbc377Syt160523modlintlib: $(MODLINTLIB_DEPS) 108*2fcbc377Syt160523 109*2fcbc377Syt160523clean.lint: $(CLEAN_LINT_DEPS) 110*2fcbc377Syt160523 111*2fcbc377Syt160523install: $(INSTALL_DEPS) 112*2fcbc377Syt160523 113*2fcbc377Syt160523# 114*2fcbc377Syt160523# Include common targets. 115*2fcbc377Syt160523# 116*2fcbc377Syt160523include $(UTSBASE)/intel/Makefile.targ 117*2fcbc377Syt160523 118*2fcbc377Syt160523 119*2fcbc377Syt160523# 120*2fcbc377Syt160523# Defines for local commands. 121*2fcbc377Syt160523# 122*2fcbc377Syt160523WARLOCK = warlock 123*2fcbc377Syt160523WLCC = wlcc 124*2fcbc377Syt160523TOUCH = touch 125*2fcbc377Syt160523SCCS = sccs 126*2fcbc377Syt160523TEST = test 127*2fcbc377Syt160523 128*2fcbc377Syt160523AHCI_FILES = $(MODULE).ll 129*2fcbc377Syt160523SD_FILES = $(SD_OBJS:%.o=../sd/%.ll) 130*2fcbc377Syt160523SATA_FILES = $(SATA_OBJS:%.o=-l ../sata/%.ll) 131*2fcbc377Syt160523SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll) 132*2fcbc377Syt160523 133*2fcbc377Syt160523warlock: $(WARLOCK_OK) 134*2fcbc377Syt160523 135*2fcbc377Syt160523%.wlcmd: 136*2fcbc377Syt160523 cd $(WLCMD_DIR); $(TEST) -f $@ || $(SCCS) get $@ 137*2fcbc377Syt160523 138*2fcbc377Syt160523 139*2fcbc377Syt160523$(WARLOCK_OK): ahci.wlcmd $(WARLOCK_OUT) warlock_ddi.files \ 140*2fcbc377Syt160523 sata.files scsi.files sd.files 141*2fcbc377Syt160523 $(WARLOCK) -c $(WLCMD_DIR)/ahci.wlcmd $(WARLOCK_OUT) \ 142*2fcbc377Syt160523 $(SD_FILES) \ 143*2fcbc377Syt160523 $(SCSI_FILES) \ 144*2fcbc377Syt160523 $(SATA_FILES) \ 145*2fcbc377Syt160523 -l ../warlock/ddi_dki_impl.ll 146*2fcbc377Syt160523 $(TOUCH) $@ 147*2fcbc377Syt160523 148*2fcbc377Syt160523%.ll: $(UTSBASE)/common/io/sata/adapters/ahci/%.c 149*2fcbc377Syt160523 $(WLCC) $(CPPFLAGS) -D DEBUG -o $@ $< 150*2fcbc377Syt160523 151*2fcbc377Syt160523sata.files: 152*2fcbc377Syt160523 @cd ../sata; pwd; $(MAKE) warlock 153*2fcbc377Syt160523 154*2fcbc377Syt160523scsi.files: 155*2fcbc377Syt160523 @cd ../scsi; pwd; $(MAKE) warlock 156*2fcbc377Syt160523 157*2fcbc377Syt160523sd.files: 158*2fcbc377Syt160523 @cd ../sd; pwd; $(MAKE) warlock_alone 159*2fcbc377Syt160523 160*2fcbc377Syt160523warlock_ddi.files: 161*2fcbc377Syt160523 @cd ../warlock; pwd; $(MAKE) warlock 162