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