comparison usr/src/cmd/lvm/util/Makefile.com @ 0:c9caec207d52 b86

Initial porting based on b86
author Koji Uno <koji.uno@sun.com>
date Tue, 02 Jun 2009 18:56:50 +0900
parents
children 1a15d5aaf794
comparison
equal deleted inserted replaced
-1:000000000000 0:c9caec207d52
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, Version 1.0 only
6 # (the "License"). You may not use this file except in compliance
7 # with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22 #
23 # Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 #
26 # ident "@(#)Makefile.com 1.9 05/06/08 SMI"
27 #
28 # Architecture independent makefile for svm utilities
29 #
30 # cmd/lvm/util/Makefile.com
31 #
32
33 # programs that are installed in /usr/sbin
34 PROG= \
35 medstat \
36 metaclear \
37 metadetach \
38 metahs \
39 metaoffline \
40 metaonline \
41 metaparam \
42 metarename \
43 metareplace \
44 metaroot \
45 metaset \
46 metasync \
47 metattach \
48 metaimport
49
50 # programs that are installed in /sbin, with links from /usr/sbin
51 ROOTFS_PROG = \
52 metadb \
53 metadevadm \
54 metainit \
55 metarecover \
56 metastat
57
58 # programs that are installed in /usr/lib/lvm
59 METACLUST= metaclust
60
61 OBJECTS = \
62 medstat.o \
63 metaclear.o \
64 metadb.o \
65 metadetach.o \
66 metadevadm.o \
67 metahs.o \
68 metainit.o \
69 metaoffline.o \
70 metaonline.o \
71 metaparam.o \
72 metarecover.o \
73 metarename.o \
74 metareplace.o \
75 metaroot.o \
76 metaset.o \
77 metastat.o \
78 metasync.o \
79 metattach.o \
80 metaclust.o \
81 metaimport.o
82
83 SRCS= $(OBJECTS:%.o=../%.c)
84
85 include ../../../Makefile.cmd
86 include ../../Makefile.lvm
87
88 ROOTLIBSVM = $(ROOTLIB)/lvm
89
90 CLOBBERFILES += $(ROOTFS_PROG)
91
92 ROOTUSRSBINPROG = $(PROG:%=$(ROOTUSRSBIN)/%)
93
94 ROOTSBINPROG = $(ROOTFS_PROG:%=$(ROOTSBIN)/%)
95
96 ROOTUSRSBINLINKS = $(ROOTFS_PROG:%=$(ROOTUSRSBIN)/%)
97
98 POFILE= utilp.po
99 DEFINES += -DDEBUG
100 CPPFLAGS += $(DEFINES)
101
102 metainit := CPPFLAGS += -I$(SRC)/lib/lvm/libmeta/common/hdrs
103 metaset := LDFLAGS += -ldevid
104
105 LDLIBS += -lmeta
106
107 lint := LINTFLAGS += -m
108
109 install := TARGET = install
110 clean := TARGET = clean
111
112 .KEEP_STATE:
113
114 %.o: ../%.c
115 $(COMPILE.c) $<
116 $(POST_PROCESS_O)
117
118 all: $(PROG) $(METACLUST) $(ROOTFS_PROG)
119
120 catalog: $(POFILE)
121
122 $(PROG) $(ROOTFS_PROG): $$(@).o
123 $(LINK.c) -o $@ $(@).o $(LDLIBS)
124 $(POST_PROCESS)
125
126 $(METACLUST): $$(@).o
127 $(LINK.c) -o $@ $(@).o $(LDLIBS)
128 $(POST_PROCESS)
129
130
131 install: all .WAIT $(ROOTLIBSVM) $(ROOTUSRSBINPROG) $(ROOTSBINPROG) $(ROOTUSRSBINLINKS) $(ROOTLIBSVM)/$(METACLUST)
132
133 $(ROOTUSRSBINLINKS):
134 -$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
135
136 cstyle:
137 $(CSTYLE) $(SRCS)
138
139 lint:
140 for f in $(SRCS) ; do \
141 if [ $$f = "../metainit.c" ]; then \
142 $(LINT.c) $(LINTFLAGS) \
143 -I$(SRC)/lib/lvm/libmeta/common/hdrs $$f ; \
144 else \
145 $(LINT.c) $(LINTFLAGS) $$f ; \
146 fi \
147 done
148
149 clean:
150 $(RM) $(OBJECTS) $(PROG)
151
152 include ../../../Makefile.targ
153
154 ${ROOTLIBSVM}/%: %
155 ${INS.file}
156
157 ${ROOTLIBSVM}:
158 ${INS.dir}
159