xref: /titanic_51/usr/src/lib/fm/topo/libtopo/Makefile.com (revision 2c20fda2feee4850b7ec4297e4120bc72c2bac09)
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 2008 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	zfs.c \
36	fmd.c \
37	legacy_hc.c \
38	mem.c \
39	mod.c \
40	pkg.c
41
42LIBSRCS = \
43	topo_2xml.c \
44	topo_alloc.c \
45	topo_builtin.c \
46	topo_error.c \
47	topo_file.c \
48	topo_fmri.c \
49	topo_list.c \
50	topo_method.c \
51	topo_mod.c \
52	topo_module.c \
53	topo_node.c \
54	topo_nvl.c \
55	topo_parse.c \
56	topo_prop.c \
57	topo_protocol.c \
58	topo_rtld.c \
59	topo_snap.c \
60	topo_string.c \
61	topo_subr.c \
62	topo_tables.c \
63	topo_tree.c \
64	topo_xml.c
65
66OBJECTS = $(BUILTINSRCS:%.c=%.o) $(LIBSRCS:%.c=%.o)
67
68include ../../../../Makefile.lib
69include ../../../Makefile.lib
70
71SRCS = $(BUILTINSRCS:%.c=../common/%.c) $(LIBSRCS:%.c=../common/%.c)
72LIBS = $(DYNLIB) $(LINTLIB)
73
74SRCDIR =	../common
75
76CLEANFILES += $(SRCDIR)/topo_error.c $(SRCDIR)/topo_tables.c
77
78CPPFLAGS += -I../common -I/usr/include/libxml2 -I.
79CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
80CFLAGS += -D_POSIX_PTHREAD_SEMANTICS
81CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS)
82
83LINTFLAGS = -msux
84LINTFLAGS64 = -msux -Xarch=$(MACH64:sparcv9=v9)
85
86$(DYNLIB)  := LDLIBS += \
87	-lnvpair -lelf -lumem -lxml2 -lkstat -luuid -ldevinfo \
88	-lsmbios -lc -ldevid -lipmi
89
90$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
91$(LINTLIB) := LINTFLAGS = -nsvx
92$(LINTLIB) := LINTFLAGS64 = -nsvx -Xarch=$(MACH64:sparcv9=v9)
93$(LINTLIB) := LDLIBS += -lnvpair -lumem -lc
94
95.KEEP_STATE:
96
97all: $(LIBS)
98
99lint: $(LINTLIB) lintcheck
100
101pics/%.o: ../$(MACH)/%.c
102	$(COMPILE.c) -o $@ $<
103	$(POST_PROCESS_O)
104
105%.o: ../common/%.c
106	$(COMPILE.c) -o $@ $<
107	$(POST_PROCESS_O)
108
109../common/topo_error.c: ../common/mkerror.sh ../common/topo_error.h
110	sh ../common/mkerror.sh liberrors < ../common/topo_error.h > $@
111	sh ../common/mkerror.sh properrors < ../common/libtopo.h >> $@
112	sh ../common/mkerror.sh methoderrors < ../common/libtopo.h >> $@
113	sh ../common/mkerror.sh fmrierrors < ../common/libtopo.h >> $@
114	sh ../common/mkerror.sh hdlerrors < ../common/libtopo.h >> $@
115	sh ../common/mkerror.sh moderrors < ../common/topo_mod.h >> $@
116
117$(SRCDIR)/topo_tables.c: $(SRCDIR)/mktables.sh $(SRCDIR)/libtopo.h
118	sh $(SRCDIR)/mktables.sh $(SRCDIR)/libtopo.h > $@
119
120include ../../../../Makefile.targ
121include ../../../Makefile.targ
122