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# 23# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26# 27# Path to the base of the uts directory tree (usually /usr/src/uts). 28# 29UTSBASE = ../.. 30 31# 32# Define the module and object file sets. 33# 34MODULE = nv_sata 35OBJECTS = $(NV_SATA_OBJS:%=$(OBJS_DIR)/%) 36LINTS = $(NV_SATA_OBJS:%.o=$(LINTS_DIR)/%.ln) 37ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) 38CONF_SRCDIR = $(UTSBASE)/common/io/sata/adapters/nv_sata 39WARLOCK_OUT = $(NV_SATA_OBJS:%.o=%.ll) 40WARLOCK_OK = $(MODULE).ok 41WLCMD_DIR = $(UTSBASE)/common/io/warlock 42 43# 44# Include common rules. 45# 46include $(UTSBASE)/intel/Makefile.intel 47 48# 49# Define targets 50# 51ALL_TARGET = $(BINARY) 52LINT_TARGET = $(MODULE).lint 53INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) 54 55# 56# Overrides. 57# 58DEBUG_FLGS = 59DEBUG_DEFS += $(DEBUG_FLGS) 60CPPFLAGS += -DSGPIO_SUPPORT 61 62# 63# lint pass one enforcement 64# 65CFLAGS += $(CCVERBOSE) 66 67# 68# dependency on sata module 69# 70LDFLAGS += -dy -N misc/sata 71 72# 73# For now, disable these lint checks; maintainers should endeavor 74# to investigate and remove these for maximum lint coverage. 75# Please do not carry these forward to new Makefiles. 76# 77LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN 78 79CERRWARN += -_gcc=-Wno-uninitialized 80 81# 82# Default build targets. 83# 84.KEEP_STATE: 85 86def: $(DEF_DEPS) 87 88all: $(ALL_DEPS) 89 90clean: $(CLEAN_DEPS) 91 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK) 92 93clobber: $(CLOBBER_DEPS) 94 $(RM) $(WARLOCK_OUT) $(WARLOCK_OK) 95 96lint: $(LINT_DEPS) 97 98modlintlib: $(MODLINTLIB_DEPS) 99 100clean.lint: $(CLEAN_LINT_DEPS) 101 102install: $(INSTALL_DEPS) 103 104# 105# Include common targets. 106# 107include $(UTSBASE)/intel/Makefile.targ 108 109 110# 111# Defines for local commands. 112# 113WARLOCK = warlock 114WLCC = wlcc 115TOUCH = touch 116TEST = test 117 118NV_SATA_FILES = $(MODULE).ll 119SD_FILES = $(SD_OBJS:%.o=../sd/%.ll) 120SATA_FILES = $(SATA_OBJS:%.o=-l ../sata/%.ll) 121SCSI_FILES = $(SCSI_OBJS:%.o=-l ../scsi/%.ll) 122CMLB_FILES = $(CMLB_OBJS:%.o=-l ../cmlb/%.ll) 123 124warlock: $(WARLOCK_OK) 125 126 127$(WARLOCK_OK): $(WLCMD_DIR)/nv_sata.wlcmd $(WARLOCK_OUT) warlock_ddi.files \ 128 sata.files scsi.files sd.files cmlb.files 129 $(WARLOCK) -c $(WLCMD_DIR)/nv_sata.wlcmd $(WARLOCK_OUT) \ 130 $(SD_FILES) \ 131 $(SCSI_FILES) \ 132 $(CMLB_FILES) \ 133 $(SATA_FILES) \ 134 -l ../warlock/ddi_dki_impl.ll 135 $(TOUCH) $@ 136 137%.ll: $(UTSBASE)/common/io/sata/adapters/nv_sata/%.c 138 $(WLCC) $(CPPFLAGS) -D DEBUG -o $@ $< 139 140sata.files: 141 @cd ../sata; pwd; $(MAKE) warlock 142 143scsi.files: 144 @cd ../scsi; pwd; $(MAKE) warlock 145 146sd.files: 147 @cd ../sd; pwd; $(MAKE) warlock_alone 148 149cmlb.files: 150 @cd ../cmlb; pwd; $(MAKE) warlock 151 152warlock_ddi.files: 153 @cd ../warlock; pwd; $(MAKE) warlock 154