Merge illumos-gate
[unleashed/lotheac.git] / usr / src / lib / fm / topo / libtopo / Makefile.com
blob10aa5d1174818372e8ac04d3105f1098fea6ae7e
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
22 # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
23 # Copyright (c) 2018, Joyent, Inc.
26 LIBRARY = libtopo.a
27 VERS = .1
29 BUILTINSRCS = \
30         cpu.c \
31         dev.c \
32         fmd.c \
33         hc.c \
34         legacy_hc.c \
35         mem.c \
36         mod.c \
37         pkg.c \
38         svc.c \
39         sw.c \
40         zfs.c
42 LIBSRCS = \
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
66 OBJECTS = $(BUILTINSRCS:%.c=%.o) $(LIBSRCS:%.c=%.o)
68 include ../../../../Makefile.lib
69 include ../../../Makefile.lib
71 SRCS = $(BUILTINSRCS:%.c=../common/%.c) $(LIBSRCS:%.c=../common/%.c)
72 LIBS = $(DYNLIB)
74 SRCDIR =        ../common
76 CLEANFILES += $(SRCDIR)/topo_error.c $(SRCDIR)/topo_tables.c
78 CPPFLAGS += -I../common -I$(ADJUNCT_PROTO)/usr/include/libxml2 -I.
79 CFLAGS += $(C_BIGPICFLAGS)
80 CFLAGS += -D_POSIX_PTHREAD_SEMANTICS
81 CFLAGS64 += $(C_BIGPICFLAGS)
82 CERRWARN += -Wno-uninitialized
83 CERRWARN += -Wno-switch
84 CERRWARN += -Wno-parentheses
86 # not linted
87 SMATCH=off
89 $(DYNLIB)  := LDLIBS += \
90         -lnvpair -lelf -lumem -lxml2 -lkstat -luuid -ldevinfo \
91         -lsmbios -lc -ldevid -lipmi -lscf -lpcidb
94 .KEEP_STATE:
96 all: $(LIBS)
99 pics/%.o: ../$(MACH)/%.c
100         $(COMPILE.c) -o $@ $<
101         $(POST_PROCESS_O)
103 %.o: ../common/%.c
104         $(COMPILE.c) -o $@ $<
105         $(POST_PROCESS_O)
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 >> $@
115 $(SRCDIR)/topo_tables.c: $(SRCDIR)/mktables.sh $(SRCDIR)/libtopo.h
116         sh $(SRCDIR)/mktables.sh $(SRCDIR)/libtopo.h > $@
118 include ../../../../Makefile.targ
119 include ../../../Makefile.targ