usr/src/cmd/quagga/Makefile.sfw
branchoi_151a
changeset 228 dc60997879d6
parent 9 502b128296a2
--- a/usr/src/cmd/quagga/Makefile.sfw	Tue Jun 18 19:16:48 2013 +0100
+++ b/usr/src/cmd/quagga/Makefile.sfw	Tue Jun 18 19:17:37 2013 +0100
@@ -18,25 +18,23 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
 #
-#pragma ident	"@(#)Makefile.sfw	1.10	10/02/19 SMI"
+#pragma ident	"@(#)Makefile.sfw	1.11	11/03/16 SMI"
 
 NAME=quagga
 VERSION=0.99.8
 SOURCE=$(NAME)-$(VERSION).tar.gz
 SRCDIR=$(NAME)-$(VERSION)
 BUILDDIR=$(NAME)-$(MACH)-build
-VER=$(SRCDIR)
 
-PATCHES:sh= cat ./PATCHES.sfw | grep -v '^\#' | grep -v '^$' | sed 's/\(.*\)/patches\/\1\.applied/'
+PATCHES:sh= cat ./PATCHES.sfw | grep -v '^\#' | grep -v '^$' | sed 's/\(.*\)/$(SRCDIR)\/\1\.applied/'
 
 LD_OPTIONS=-L${ROOT}/usr/lib -L/usr/sfw/lib -L/usr/lib  -R/usr/sfw/lib:/usr/lib
 
-.PARALLEL: .compile
+.PARALLEL: $(BUILDDIR)/.compile
 
-all: runconfig .compile
+all: runconfig $(BUILDDIR)/.compile
 	@find . -name core -exec rm -f {} \;
 
 include ../Makefile.cmd
@@ -102,7 +100,7 @@
 	    --enable-ospf6d --enable-ripngd \
 	    --enable-user=root --enable-group=root)
 
-.compile:
+$(BUILDDIR)/.compile:
 	(cd $(BUILDDIR); $(GMAKE) \
 	    LD_OPTIONS="$(LD_OPTIONS)" \
 	    CC=$(CC) \
@@ -112,32 +110,36 @@
 	    PATH=$(SFW_PATH) \
 	    MAKE=$(GMAKE) \
 	    INSTALL="$(INSTALL) -c" )
-	touch .compile
+	touch $(BUILDDIR)/.compile
 
 packages: install .WAIT
 	(cd $(BUILDDIR)/solaris; $(GMAKE) MAKE="$(GMAKE)" DESTDIR=$(ROOT) packages)
 
 runconfig: $(BUILDDIR)/config.status
 
-.untar: $(SOURCE) 
+untar: $(SRCDIR)/.untar
+
+$(SRCDIR)/.untar: $(SOURCE) 
 	gzip -dc $(SOURCE) | tar xopf -
-	touch .untar
+	touch $(SRCDIR)/.untar
 
-.patch: $(PATCHES)
-	touch .patch
+patch: $(SRCDIR)/.patch
+
+$(SRCDIR)/.patch: $(SRCDIR)/.untar $(PATCHES)
+	touch $(SRCDIR)/.patch
 
 $(BUILDDIR):
 	mkdir $(BUILDDIR)
 
-.prep: .untar .patch $(BUILDDIR)
+.prep: $(SRCDIR)/.untar $(SRCDIR)/.patch $(BUILDDIR)
 	touch .prep
 
 prep: .prep
 
 clean:
-	-$(RM) -r $(SRCDIR) $(BUILDDIR) patches/*.applied .untar .patch .prep .compile
+	-$(RM) -f -r $(SRCDIR) .prep $(BUILDDIR)
 
-%.patch.applied: %.patch
+$(SRCDIR)/%.patch.applied: patches/%.patch
 	(cd $(SRCDIR); gpatch -p0 < ../$< && cp ../$< ../$@ && touch ../$@)
 
 include ../Makefile.targ