xref: /titanic_41/usr/src/cmd/lvm/metassist/Makefile.targ (revision 989f28072d20c73ae0955d6a1e3e2fc74831cb39)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26# Suffixes for files that flag a particular check
27SUFFIX_LINT = .lint
28
29all       := TARGET = all
30install   := TARGET = install
31clean     := TARGET = clean
32clobber   := TARGET = clobber
33catalog   := TARGET = catalog
34check     := TARGET = check
35cstyle    := TARGET = cstyle
36hdrchk    := TARGET = hdrchk
37lint      := TARGET = lint
38
39.KEEP_STATE:
40
41all: ${SUBDIRS} ${OBJS} .WAIT ${PROG}
42
43# Create the binary
44$(PROG): $(OBJS) $(SUBOBJS)
45	$(LINK.c) $(OBJS) $(SUBOBJS) -o $@ $(LDLIBS)
46	$(POST_PROCESS)
47
48# Make objects in subdirectories
49$(SUBOBJS) $(POFILES):
50	@cd $(@D); ${MAKE} $(@F)
51
52ROOTXML=	$(ROOTSHLIB)/xml
53
54# Rule/definitions for DTDs
55ROOTXMLDTD=	$(ROOTXML)/dtd
56ROOTXMLDTDFILES=	$(DTDFILES:%=$(ROOTXMLDTD)/%)
57$(ROOTXMLDTDFILES) :=	FILEMODE = 0444
58
59$(ROOTXMLDTD)/%: %
60	$(INS.file)
61
62# Rule/definitions for XSL style sheets
63ROOTXMLSTYLE=	$(ROOTXML)/style
64ROOTXMLSTYLEFILES=	$(STYLEFILES:%=$(ROOTXMLSTYLE)/%)
65$(ROOTXMLSTYLEFILES) :=	FILEMODE = 0444
66
67$(ROOTXMLSTYLE)/%: %
68	$(INS.file)
69
70# Install recursively
71install: all .WAIT \
72	${SUBDIRS} \
73	$(ROOTUSRSBINPROG) \
74	$(ROOTETCDEFAULTFILES) \
75	$(ROOTXMLDTDFILES) \
76	$(ROOTXMLSTYLEFILES)
77
78# Pattern-matching rule for lint
79%$(SUFFIX_LINT): %
80	${LINT.c} -I. ${INCLUDES} -y -c $< && touch $@
81
82# Run lint on all source files
83lint: ${SUBDIRS} $(SRCS:%=%$(SUFFIX_LINT))
84
85CSTYLE_FLAGS=	-Pp
86HDRCHK_FLAGS=	-a
87
88cstyle: ${SUBDIRS}
89
90hdrchk: ${SUBDIRS}
91
92check: cstyle hdrchk
93
94clobber: ${SUBDIRS}
95
96clean: ${SUBDIRS}
97	-${RM} *.o *.ln *.i *~ core a.out $(CLEANFILES) \
98		*$(SUFFIX_LINT)
99
100catalog: $(POFILE)
101
102${SUBDIRS}: FRC
103	@cd $@; pwd; ${MAKE} ${TARGET}
104
105FRC:
106
107# Included for message catalog handling
108include $(SRC)/Makefile.msg.targ
109include $(METASSIST_TOPLEVEL)/../../Makefile.targ
110