xref: /titanic_41/usr/src/uts/intel/pmcs/Makefile (revision 4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6)
1*4c06356bSdh142964# CDDL HEADER START
2*4c06356bSdh142964#
3*4c06356bSdh142964# The contents of this file are subject to the terms of the
4*4c06356bSdh142964# Common Development and Distribution License (the "License").
5*4c06356bSdh142964# You may not use this file except in compliance with the License.
6*4c06356bSdh142964#
7*4c06356bSdh142964# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8*4c06356bSdh142964# or http://www.opensolaris.org/os/licensing.
9*4c06356bSdh142964# See the License for the specific language governing permissions
10*4c06356bSdh142964# and limitations under the License.
11*4c06356bSdh142964#
12*4c06356bSdh142964# When distributing Covered Code, include this CDDL HEADER in each
13*4c06356bSdh142964# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14*4c06356bSdh142964# If applicable, add the following below this CDDL HEADER, with the
15*4c06356bSdh142964# fields enclosed by brackets "[]" replaced with your own identifying
16*4c06356bSdh142964# information: Portions Copyright [yyyy] [name of copyright owner]
17*4c06356bSdh142964#
18*4c06356bSdh142964# CDDL HEADER END
19*4c06356bSdh142964#
20*4c06356bSdh142964# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
21*4c06356bSdh142964# Use is subject to license terms.
22*4c06356bSdh142964#
23*4c06356bSdh142964#
24*4c06356bSdh142964#	This makefile drives the production of the pmcs driver kernel module.
25*4c06356bSdh142964#
26*4c06356bSdh142964#	intel architecture dependent
27*4c06356bSdh142964#
28*4c06356bSdh142964
29*4c06356bSdh142964#
30*4c06356bSdh142964#	Paths to the base of the uts directory trees
31*4c06356bSdh142964#
32*4c06356bSdh142964UTSBASE   = ../../../../src/uts
33*4c06356bSdh142964
34*4c06356bSdh142964#
35*4c06356bSdh142964#	Define the module and object file sets.
36*4c06356bSdh142964#
37*4c06356bSdh142964MODULE		= pmcs
38*4c06356bSdh142964OBJECTS		= $(PMCS_OBJS:%=$(OBJS_DIR)/%)
39*4c06356bSdh142964LINTS		= $(PMCS_OBJS:%.o=$(LINTS_DIR)/%.ln)
40*4c06356bSdh142964ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
41*4c06356bSdh142964CONF_SRCDIR	= $(UTSBASE)/common/io/scsi/adapters/pmcs
42*4c06356bSdh142964WARLOCK_OUT     = $(PMCS_OBJS:%.o=%.ll)
43*4c06356bSdh142964WARLOCK_OK      = $(MODULE).ok
44*4c06356bSdh142964WLCMD_DIR       = $(UTSBASE)/common/io/warlock
45*4c06356bSdh142964BLDREVHDR	= ../../common/sys/scsi/adapters/pmcs/pmcs_bldrev.h
46*4c06356bSdh142964BLDREVHDR_T	= ../../common/sys/scsi/adapters/pmcs/pmcs_bldrev.h.tmp
47*4c06356bSdh142964
48*4c06356bSdh142964#
49*4c06356bSdh142964#	Kernel Module Dependencies
50*4c06356bSdh142964#
51*4c06356bSdh142964LDFLAGS += -dy -Nmisc/scsi
52*4c06356bSdh142964
53*4c06356bSdh142964#
54*4c06356bSdh142964#	Define targets
55*4c06356bSdh142964#
56*4c06356bSdh142964ALL_TARGET	= $(BINARY) $(CONFMOD)
57*4c06356bSdh142964LINT_TARGET	= $(MODULE).lint
58*4c06356bSdh142964INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
59*4c06356bSdh142964
60*4c06356bSdh142964#
61*4c06356bSdh142964#	Include common rules.
62*4c06356bSdh142964#
63*4c06356bSdh142964include $(UTSBASE)/intel/Makefile.intel
64*4c06356bSdh142964include $(CONF_SRCDIR)/pmcs8001fw.version
65*4c06356bSdh142964
66*4c06356bSdh142964#
67*4c06356bSdh142964# Add additional flags
68*4c06356bSdh142964#
69*4c06356bSdh142964PMCS_DRV_FLGS	= -DMODNAME=\"${MODULE}\"
70*4c06356bSdh142964CPPFLAGS	+= $(PMCS_DRV_FLGS) \
71*4c06356bSdh142964	-DPMCS_FIRMWARE_VERSION=${PMCS_FW_VERSION} \
72*4c06356bSdh142964	-DPMCS_FIRMWARE_VERSION_STRING=\"${PMCS_FW_VERSION_STRING}\"
73*4c06356bSdh142964
74*4c06356bSdh142964
75*4c06356bSdh142964#
76*4c06356bSdh142964#	Default build targets.
77*4c06356bSdh142964#
78*4c06356bSdh142964.KEEP_STATE:
79*4c06356bSdh142964
80*4c06356bSdh142964all:		ADDBUILDREV $(ALL_DEPS)
81*4c06356bSdh142964
82*4c06356bSdh142964ADDBUILDREV:
83*4c06356bSdh142964		@$(ECHO) '#define PMCS_BUILD_VERSION "'`date '+v20%y%m%d'`\"> \
84*4c06356bSdh142964		    $(BLDREVHDR_T);					\
85*4c06356bSdh142964		if [ -f $(BLDREVHDR) ]; then 				\
86*4c06356bSdh142964			RD=`$(DIFF) $(BLDREVHDR) $(BLDREVHDR_T) || $(TRUE)`; \
87*4c06356bSdh142964			if [ ! -z "$$RD" ]; then			\
88*4c06356bSdh142964				$(MV) $(BLDREVHDR_T) $(BLDREVHDR);	\
89*4c06356bSdh142964			fi;						\
90*4c06356bSdh142964		else							\
91*4c06356bSdh142964			$(MV) $(BLDREVHDR_T) $(BLDREVHDR);		\
92*4c06356bSdh142964		fi;							\
93*4c06356bSdh142964		$(RM) $(BLDREVHDR_T)
94*4c06356bSdh142964
95*4c06356bSdh142964def:		$(DEF_DEPS)
96*4c06356bSdh142964
97*4c06356bSdh142964clean:		$(CLEAN_DEPS)
98*4c06356bSdh142964		-$(RM) $(BLDREVHDR)
99*4c06356bSdh142964
100*4c06356bSdh142964clobber:	$(CLOBBER_DEPS)
101*4c06356bSdh142964
102*4c06356bSdh142964lint:		$(LINT_DEPS)
103*4c06356bSdh142964
104*4c06356bSdh142964modlintlib:	$(MODLINTLIB_DEPS)
105*4c06356bSdh142964
106*4c06356bSdh142964clean.lint:	$(CLEAN_LINT_DEPS)
107*4c06356bSdh142964
108*4c06356bSdh142964install:	ADDBUILDREV $(INSTALL_DEPS)
109*4c06356bSdh142964
110*4c06356bSdh142964#
111*4c06356bSdh142964#	Include common targets.
112*4c06356bSdh142964#
113*4c06356bSdh142964include $(UTSBASE)/intel/Makefile.targ
114