xref: /titanic_41/usr/src/cmd/lvm/util/Makefile.com (revision dd49f125507979bb2ab505a8daf2a46d1be27051)
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	"%Z%%M%	%I%	%E% 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
34PROG= \
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
51ROOTFS_PROG = \
52	metadb \
53	metadevadm \
54	metainit \
55	metarecover \
56	metastat
57
58# programs that are installed in /usr/lib/lvm
59METACLUST= metaclust
60
61OBJECTS =  \
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
83SRCS=	$(OBJECTS:%.o=../%.c)
84
85include ../../../Makefile.cmd
86include ../../Makefile.lvm
87
88ROOTLIBSVM = $(ROOTLIB)/lvm
89
90CLOBBERFILES += $(ROOTFS_PROG)
91
92ROOTUSRSBINPROG = $(PROG:%=$(ROOTUSRSBIN)/%)
93
94ROOTSBINPROG = $(ROOTFS_PROG:%=$(ROOTSBIN)/%)
95
96ROOTUSRSBINLINKS = $(ROOTFS_PROG:%=$(ROOTUSRSBIN)/%)
97
98POFILE= utilp.po
99DEFINES += -DDEBUG
100CPPFLAGS += $(DEFINES)
101
102metainit := CPPFLAGS += -I$(SRC)/lib/lvm/libmeta/common/hdrs
103metaset := LDFLAGS += -ldevid
104
105LDLIBS +=	-lmeta
106
107lint := LINTFLAGS += -m
108
109install		:= TARGET = install
110clean		:= TARGET = clean
111
112.KEEP_STATE:
113
114%.o:	../%.c
115	$(COMPILE.c) $<
116	$(POST_PROCESS_O)
117
118all:     $(PROG) $(METACLUST) $(ROOTFS_PROG)
119
120catalog: $(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
131install: all .WAIT $(ROOTLIBSVM) $(ROOTUSRSBINPROG) $(ROOTSBINPROG) $(ROOTUSRSBINLINKS) $(ROOTLIBSVM)/$(METACLUST)
132
133$(ROOTUSRSBINLINKS):
134	-$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
135
136cstyle:
137	$(CSTYLE) $(SRCS)
138
139lint:
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
149clean:
150	$(RM) $(OBJECTS) $(PROG)
151
152include ../../../Makefile.targ
153
154${ROOTLIBSVM}/%: %
155	${INS.file}
156
157${ROOTLIBSVM}:
158	${INS.dir}
159
160