stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1 | # |
| 2 | # CDDL HEADER START |
| 3 | # |
| 4 | # The contents of this file are subject to the terms of the |
stevel | a660045 | 2006-05-19 18:18:15 -0700 | [diff] [blame] | 5 | # Common Development and Distribution License (the "License"). |
| 6 | # You may not use this file except in compliance with the License. |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 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 | # |
jmcp | 24fe0b3 | 2009-07-29 16:56:03 -0700 | [diff] [blame] | 22 | # Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 23 | # Use is subject to license terms. |
| 24 | # |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 25 | |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 26 | # Suffixes for files that flag a particular check |
| 27 | SUFFIX_LINT = .lint |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 28 | |
| 29 | all := TARGET = all |
| 30 | install := TARGET = install |
| 31 | clean := TARGET = clean |
| 32 | clobber := TARGET = clobber |
| 33 | catalog := TARGET = catalog |
| 34 | check := TARGET = check |
| 35 | cstyle := TARGET = cstyle |
| 36 | hdrchk := TARGET = hdrchk |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 37 | lint := TARGET = lint |
| 38 | |
| 39 | .KEEP_STATE: |
| 40 | |
| 41 | all: ${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 | |
| 52 | ROOTXML= $(ROOTSHLIB)/xml |
| 53 | |
| 54 | # Rule/definitions for DTDs |
| 55 | ROOTXMLDTD= $(ROOTXML)/dtd |
| 56 | ROOTXMLDTDFILES= $(DTDFILES:%=$(ROOTXMLDTD)/%) |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 57 | $(ROOTXMLDTDFILES) := FILEMODE = 0444 |
| 58 | |
| 59 | $(ROOTXMLDTD)/%: % |
| 60 | $(INS.file) |
| 61 | |
| 62 | # Rule/definitions for XSL style sheets |
| 63 | ROOTXMLSTYLE= $(ROOTXML)/style |
| 64 | ROOTXMLSTYLEFILES= $(STYLEFILES:%=$(ROOTXMLSTYLE)/%) |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 65 | $(ROOTXMLSTYLEFILES) := FILEMODE = 0444 |
| 66 | |
| 67 | $(ROOTXMLSTYLE)/%: % |
| 68 | $(INS.file) |
| 69 | |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 70 | # Install recursively |
| 71 | install: 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 |
| 83 | lint: ${SUBDIRS} $(SRCS:%=%$(SUFFIX_LINT)) |
| 84 | |
stevel | a660045 | 2006-05-19 18:18:15 -0700 | [diff] [blame] | 85 | CSTYLE_FLAGS= -Pp |
| 86 | HDRCHK_FLAGS= -a |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 87 | |
stevel | a660045 | 2006-05-19 18:18:15 -0700 | [diff] [blame] | 88 | cstyle: ${SUBDIRS} |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 89 | |
stevel | a660045 | 2006-05-19 18:18:15 -0700 | [diff] [blame] | 90 | hdrchk: ${SUBDIRS} |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 91 | |
stevel | a660045 | 2006-05-19 18:18:15 -0700 | [diff] [blame] | 92 | check: cstyle hdrchk |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 93 | |
| 94 | clobber: ${SUBDIRS} |
| 95 | |
| 96 | clean: ${SUBDIRS} |
Gordon Ross | b6805bf | 2013-08-23 18:31:03 -0400 | [diff] [blame^] | 97 | $(RM) *.o *.ln *.i *.lint $(CLEANFILES) |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 98 | |
| 99 | catalog: $(POFILE) |
| 100 | |
| 101 | ${SUBDIRS}: FRC |
| 102 | @cd $@; pwd; ${MAKE} ${TARGET} |
| 103 | |
| 104 | FRC: |
| 105 | |
| 106 | # Included for message catalog handling |
| 107 | include $(SRC)/Makefile.msg.targ |
| 108 | include $(METASSIST_TOPLEVEL)/../../Makefile.targ |