0
|
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 |
#
|
240
|
23 |
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
0
|
24 |
# Use is subject to license terms.
|
|
25 |
#
|
|
26 |
#ident "%Z%%M% %I% %E% SMI"
|
|
27 |
|
|
28 |
.KEEP_STATE:
|
|
29 |
.SUFFIXES:
|
|
30 |
|
|
31 |
include ../../../../../Makefile.cmd
|
|
32 |
|
|
33 |
#
|
|
34 |
# Set PROG and OBJS based on the values of MODULE and SRCS. We expect that
|
|
35 |
# these macros to be defined by the Makefile that is including this file.
|
|
36 |
#
|
|
37 |
PROG = $(MODULE:%=%.so)
|
|
38 |
TOPO = $(MODULE:%=%.topo)
|
|
39 |
YOBJS = $(YSRCS:%.y=%.o)
|
|
40 |
OBJS = $(YOBJS) $(SRCS:%.c=%.o)
|
|
41 |
|
|
42 |
#
|
|
43 |
# Set ROOTPROG and ROOTTOPO based on the values of MODULE, CLASS, and PLATFORMS
|
|
44 |
# We expect these macros to be defined by the Makefile that is including us.
|
|
45 |
#
|
|
46 |
common_TOPODIR = $(ROOT)/usr/lib/fm/topo
|
|
47 |
arch_TOPODIR = $(ROOT)/usr/lib/fm/topo/$(ARCH)
|
|
48 |
ROOT_TOPO_DIR = $($(CLASS)_TOPODIR)
|
|
49 |
|
|
50 |
ROOTPROG = $(ROOT_TOPO_DIR)/$(PROG)
|
|
51 |
ROOTTOPO = $(ROOT_TOPO_DIR)/$(TOPO)
|
|
52 |
|
|
53 |
LINTFLAGS += -mu
|
|
54 |
LINTFILES = $(SRCS:%.c=%.ln)
|
|
55 |
LINTLDLIBS += -L$(ROOTLIB)/fm -ltopo
|
|
56 |
CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) -xstrconst -K pic -G $(XREGSFLAG)
|
|
57 |
CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
|
|
58 |
LDFLAGS += -z text -z combreloc -z defs -z ignore -R/usr/lib/fm
|
|
59 |
LDLIBS += -L$(ROOTLIB)/fm -ltopo -lc
|
|
60 |
|
|
61 |
all: $(PROG)
|
|
62 |
|
|
63 |
.NO_PARALLEL:
|
|
64 |
.PARALLEL: $(OBJS) $(LINTFILES)
|
|
65 |
|
|
66 |
$(PROG): $(OBJS)
|
|
67 |
$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
|
|
68 |
$(CTFMERGE) -L VERSION -o $@ $(OBJS)
|
|
69 |
$(POST_PROCESS_SO)
|
|
70 |
|
|
71 |
%.o: %.c
|
|
72 |
$(COMPILE.c) $<
|
|
73 |
$(CTFCONVERT_O)
|
|
74 |
|
|
75 |
clean:
|
|
76 |
$(RM) $(OBJS) $(LINTFILES)
|
|
77 |
|
|
78 |
clobber: clean
|
240
|
79 |
$(RM) $(PROG) $(ROOTTOPO) $(ROOTPROG)
|
0
|
80 |
|
|
81 |
%.ln: %.c
|
|
82 |
$(LINT.c) -c $<
|
|
83 |
|
|
84 |
lint: $(LINTFILES)
|
|
85 |
$(LINT) $(LINTFLAGS) $(LINTFILES) $(LDLIBS)
|
|
86 |
|
|
87 |
install_h:
|
|
88 |
|
|
89 |
$(ROOTPROG): $$(@D) $(PROG)
|
|
90 |
$(RM) $@; $(INS) -s -m 0555 -f $(@D) $(PROG)
|
|
91 |
|
|
92 |
$(ROOTTOPO): $$(@D) $(TOPO)
|
|
93 |
$(RM) $@; $(INS) -s -m 0444 -f $(@D) $(TOPO)
|
|
94 |
|
|
95 |
install: $(ROOTTOPO) $(ROOTPROG)
|
|
96 |
|
|
97 |
include ../../../Makefile.rootdirs
|