Home | History | Annotate | Download | only in src
      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 # Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
     22 # Use is subject to license terms.
     23 #
     24 #ident	"@(#)Makefile.targ	1.4	10/01/08 SMI"
     25 #
     26 # Makefile.targ, global build target definitions
     27 #
     28 
     29 SOURCE_ARCHIVE += $(TARBALL)
     30 
     31 # for $(VER)
     32 PATCH_STAMPS =		$(PATCHES:Patches/%=$(VER)/$(SFW_STAMP_PATCHES).%)
     33 PATCH_STAMPS +=		$(PATCHES_32:Patches/%=$(VER)/$(SFW_STAMP_PATCHES).%)
     34 # for $(VER)-32
     35 PATCH_STAMPS_32 =	$(PATCHES:Patches/%=$(VER)-32/$(SFW_STAMP_PATCHES).%)
     36 PATCH_STAMPS_32 +=	$(PATCHES_32:Patches/%=$(VER)-32/$(SFW_STAMP_PATCHES).%)
     37 # for $(VER)-64
     38 PATCH_STAMPS_64 =	$(PATCHES:Patches/%=$(VER)-64/$(SFW_STAMP_PATCHES).%)
     39 PATCH_STAMPS_64 +=	$(PATCHES_64:Patches/%=$(VER)-64/$(SFW_STAMP_PATCHES).%)
     40 
     41 $(VER)/$(SFW_STAMP_PATCHED):	$(VER)/$(SFW_STAMP_UNPACKED) $(PATCH_STAMPS)
     42 	$(TOUCH) $@
     43 
     44 $(VER)/$(SFW_STAMP_PATCHES).%:	Patches/%
     45 	(cd $(@D) ; $(GPATCH) $(GPATCH_FLAGS) < ../$<)
     46 	$(TOUCH) $@
     47 
     48 $(VER)/$(SFW_STAMP_UNPACKED):	$(SOURCE_ARCHIVE) $(PATCHES) $(PATCHES_32)
     49 	-$(RM) -r $(VER)
     50 	$(UNPACKARCHIVE) $(SOURCE_ARCHIVE) $(VER)
     51 	$(TOUCH) $@
     52 
     53 $(VER)-32/$(SFW_STAMP_PATCHED):	$(VER)-32/$(SFW_STAMP_UNPACKED) $(PATCH_STAMPS_32)
     54 	$(TOUCH) $@
     55 
     56 $(VER)-32/$(SFW_STAMP_PATCHES).%:	Patches/%
     57 	(cd $(@D); $(GPATCH) $(GPATCH_FLAGS) < ../$<)
     58 	$(TOUCH) $@
     59 
     60 $(VER)-64/$(SFW_STAMP_PATCHED):	$(VER)-64/$(SFW_STAMP_UNPACKED) $(PATCH_STAMPS_64)
     61 	$(TOUCH) $@
     62 
     63 $(VER)-64/$(SFW_STAMP_PATCHES).%:	Patches/%
     64 	(cd $(@D); $(GPATCH) $(GPATCH_FLAGS) < ../$<)
     65 	$(TOUCH) $@
     66 
     67 # for $(VER)-{32|64}
     68 $(VER)-%/$(SFW_STAMP_UNPACKED):	$(SOURCE_ARCHIVE) $(PATCHES) $(PATCHES_%)
     69 	-$(RM) -r tmp $(@D)
     70 	$(MKDIR) -p tmp; (cd tmp; $(UNPACKARCHIVE) ../$(SOURCE_ARCHIVE) $(VER))
     71 	$(MV) tmp/$(VER) $(@D); $(RMDIR) tmp
     72 	$(TOUCH) $@
     73 
     74 # This can't go in Makefile.master because PACKAGES is needed before it
     75 PROTOFIX = $(SRC)/tools/protofix $(PACKAGES:%=--pkg %)
     76 
     77 SOURCE_ARCHIVES += $(SOURCE_ARCHIVE)
     78 
     79 # $(SOURCE_ARCHIVES):
     80 # 	@echo "Retrieving $(@F)..."
     81 # 	@$(TOUCH) $@
     82 # 
     83 # download:	$(SOURCE_ARCHIVES)
     84 
     85 # Uses :: syntax so that including Makefiles can augment this target.
     86 meta-check::
     87 	@$(METACHECK)
     88 
     89 component-hook:
     90 	@$(COMPONENT_HOOK)
     91 
     92 
     93 # Rule to validate a component's METADATA file.  It should fire each time a
     94 # component builds.
     95 $(COMPONENT_ARCHIVE:sh):	FRC.targ
     96 	$(METACHECK)
     97 FRC.targ:
     98