lib/fm/topo/module: build 64-bit
[unleashed.git] / usr / src / lib / fm / topo / modules / Makefile.plugin
bloba1428bfe779ce2d193d328c6e3f2ead28c327342
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
33 include ../../../../../Makefile.lib.64
36 # Set PROG and OBJS based on the values of MODULE and SRCS.  We expect that
37 # these macros to be defined by the Makefile that is including this file.
39 # SHAREDSRCS is used to share sources between multiple libtopo modules.
41 SRCS = $(MODULESRCS:%.c=%.c) $(SHAREDSRCS:%.c=../../common/$(SHAREDMODULE)/%.c)
42 PROG = $(MODULE:%=%.so)
43 OBJS = $(MODULESRCS:%.c=%.o) $(SHAREDSRCS:%.c=%.o)
46 # Set ROOTPROG and ROOTCONF based on the values of MODULE, CLASS, and PLATFORMS
47 # We expect these macros to be defined by the Makefile that is including us.
49 common_ROOTPROG = $(ROOT)/usr/lib/fm/topo/plugins/$(PROG)
50 arch_ROOTPROG = $(ROOT)/usr/platform/lib/fm/topo/plugins/$(PROG)
51 plat_ROOTPROG = $(PLATFORMS:%=$(ROOT)/usr/platform/%/lib/fm/topo/plugins/$(PROG))
52 ROOTPROG = $($(CLASS)_ROOTPROG)
54 common_ROOTCONF = $(ROOT)/usr/lib/fm/topo/plugins/$(CONF)
55 arch_ROOTCONF = $(ROOT)/usr/platform/lib/fm/topo/plugins/$(CONF)
56 plat_ROOTCONF = $(PLATFORMS:%=$(ROOT)/usr/platform/%/lib/fm/topo/plugins/$(CONF))
57 ROOTCONF = $($(CLASS)_ROOTCONF)
59 CERRWARN += -Wno-uninitialized
60 CERRWARN += -Wno-parentheses
62 APIMAP = ../../../libtopo/common/topo_mod.map
63 MAPFILES =              # use APIMAP instead
65 CSTD  = $(CSTD_GNU99)
66 CFLAGS64 += $(CTF_FLAGS) $(CC_PICFLAGS)
67 CFLAGS64 += $(GSHARED) $(XREGSFLAG)
69 CPPFLAGS += -I.
70 CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS
71 LDFLAGS += $(ZIGNORE) -Wl,-M$(APIMAP)
72 LDLIBS += -L$(ROOT)/usr/lib/fm -ltopo -lnvpair -lc
73 DYNFLAGS += -R/usr/lib/fm
75 all: $(PROG)
77 .NO_PARALLEL:
78 .PARALLEL: $(OBJS)
80 $(PROG): $(OBJS) $(APIMAP)
81         $(LINK.c) $(DYNFLAGS) $(OBJS) -o $@ $(LDLIBS)
82         $(CTFMERGE) -L VERSION -o $@ $(OBJS)
83         $(POST_PROCESS_SO)
85 %.o: ../../common/$(MODULE)/%.c
86         $(COMPILE.c) $<
87         $(CTFCONVERT_O)
89 %.o: ../../common/$(SHAREDMODULE)/%.c
90         $(COMPILE.c) $<
91         $(CTFCONVERT_O)
93 %.o: %.c
94         $(COMPILE.c) $<
95         $(CTFCONVERT_O)
97 clean:
98         $(RM) $(OBJS) $(CLEANFILES)
100 clobber: clean
101         $(RM) $(PROG) $(CLOBBERFILES)
103 check:  $(CHECKHDRS)
105 install_h:
107 $(ROOTPROG): $$(@D) $(PROG)
108         $(INS) -m 0555 $(PROG) $@
110 install: $(ROOTPROG)
112 include ../../../Makefile.rootdirs