xref: /titanic_50/usr/src/cmd/ldmad/Makefile (revision d444b03e85973a0566ba10d94e6f65ca1a6b21fa)
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 2010 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27PROG=		ldmad
28MANIFEST=	ldoms-agents.xml
29SVCMETHOD=	ldoms-agents
30
31include ../Makefile.cmd
32
33
34LOCAL_SRCS=	ldmad.c			\
35		ldma_log.c		\
36		ldma_device.c		\
37		ldma_system.c		\
38		ldma_dio.c		\
39		mdesc_lib.c
40
41LOCAL_OBJS=	$(LOCAL_SRCS:%.c=%.o)
42
43COMMONBASE = ../../common
44
45COMMON_SRCS =	mdesc_findname.c	\
46		mdesc_findnodeprop.c	\
47		mdesc_fini.c		\
48		mdesc_getpropval.c	\
49		mdesc_getpropstr.c	\
50		mdesc_init_intern.c	\
51		mdesc_nodecount.c	\
52		mdesc_rootnode.c	\
53		mdesc_scandag.c
54
55COMMON_OBJS =	$(COMMON_SRCS:%.c=%.o)
56
57OBJS = $(LOCAL_OBJS) $(COMMON_OBJS)
58SRCS = $(LOCAL_SRCS) $(COMMON_SRCS:%.c=$(COMMONBASE)/mdesc/%.c)
59
60ROOTCMDDIR=		$(ROOTLIB)/ldoms
61ROOTMANIFESTDIR=	$(ROOTSVCPLATFORMSUN4V)
62$(ROOTMANIFEST)		:= FILEMODE= 444
63
64LDLIBS +=	-lds -ldladm -ldevinfo -lpri
65INCS +=		-I$(ROOT)/usr/platform/sun4v/include/sys
66INCS +=		-I$(SRC)/uts/sun4v
67CPPFLAGS += 	$(INCS)
68C99MODE =	$(C99_ENABLE)
69
70LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN
71
72.KEEP_STATE:
73
74all: $(PROG)
75
76$(PROG): $(OBJS)
77	$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
78	$(POST_PROCESS)
79
80install: all .WAIT $(ROOTCMD) $(ROOTMANIFEST) $(ROOTSVCMETHOD)
81
82check: $(CHKMANIFEST)
83
84lint: lint_SRCS
85
86clean:
87	$(RM) $(PROG) $(OBJS) $(LINT_FILES)
88
89include ../Makefile.targ
90
91%.o: $(COMMONBASE)/mdesc/%.c
92	$(COMPILE.c) -o $@ $<
93	$(POST_PROCESS_O)
94
95