1# CDDL HEADER START 2# 3# The contents of this file are subject to the terms of the 4# Common Development and Distribution License (the "License"). 5# You may not use this file except in compliance with the License. 6# 7# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 8# or http://www.opensolaris.org/os/licensing. 9# See the License for the specific language governing permissions 10# and limitations under the License. 11# 12# When distributing Covered Code, include this CDDL HEADER in each 13# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 14# If applicable, add the following below this CDDL HEADER, with the 15# fields enclosed by brackets "[]" replaced with your own identifying 16# information: Portions Copyright [yyyy] [name of copyright owner] 17# 18# CDDL HEADER END 19# 20 21# 22# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23# Use is subject to license terms. 24# 25# ident "%Z%%M% %I% %E% SMI" 26# 27 28# 29# uts/sparc/ahci/Makefile 30# 31# This makefile drives the production of the 32# "/kernel/drv/ahci" kernel module. 33# 34# sparc architecture dependent 35# 36 37# 38# Path to the base of the uts directory tree (usually /usr/src/uts). 39# 40UTSBASE = ../.. 41 42# 43# Define the module and object file sets. 44# 45MODULE = ahci 46OBJECTS = $(AHCI_OBJS:%=$(OBJS_DIR)/%) 47LINTS = $(AHCI_OBJS:%.o=$(LINTS_DIR)/%.ln) 48WARLOCK_OUT = $(AHCI_OBJS:%.o=%.ll) 49WARLOCK_OK = $(MODULE).ok 50ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) 51CONF_SRCDIR = $(UTSBASE)/common/io/sata/adapters/ahci 52WLCMD_DIR = $(UTSBASE)/common/io/warlock 53 54# 55# Include common rules. 56# 57include $(UTSBASE)/sparc/Makefile.sparc 58 59# 60# Define targets 61# 62ALL_TARGET = $(BINARY) 63LINT_TARGET = $(MODULE).lint 64INSTALL_TARGET = $(BINARY) $(ROOTMODULE) 65 66# 67# Overrides. 68# 69DEBUG_FLGS = 70DEBUG_DEFS += $(DEBUG_FLGS) 71 72# 73# lint pass one enforcement 74# 75CFLAGS += $(CCVERBOSE) 76 77# 78# Default build targets. 79# 80.KEEP_STATE: 81 82def: $(DEF_DEPS) 83 84all: $(ALL_DEPS) 85 86clean: $(CLEAN_DEPS) 87 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK) 88 89clobber: $(CLOBBER_DEPS) 90 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK) 91 92lint: $(LINT_DEPS) 93 94modlintlib: $(MODLINTLIB_DEPS) 95 96clean.lint: $(CLEAN_LINT_DEPS) 97 98install: $(INSTALL_DEPS) 99 100# 101# Include common targets. 102# 103include $(UTSBASE)/sparc/Makefile.targ 104 105 106# 107# Defines for local commands. 108# 109WARLOCK = warlock 110WLCC = wlcc 111TOUCH = touch 112SCCS = sccs 113TEST = test 114 115SD_FILES = $(SD_OBJS:%.o=../sd/%.ll) 116SATA_FILES = $(SATA_OBJS:%.o=-l ../sata/%.ll) 117SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll) 118CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll) 119 120warlock: $(WARLOCK_OK) 121 122%.wlcmd: 123 cd $(WLCMD_DIR); $(TEST) -f $@ || $(SCCS) get $@ 124 125$(WARLOCK_OK): ahci.wlcmd $(WARLOCK_OUT) warlock_ddi.files \ 126 sata.files scsi.files sd.files cmlb.files 127 $(WARLOCK) -c $(WLCMD_DIR)/ahci.wlcmd $(WARLOCK_OUT) \ 128 $(SD_FILES) \ 129 $(SCSI_FILES) \ 130 $(CMLB_FILES) \ 131 $(SATA_FILES) \ 132 -l ../warlock/ddi_dki_impl.ll 133 $(TOUCH) $@ 134 135%.ll: $(UTSBASE)/common/io/sata/adapters/ahci/%.c 136 $(WLCC) $(CPPFLAGS) -D DEBUG -D __sparcv9 -o $@ $< 137 138sata.files: 139 @cd ../sata; pwd; $(MAKE) warlock 140 141scsi.files: 142 @cd ../scsi; pwd; $(MAKE) warlock 143 144sd.files: 145 @cd ../sd; pwd; $(MAKE) warlock_alone 146 147cmlb.files: 148 @cd ../cmlb; pwd; $(MAKE) warlock 149 150 151warlock_ddi.files: 152 @cd ../warlock; pwd; $(MAKE) warlock 153