1*a4aa671eSarutz# 2*a4aa671eSarutz# CDDL HEADER START 3*a4aa671eSarutz# 4*a4aa671eSarutz# The contents of this file are subject to the terms of the 5*a4aa671eSarutz# Common Development and Distribution License (the "License"). 6*a4aa671eSarutz# You may not use this file except in compliance with the License. 7*a4aa671eSarutz# 8*a4aa671eSarutz# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*a4aa671eSarutz# or http://www.opensolaris.org/os/licensing. 10*a4aa671eSarutz# See the License for the specific language governing permissions 11*a4aa671eSarutz# and limitations under the License. 12*a4aa671eSarutz# 13*a4aa671eSarutz# When distributing Covered Code, include this CDDL HEADER in each 14*a4aa671eSarutz# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*a4aa671eSarutz# If applicable, add the following below this CDDL HEADER, with the 16*a4aa671eSarutz# fields enclosed by brackets "[]" replaced with your own identifying 17*a4aa671eSarutz# information: Portions Copyright [yyyy] [name of copyright owner] 18*a4aa671eSarutz# 19*a4aa671eSarutz# CDDL HEADER END 20*a4aa671eSarutz# 21*a4aa671eSarutz# 22*a4aa671eSarutz#ident "%Z%%M% %I% %E% SMI" 23*a4aa671eSarutz# 24*a4aa671eSarutz# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 25*a4aa671eSarutz# Use is subject to license terms. 26*a4aa671eSarutz# 27*a4aa671eSarutz# uts/sparc/dad/Makefile 28*a4aa671eSarutz# 29*a4aa671eSarutz# This makefile drives the production of the dad driver kernel module. 30*a4aa671eSarutz# 31*a4aa671eSarutz# SPARC architecture dependent 32*a4aa671eSarutz# 33*a4aa671eSarutz 34*a4aa671eSarutz# 35*a4aa671eSarutz# Path to the base of the uts directory tree (usually /usr/src/uts). 36*a4aa671eSarutz# 37*a4aa671eSarutzUTSBASE = ../.. 38*a4aa671eSarutz 39*a4aa671eSarutz# 40*a4aa671eSarutz# Define the module and object file sets. 41*a4aa671eSarutz# 42*a4aa671eSarutzMODULE = dad 43*a4aa671eSarutzOBJECTS = $(DAD_OBJS:%=$(OBJS_DIR)/%) 44*a4aa671eSarutzLINTS = $(DAD_OBJS:%.o=$(LINTS_DIR)/%.ln) 45*a4aa671eSarutzROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) 46*a4aa671eSarutzCONF_SRCDIR = $(UTSBASE)/sun/io/dada/targets 47*a4aa671eSarutzWARLOCK_OUT = $(DAD_OBJS:%.o=%.ll) 48*a4aa671eSarutzWARLOCK_OK = $(MODULE).ok 49*a4aa671eSarutzWLCMD_DIR = $(UTSBASE)/common/io/warlock 50*a4aa671eSarutz 51*a4aa671eSarutz# 52*a4aa671eSarutz# Include common rules. 53*a4aa671eSarutz# 54*a4aa671eSarutzinclude $(UTSBASE)/sparc/Makefile.sparc 55*a4aa671eSarutz 56*a4aa671eSarutz 57*a4aa671eSarutz# 58*a4aa671eSarutz# Define targets 59*a4aa671eSarutz# 60*a4aa671eSarutzALL_TARGET = $(BINARY) 61*a4aa671eSarutzLINT_TARGET = $(MODULE).lint 62*a4aa671eSarutzINSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) 63*a4aa671eSarutz 64*a4aa671eSarutz# 65*a4aa671eSarutz# Overrides. 66*a4aa671eSarutz# 67*a4aa671eSarutzCFLAGS += $(CCVERBOSE) 68*a4aa671eSarutzLDFLAGS += -dy -Nmisc/dada -Nmisc/cmlb 69*a4aa671eSarutz 70*a4aa671eSarutz# 71*a4aa671eSarutz# For now, disable these lint checks; maintainers should endeavor 72*a4aa671eSarutz# to investigate and remove these for maximum lint coverage. 73*a4aa671eSarutz# Please do not carry these forward to new Makefiles. 74*a4aa671eSarutz# 75*a4aa671eSarutzLINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN 76*a4aa671eSarutzLINTTAGS += -erroff=E_ASSIGN_NARROW_CONV 77*a4aa671eSarutzLINTTAGS += -erroff=E_STATIC_UNUSED 78*a4aa671eSarutzLINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON 79*a4aa671eSarutz 80*a4aa671eSarutz# 81*a4aa671eSarutz# Default build targets. 82*a4aa671eSarutz# 83*a4aa671eSarutz.KEEP_STATE: 84*a4aa671eSarutz 85*a4aa671eSarutzall: $(ALL_DEPS) 86*a4aa671eSarutz 87*a4aa671eSarutzdef: $(DEF_DEPS) 88*a4aa671eSarutz 89*a4aa671eSarutzclean: $(CLEAN_DEPS) 90*a4aa671eSarutz $(RM) $(WARLOCK_OUT) $(WARLOCK_OK) 91*a4aa671eSarutz 92*a4aa671eSarutzclobber: $(CLOBBER_DEPS) 93*a4aa671eSarutz $(RM) $(WARLOCK_OUT) $(WARLOCK_OK) 94*a4aa671eSarutz 95*a4aa671eSarutzlint: $(LINT_DEPS) 96*a4aa671eSarutz 97*a4aa671eSarutzmodlintlib: $(MODLINTLIB_DEPS) lint64 98*a4aa671eSarutz 99*a4aa671eSarutzclean.lint: $(CLEAN_LINT_DEPS) 100*a4aa671eSarutz 101*a4aa671eSarutzinstall: $(INSTALL_DEPS) 102*a4aa671eSarutz 103*a4aa671eSarutz# 104*a4aa671eSarutz# Include common targets. 105*a4aa671eSarutz# 106*a4aa671eSarutzinclude $(UTSBASE)/sparc/Makefile.targ 107*a4aa671eSarutz 108*a4aa671eSarutz 109*a4aa671eSarutz# 110*a4aa671eSarutz# Defines for local commands. 111*a4aa671eSarutz# 112*a4aa671eSarutzWARLOCK = warlock 113*a4aa671eSarutzWLCC = wlcc 114*a4aa671eSarutzTOUCH = touch 115*a4aa671eSarutzSCCS = sccs 116*a4aa671eSarutzTEST = test 117*a4aa671eSarutz 118*a4aa671eSarutz# 119*a4aa671eSarutz# Warlock targets 120*a4aa671eSarutz# 121*a4aa671eSarutz# Note that in warlock_with_{esp,isp} it is important to load sd.ll 122*a4aa671eSarutz# before {isp,esp}.ll; the reason is that both have _init/_info/_fini 123*a4aa671eSarutz# and warlock can only handle one extern function by a given name; 124*a4aa671eSarutz# any loaded after the first are ignored. 125*a4aa671eSarutz 126*a4aa671eSarutzDADA_FILES = $(DADA_OBJS:%.o=-l $(UTSBASE)/sparc/dada/%.ll) 127*a4aa671eSarutzCMLB_FILES = $(CMLB_OBJS:%.o=-l $(UTSBASE)/sparc/cmlb/%.ll) 128*a4aa671eSarutz 129*a4aa671eSarutzwarlock: warlock_alone 130*a4aa671eSarutz 131*a4aa671eSarutzwarlock_alone: $(WARLOCK_OK) 132*a4aa671eSarutz 133*a4aa671eSarutz%.wlcmd: 134*a4aa671eSarutz cd $(WLCMD_DIR); $(TEST) -f $@ || $(SCCS) get $@ 135*a4aa671eSarutz 136*a4aa671eSarutzdada_files: 137*a4aa671eSarutz @cd $(UTSBASE)/sparc/dada; pwd; $(MAKE) warlock 138*a4aa671eSarutz 139*a4aa671eSarutzcmlb_files: 140*a4aa671eSarutz @cd $(UTSBASE)/sparc/cmlb; pwd; $(MAKE) warlock 141*a4aa671eSarutz 142*a4aa671eSarutz$(WARLOCK_OK): dad.wlcmd $(WARLOCK_OUT) dada_files warlock_ddi.files cmlb_files dad.wlcmd 143*a4aa671eSarutz $(WARLOCK) -c $(WLCMD_DIR)/dad.wlcmd $(WARLOCK_OUT) -l $(DADA_FILES) \ 144*a4aa671eSarutz -l $(CMLB_FILES) \ 145*a4aa671eSarutz -l $(UTSBASE)/sparc/warlock/ddi_dki_impl.ll 146*a4aa671eSarutz $(TOUCH) $@ 147*a4aa671eSarutz 148*a4aa671eSarutz%.ll: $(UTSBASE)/sun/io/dada/targets/%.c 149*a4aa671eSarutz $(WLCC) $(CPPFLAGS) -o $@ $< 150*a4aa671eSarutz 151*a4aa671eSarutzwarlock_ddi.files: 152*a4aa671eSarutz @cd $(UTSBASE)/sparc/warlock; pwd; $(MAKE) warlock 153