move 32-bit libs to lib/i386 subdirs & 64-bit libs to lib/
[unleashed.git] / usr / src / lib / fm / topo / modules / Makefile.plugin
blob60fe2fb87d8b0429a5cff17a824f5c60cecded19
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 2009 Sun Microsystems, Inc.  All rights reserved.
23 # Use is subject to license terms.
26 .KEEP_STATE:
27 .SUFFIXES:
29 MODCLASS = plugins
31 include ../../../../Makefile.lib
32 include ../../../../../Makefile.lib
35 # Set PROG and OBJS based on the values of MODULE and SRCS.  We expect that
36 # these macros to be defined by the Makefile that is including this file.
38 # SHAREDSRCS is used to share sources between multiple libtopo modules.
40 SRCS = $(MODULESRCS:%.c=%.c) $(SHAREDSRCS:%.c=../../common/$(SHAREDMODULE)/%.c)
41 PROG = $(MODULE:%=%.so)
42 OBJS = $(MODULESRCS:%.c=%.o) $(SHAREDSRCS:%.c=%.o)
45 # Set ROOTPROG and ROOTCONF based on the values of MODULE, CLASS, and PLATFORMS
46 # We expect these macros to be defined by the Makefile that is including us.
48 common_ROOTPROG = $(ROOT)/usr/lib/fm/topo/plugins/$(PROG)
49 arch_ROOTPROG = $(ROOT)/usr/platform/lib/fm/topo/plugins/$(PROG)
50 plat_ROOTPROG = $(PLATFORMS:%=$(ROOT)/usr/platform/%/lib/fm/topo/plugins/$(PROG))
51 ROOTPROG = $($(CLASS)_ROOTPROG)
53 common_ROOTCONF = $(ROOT)/usr/lib/fm/topo/plugins/$(CONF)
54 arch_ROOTCONF = $(ROOT)/usr/platform/lib/fm/topo/plugins/$(CONF)
55 plat_ROOTCONF = $(PLATFORMS:%=$(ROOT)/usr/platform/%/lib/fm/topo/plugins/$(CONF))
56 ROOTCONF = $($(CLASS)_ROOTCONF)
58 CERRWARN += -Wno-uninitialized
59 CERRWARN += -Wno-parentheses
61 APIMAP = ../../../libtopo/common/topo_mod.map
62 MAPFILES =              # use APIMAP instead
64 CSTD  = $(CSTD_GNU99)
65 CFLAGS += $(CTF_FLAGS) $(CC_PICFLAGS)
66 CFLAGS += $(GSHARED) $(XREGSFLAG)
68 CPPFLAGS += -I.
69 CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS
70 LDFLAGS += $(ZIGNORE) -Wl,-M$(APIMAP)
71 LDLIBS += -L$(ROOT)/usr/lib/fm/$(MACH32) -ltopo -lnvpair -lc
72 DYNFLAGS += -R/usr/lib/fm/$(MACH32)
74 all: $(PROG)
76 .NO_PARALLEL:
77 .PARALLEL: $(OBJS)
79 $(PROG): $(OBJS) $(APIMAP)
80         $(LINK.c) $(DYNFLAGS) $(OBJS) -o $@ $(LDLIBS)
81         $(CTFMERGE) -L VERSION -o $@ $(OBJS)
82         $(POST_PROCESS_SO)
84 %.o: ../../common/$(MODULE)/%.c
85         $(COMPILE.c) $<
86         $(CTFCONVERT_O)
88 %.o: ../../common/$(SHAREDMODULE)/%.c
89         $(COMPILE.c) $<
90         $(CTFCONVERT_O)
92 %.o: %.c
93         $(COMPILE.c) $<
94         $(CTFCONVERT_O)
96 clean:
97         $(RM) $(OBJS) $(CLEANFILES)
99 clobber: clean
100         $(RM) $(PROG) $(CLOBBERFILES)
102 check:  $(CHECKHDRS)
104 install_h:
106 $(ROOTPROG): $$(@D) $(PROG)
107         $(INS) -m 0555 $(PROG) $@
109 install: $(ROOTPROG)
111 include ../../../Makefile.rootdirs