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