Makefile revision 978:276670f0fee7
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 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#	Path to the base of the uts directory tree.
31#
32UTSBASE	= ../..
33
34#
35#	Define the module and object file sets.
36#
37MODULE		= scsa1394
38OBJECTS		= $(SCSA1394_OBJS:%=$(OBJS_DIR)/%)
39LINTS		= $(SCSA1394_OBJS:%.o=$(LINTS_DIR)/%.ln)
40ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
41WARLOCK_OUT     = $(SCSA1394_OBJS:%.o=%.ll)
42WARLOCK_OK      = $(MODULE).ok
43
44#
45#	Include common rules.
46#
47include $(UTSBASE)/sparc/Makefile.sparc
48
49#
50#	Define targets
51#
52ALL_TARGET	= $(BINARY)
53LINT_TARGET	= $(MODULE).lint
54INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
55
56#
57#       Overrides
58#
59ALL_BUILDS	= $(ALL_BUILDSONLY64)
60DEF_BUILDS	= $(DEF_BUILDSONLY64)
61CLEANLINTFILES	+= $(LINT32_FILES)
62
63#
64# lint pass one enforcement
65#
66CFLAGS += -v
67
68#
69# depends on
70#
71LDFLAGS		+= -dy -Nmisc/scsi -Nmisc/s1394 -Nmisc/sbp2
72
73#	Default build targets.
74#
75.KEEP_STATE:
76
77def:		$(DEF_DEPS)
78
79all:		$(ALL_DEPS)
80
81clean:		$(CLEAN_DEPS); \
82		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
83
84clobber:	$(CLOBBER_DEPS); \
85		$(RM) $(WARLOCK_OUT) $(WARLOCK_OK)
86
87modlintlib:	$(MODLINTLIB_DEPS) lint32
88
89clean.lint:	$(CLEAN_LINT_DEPS)
90
91install:	$(INSTALL_DEPS)
92
93#
94#	Include common targets.
95#
96include $(UTSBASE)/sparc/Makefile.targ
97
98#
99#	Defines for local commands.
100#
101WARLOCK		= warlock
102WLCC		= wlcc
103TOUCH		= touch
104SCCS		= sccs
105TEST		= test
106
107#
108#	Warlock targets
109#
110WARLOCK_OBJECTS	= $(SCSA1394_OBJS:%.o=%.ll)
111SBP2_FILES = $(SBP2_OBJS:%.o= -l ../sbp2/%.ll)
112SD_FILES   = $(SD_OBJS:%.o=../sd/%.ll)
113SCSI_FILES = $(SCSI_OBJS:%.o= -l ../scsi/%.ll)
114
115warlock: $(MODULE).ok
116
117%.wlcmd:
118	$(TEST) -f $@ || $(SCCS) get $@
119
120$(MODULE).ok: $(WARLOCK_OBJECTS) sbp2.files warlock_ddi.files scsa1394.wlcmd \
121	sd.files scsi.files
122	$(WARLOCK) -c scsa1394.wlcmd $(WARLOCK_OBJECTS) $(SD_FILES) \
123		$(SCSI_FILES) \
124		$(SBP2_FILES) \
125		-l ../warlock/ddi_dki_impl.ll
126	$(TOUCH) $@
127
128%.ll: $(UTSBASE)/common/io/1394/targets/scsa1394/%.c
129	$(WLCC) $(CPPFLAGS) -DNPROBE -DDEBUG -o $@ $<
130
131sbp2.files:
132	@cd ../sbp2; pwd; $(MAKE) warlock
133
134warlock_ddi.files:
135	@cd ../warlock; pwd; $(MAKE) warlock
136
137sd.files:
138	@cd ../sd; pwd; $(MAKE) warlock_alone
139
140scsi.files:
141	@cd ../scsi; pwd; $(MAKE) warlock
142
143
144