blob: 2d2744146b6f0e0e66b5b01c1d35be410277f299 [file] [log] [blame]
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -07001#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
stevela6600452006-05-19 18:18:15 -07005# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -07007#
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#
jmcp24fe0b32009-07-29 16:56:03 -070022# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070023# Use is subject to license terms.
24#
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070025
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070026# Suffixes for files that flag a particular check
27SUFFIX_LINT = .lint
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070028
29all := TARGET = all
30install := TARGET = install
31clean := TARGET = clean
32clobber := TARGET = clobber
33catalog := TARGET = catalog
34check := TARGET = check
35cstyle := TARGET = cstyle
36hdrchk := TARGET = hdrchk
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070037lint := 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)/%)
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070057$(ROOTXMLDTDFILES) := FILEMODE = 0444
58
59$(ROOTXMLDTD)/%: %
60 $(INS.file)
61
62# Rule/definitions for XSL style sheets
63ROOTXMLSTYLE= $(ROOTXML)/style
64ROOTXMLSTYLEFILES= $(STYLEFILES:%=$(ROOTXMLSTYLE)/%)
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070065$(ROOTXMLSTYLEFILES) := FILEMODE = 0444
66
67$(ROOTXMLSTYLE)/%: %
68 $(INS.file)
69
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070070# 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
stevela6600452006-05-19 18:18:15 -070085CSTYLE_FLAGS= -Pp
86HDRCHK_FLAGS= -a
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070087
stevela6600452006-05-19 18:18:15 -070088cstyle: ${SUBDIRS}
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070089
stevela6600452006-05-19 18:18:15 -070090hdrchk: ${SUBDIRS}
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070091
stevela6600452006-05-19 18:18:15 -070092check: cstyle hdrchk
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070093
94clobber: ${SUBDIRS}
95
96clean: ${SUBDIRS}
Gordon Rossb6805bf2013-08-23 18:31:03 -040097 $(RM) *.o *.ln *.i *.lint $(CLEANFILES)
stevel@tonic-gate7c478bd2005-06-14 00:00:00 -070098
99catalog: $(POFILE)
100
101${SUBDIRS}: FRC
102 @cd $@; pwd; ${MAKE} ${TARGET}
103
104FRC:
105
106# Included for message catalog handling
107include $(SRC)/Makefile.msg.targ
108include $(METASSIST_TOPLEVEL)/../../Makefile.targ