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