New Makefile
  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/CDDL.txt
  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/CDDL.txt.
 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 #
 23 #ident  "%Z%%M% %I%     %E% SMI"
 24 #
 25 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 26 # Use is subject to license terms.
 27 #
 28 # pkgdefs/Makefile
 29 
 30 include Makefile.com
 31 
 32 sparc_NONSHIP_SUBDIRS =
 33 i386_NONSHIP_SUBDIRS =
 34 
 35 I18N_SUBDIRS = \
 36         SUNW0scds
 37 
 38 NONSHIP_SUBDIRS = \
 39         $($(MACH)_NONSHIP_SUBDIRS)
 40 
 41 PRODUCT_SUBDIRS = \
 42         SUNWscdns \
 43         SUNWscnfs \
 44         SUNWschtt \
 45         SUNWscapc \
 46         SUNWscsap \
 47         SUNWsclc \
 48         SUNWscwls \
 49         SUNWscs1as \
 50         SUNWscs1mq \
 51         SUNWscsapdb \
 52         SUNWschadb \
 53         SUNWscsapenq \
 54         SUNWscsaprepl \
 55         SUNWscsapwebas \
 56         SUNWscsapscs \
 57         SUNWscsge \
 58         SUNWscPostgreSQL \
 59         SUNWsc9ias \
 60         SUNWscdhc \
 61         SUNWscids \
 62         SUNWscmqs \
 63         SUNWscmys \
 64         SUNWsctomcat \
 65         SUNWscsps \
 66         SUNWscmqi \
 67         SUNWscsmb \
 68         SUNWscsaa \
 69         SUNWscsag \
 70         SUNWscxvm
 71 
 72 $(CLOSED_BUILD)PRODUCT_SUBDIRS += \
 73         SUNWscor \
 74         SUNWscsyb
 75 
 76 s9_PRODUCT_SUBDIRS += \
 77         SUNWscpax
 78 
 79 $(S9_BUILD)PRODUCT_SUBDIRS += $(s9_PRODUCT_SUBDIRS)
 80 
 81 post_s9_PRODUCT_SUBDIRS += \
 82         SUNWsckrb5 \
 83         SUNWsczone
 84 
 85 $(POST_S9_BUILD)PRODUCT_SUBDIRS += $(post_s9_PRODUCT_SUBDIRS)
 86 
 87 sparc_PRODUCT_SUBDIRS += \
 88         SUNWscebs \
 89         SUNWscsbl
 90 
 91 PRODUCT_SUBDIRS += $($(MACH)_PRODUCT_SUBDIRS)
 92 
 93 SUBDIRS= \
 94         $(PRODUCT_SUBDIRS) \
 95         $(NONSHIP_SUBDIRS) \
 96         $(I18N_SUBDIRS)
 97 
 98 # Targetdirs needs to process all package subdirs, as we build all the code,
 99 # even if the agent isn't supported/packaged on a particular platform
100 $(POST_S9_BUILD)ALLPKG_SUBDIRS += $(s9_PRODUCT_SUBDIRS)
101 $(S9_BUILD)ALLPKG_SUBDIRS += $(post_s9_PRODUCT_SUBDIRS)
102 i386_ALLPKG_SUBDIRS += $(sparc_PRODUCT_SUBDIRS)
103 sparc_ALLPKG_SUBDIRS += $(i386_PRODUCT_SUBDIRS)
104 ALLPKG_SUBDIRS += $(SUBDIRS) $($(MACH)_ALLPKG_SUBDIRS)
105 
106 # Support for S11 is unknown at this time, so include all agents
107 $(S11_BUILD)SUBDIRS += $(s9_PRODUCT_SUBDIRS) $($(MACH)_ALLPKG_SUBDIRS)
108 
109 sparc_XMODS=
110 
111 # L10N support dropped from 3.2 due to resource constraints
112 # L10N support is included in open source builds
113 $(CLOSED_BUILD)$(S11_BUILD)L10N_XMODS= l10n
114 
115 $(CLOSED_BUILD)DVDIMAGES_XMODS= \
116         dvdimages
117 
118 XMODS=  $($(MACH)_XMODS) $(L10N_XMODS) $(DVDIMAGES_XMODS)
119 
120 DOT_FILES= dot.clustertoc dot.order
121 
122 all :=                  TARGET= all
123 install :=              TARGET= install
124 clean :=                TARGET= clean
125 clobber :=              TARGET= clobber
126 _msg :=                 TARGET= _msg
127 patch_build :=          TARGET= patch_build
128 
129 .KEEP_STATE:
130 
131 .PARALLEL: $(SUBDIRS) $(XMODS)
132 
133 install: awk_pkginfo $(SUBDIRS) $(XMODS)
134 
135 _msg: ./parse_i18n_proto $(I18N_SUBDIRS)
136 
137 all: awk_pkginfo $(SUBDIRS) $(XMODS) $(DOT_FILES)
138 
139 clean clobber: $(SUBDIRS) $(XMODS)
140         $(RM) awk_pkginfo Targetdirs $(DOT_FILES)
141 
142 patch_build: awk_pkginfo $(PRODUCT_SUBDIRS) patch_manpages
143 
144 $(SUBDIRS): FRC
145         @cd $@; pwd; $(MAKE) $(TARGET)
146 
147 $(XMODS):       FRC
148         @if [ -f $@/Makefile  ]; then \
149                 cd $@; pwd; $(MAKE) $(TARGET); \
150         else \
151                 true; \
152         fi
153 
154 DOT_CLUSTERTOC_SRC = dot.clustertoc.sun_cluster_agents.$(NATIVE_MACH)
155 $(S9_BUILD)DOT_CLUSTERTOC_SRC = dot.clustertoc.sun_cluster_agents.$(NATIVE_MACH).Sol_9
156 
157 DOT_ORDER_SRC= dot.order.sun_cluster_agents.$(NATIVE_MACH)
158 $(S9_BUILD)DOT_ORDER_SRC= dot.order.sun_cluster_agents.$(NATIVE_MACH).Sol_9
159 
160 dot.clustertoc: $(DOT_CLUSTERTOC_SRC)
161         $(RM) $@
162         cp $(DOT_CLUSTERTOC_SRC) $@
163 
164 dot.order: $(DOT_ORDER_SRC)
165         $(RM) $@
166         cp $(DOT_ORDER_SRC) $@
167 
168 $(NOT_RELEASE_BUILD)AWK_PKGINFO_DFLAG= -d
169 
170 awk_pkginfo: ./bld_awk_pkginfo
171         ./bld_awk_pkginfo -m $(MACH) -p "$(RELEASE)/$(VERSION)" ${AWK_PKGINFO_DFLAG} -o $@
172 
173 # Copy the package contents to the proto area
174 patch_manpages: $(DOCS_DELIVERY)
175         for pkg in SUNWscdsman; \
176         do \
177                 basedir=`$(EGREP) '^BASEDIR=' $(DOCS_DELIVERY)/$$pkg/pkginfo | $(SED) -e 's:.*=::'`; \
178                 [ -d $(VROOT)$$basedir ] || /bin/mkdir -p $(VROOT)$$basedir; \
179                 (cd $(DOCS_DELIVERY)/$$pkg/reloc && /bin/tar cf - .) | (cd $(VROOT)$$basedir && /bin/tar xf -); \
180         done
181 
182 ALL_PROTOTYPES =        $(ALLPKG_SUBDIRS:%=%/pkginfo.tmpl %/prototype_com) \
183                         $(ALLPKG_SUBDIRS:%=%/pkginfo.tmpl %/prototype_$(MACH))
184 
185 makefiles:      Targetdirs parse_i18n_proto
186 
187 # generate Targetdirs and use that to create all the proto directories
188 Targetdirs:     ./pkgdefs_to_targetdirs $(ALL_PROTOTYPES)
189                 ./pkgdefs_to_targetdirs $(ALL_PROTOTYPES) > Targetdirs
190 
191 FRC: