xref: /titanic_50/usr/src/lib/fm/topo/libtopo/Makefile.com (revision 3244bcaa97c6de4c5692dd87485de1ef73364ab5)
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# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28LIBRARY = libtopo.a
29VERS = .1
30
31BUILTINSRCS = \
32	cpu.c \
33	dev.c \
34	hc.c \
35	mem.c \
36	mod.c \
37	pkg.c
38
39LIBSRCS = \
40	topo_2xml.c \
41	topo_alloc.c \
42	topo_builtin.c \
43	topo_error.c \
44	topo_file.c \
45	topo_fmri.c \
46	topo_list.c \
47	topo_method.c \
48	topo_mod.c \
49	topo_module.c \
50	topo_node.c \
51	topo_nvl.c \
52	topo_parse.c \
53	topo_prop.c \
54	topo_protocol.c \
55	topo_rtld.c \
56	topo_snap.c \
57	topo_string.c \
58	topo_subr.c \
59	topo_tree.c \
60	topo_xml.c
61
62OBJECTS = $(BUILTINSRCS:%.c=%.o) $(LIBSRCS:%.c=%.o)
63
64include ../../../../Makefile.lib
65include ../../../Makefile.lib
66
67SRCS = $(BUILTINSRCS:%.c=../common/%.c) $(LIBSRCS:%.c=../common/%.c)
68LIBS = $(DYNLIB) $(LINTLIB)
69
70SRCDIR =	../common
71
72CLEANFILES += ../common/topo_error.c
73
74CPPFLAGS += -I../common -I/usr/include/libxml2 -I.
75CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
76CFLAGS += -D_POSIX_PTHREAD_SEMANTICS
77CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS)
78
79LINTFLAGS = -msux
80LINTFLAGS64 = -msux -Xarch=$(MACH64:sparcv9=v9)
81
82$(DYNLIB)  := LDLIBS += \
83	-lnvpair -lelf -lumem -lxml2 -lkstat -luuid -ldevinfo -lsmbios -lc
84
85$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
86$(LINTLIB) := LINTFLAGS = -nsvx
87$(LINTLIB) := LINTFLAGS64 = -nsvx -Xarch=$(MACH64:sparcv9=v9)
88$(LINTLIB) := LDLIBS += -lnvpair -lumem -lc
89
90.KEEP_STATE:
91
92all: $(LIBS)
93
94lint: $(LINTLIB) lintcheck
95
96pics/%.o: ../$(MACH)/%.c
97	$(COMPILE.c) -o $@ $<
98	$(POST_PROCESS_O)
99
100%.o: ../common/%.c
101	$(COMPILE.c) -o $@ $<
102	$(POST_PROCESS_O)
103
104../common/topo_error.c: ../common/mkerror.sh ../common/topo_error.h
105	sh ../common/mkerror.sh liberrors < ../common/topo_error.h > $@
106	sh ../common/mkerror.sh properrors < ../common/libtopo.h >> $@
107	sh ../common/mkerror.sh methoderrors < ../common/libtopo.h >> $@
108	sh ../common/mkerror.sh moderrors < ../common/topo_mod.h >> $@
109
110include ../../../../Makefile.targ
111include ../../../Makefile.targ
112