1 1414 cindi # 2 1414 cindi # CDDL HEADER START 3 1414 cindi # 4 1414 cindi # The contents of this file are subject to the terms of the 5 1414 cindi # Common Development and Distribution License (the "License"). 6 1414 cindi # You may not use this file except in compliance with the License. 7 1414 cindi # 8 1414 cindi # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 1414 cindi # or http://www.opensolaris.org/os/licensing. 10 1414 cindi # See the License for the specific language governing permissions 11 1414 cindi # and limitations under the License. 12 1414 cindi # 13 1414 cindi # When distributing Covered Code, include this CDDL HEADER in each 14 1414 cindi # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 1414 cindi # If applicable, add the following below this CDDL HEADER, with the 16 1414 cindi # fields enclosed by brackets "[]" replaced with your own identifying 17 1414 cindi # information: Portions Copyright [yyyy] [name of copyright owner] 18 1414 cindi # 19 1414 cindi # CDDL HEADER END 20 1414 cindi # 21 1414 cindi # 22 9718 Tarik # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 1414 cindi # Use is subject to license terms. 24 2522 raf # 25 1414 cindi 26 1414 cindi .KEEP_STATE: 27 1414 cindi .SUFFIXES: 28 1414 cindi 29 1414 cindi MODCLASS = plugins 30 1414 cindi 31 1414 cindi include ../../../../Makefile.lib 32 1414 cindi include ../../../../../Makefile.lib 33 1414 cindi 34 1414 cindi # 35 1414 cindi # Set PROG and OBJS based on the values of MODULE and SRCS. We expect that 36 1414 cindi # these macros to be defined by the Makefile that is including this file. 37 1414 cindi # 38 6640 cth # SHAREDSRCS is used to share sources between multiple libtopo modules. 39 6640 cth # 40 6640 cth SRCS = $(MODULESRCS:%.c=%.c) $(SHAREDSRCS:%.c=../../common/$(SHAREDMODULE)/%.c) 41 1414 cindi PROG = $(MODULE:%=%.so) 42 6640 cth OBJS = $(MODULESRCS:%.c=%.o) $(SHAREDSRCS:%.c=%.o) 43 1414 cindi 44 1414 cindi # 45 1414 cindi # Set ROOTPROG and ROOTCONF based on the values of MODULE, CLASS, and PLATFORMS 46 1414 cindi # We expect these macros to be defined by the Makefile that is including us. 47 1414 cindi # 48 1414 cindi common_ROOTPROG = $(ROOT)/usr/lib/fm/topo/plugins/$(PROG) 49 1414 cindi arch_ROOTPROG = $(ROOT)/usr/platform/$(ARCH)/lib/fm/topo/plugins/$(PROG) 50 1414 cindi plat_ROOTPROG = $(PLATFORMS:%=$(ROOT)/usr/platform/%/lib/fm/topo/plugins/$(PROG)) 51 1414 cindi ROOTPROG = $($(CLASS)_ROOTPROG) 52 1414 cindi 53 1414 cindi common_ROOTCONF = $(ROOT)/usr/lib/fm/topo/plugins/$(CONF) 54 1414 cindi arch_ROOTCONF = $(ROOT)/usr/platform/$(ARCH)/lib/fm/topo/plugins/$(CONF) 55 1414 cindi plat_ROOTCONF = $(PLATFORMS:%=$(ROOT)/usr/platform/%/lib/fm/topo/plugins/$(CONF)) 56 1414 cindi ROOTCONF = $($(CLASS)_ROOTCONF) 57 1414 cindi 58 5017 eschrock LINTFLAGS = -msux 59 1414 cindi LINTFILES = $(SRCS:%.c=%.ln) 60 1414 cindi 61 1414 cindi APIMAP = ../../../libtopo/common/topo_mod.map 62 2522 raf MAPFILES = # use APIMAP instead 63 1414 cindi 64 9718 Tarik C99MODE = $(C99_ENABLE) 65 1414 cindi CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) $(CC_PICFLAGS) 66 1414 cindi CFLAGS += -G $(XREGSFLAG) 67 1414 cindi 68 3895 zx143588 CPPFLAGS += -I. 69 1414 cindi CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT 70 1414 cindi LDFLAGS += $(ZIGNORE) -M$(APIMAP) 71 5017 eschrock LDLIBS += -L$(ROOTLIBDIR)/fm -ltopo -lnvpair -lc 72 5017 eschrock DYNFLAGS += -R/usr/lib/fm 73 1414 cindi 74 1414 cindi all: $(PROG) 75 1414 cindi 76 1414 cindi .NO_PARALLEL: 77 1414 cindi .PARALLEL: $(OBJS) $(LINTFILES) 78 1414 cindi 79 1414 cindi $(PROG): $(OBJS) $(APIMAP) 80 1414 cindi $(LINK.c) $(DYNFLAGS) $(OBJS) -o $@ $(LDLIBS) 81 1414 cindi $(CTFMERGE) -L VERSION -o $@ $(OBJS) 82 1414 cindi $(POST_PROCESS_SO) 83 1414 cindi 84 3062 cindi %.o: ../../common/$(MODULE)/%.c 85 1414 cindi $(COMPILE.c) $< 86 1414 cindi $(CTFCONVERT_O) 87 1414 cindi 88 6640 cth %.o: ../../common/$(SHAREDMODULE)/%.c 89 6640 cth $(COMPILE.c) $< 90 6640 cth $(CTFCONVERT_O) 91 6640 cth 92 1414 cindi %.o: %.c 93 1414 cindi $(COMPILE.c) $< 94 1414 cindi $(CTFCONVERT_O) 95 1414 cindi 96 1414 cindi clean: 97 1414 cindi $(RM) $(OBJS) $(LINTFILES) $(CLEANFILES) 98 1414 cindi 99 1414 cindi clobber: clean 100 1414 cindi $(RM) $(PROG) 101 1414 cindi 102 3062 cindi %.ln: ../../common/$(MODULE)/%.c 103 1414 cindi $(LINT.c) -c $< 104 1414 cindi 105 1414 cindi %.ln: %.c 106 1414 cindi $(LINT.c) -c $< 107 1414 cindi 108 1414 cindi lint: $(LINTFILES) 109 1414 cindi $(LINT) $(LINTFLAGS) $(LINTFILES) $(LDLIBS) 110 1414 cindi 111 1414 cindi check: $(CHECKHDRS) 112 1414 cindi 113 1414 cindi install_h: 114 1414 cindi 115 1414 cindi $(ROOTPROG): $$(@D) $(PROG) 116 1414 cindi $(RM) $@; $(INS) -s -m 0555 -f $(@D) $(PROG) 117 1414 cindi 118 1414 cindi install: $(ROOTPROG) 119 1414 cindi 120 1414 cindi include ../../../Makefile.rootdirs 121