- disable annoying warning when make goes through its first pass and
authorMark Huang <mlhuang@cs.princeton.edu>
Mon, 12 Apr 2004 19:56:02 +0000 (19:56 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Mon, 12 Apr 2004 19:56:02 +0000 (19:56 +0000)
  SPECS/package.spec.in doesn't exist yet
- add per-package "clean" target: "make <name>-clean" or "make
  package=<name> clean"

Makerules
Rules.mk

index 85f978c..5c3ceb6 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -32,7 +32,7 @@
 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
-# $Id: Makerules,v 1.4 2004/04/09 19:06:27 mlh-pl_rpm Exp $
+# $Id: Makerules,v 1.5 2004/04/09 19:37:19 alk-pl_rpm Exp $
 #
 
 # Base cvsps and rpmbuild in the current directory
@@ -163,7 +163,7 @@ endif
 # Build
 #
 
-NVR := $(shell rpmquery $(RPMFLAGS) $(if $(DATE),--define "date $(DATE)") --specfile SPECS/$(notdir $(SPEC)).in | head -1)
+NVR := $(shell rpmquery $(RPMFLAGS) $(if $(DATE),--define "date $(DATE)") --specfile SPECS/$(notdir $(SPEC)).in 2>/dev/null | head -1)
 ARCH := $(shell rpm $(RPMFLAGS) --showrc | sed -ne 's/^build arch[      ]*:[    ]*\(.*\)/\1/p')
 
 all: RPMS/$(ARCH)/$(NVR).$(ARCH).rpm SRPMS/$(NVR).src.rpm
@@ -182,4 +182,14 @@ SRPMS/$(NVR).src.rpm: SPECS/$(notdir $(SPEC)) $(SOURCES) .rpmmacros
 .rpmmacros:
        echo "%_topdir $(HOME)" > $@
 
-.PHONY: all
+# Remove files generated by this package
+clean:
+       rm -rf \
+       BUILD/$(Base0) \
+       RPMS/$(ARCH)/$(NVR).$(ARCH).rpm \
+       SOURCES/$(Base0)* SOURCES/$(package)* \
+       SPECS/$(notdir $(SPEC)).in SPECS/$(notdir $(SPEC)) $(MK) \
+       SRPMS/$(NVR).src.rpm \
+       .cvsps/$(subst /,#,$(CVSROOT)/$(MODULE))
+
+.PHONY: all clean
index 85f978c..5c3ceb6 100644 (file)
--- a/Rules.mk
+++ b/Rules.mk
@@ -32,7 +32,7 @@
 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
-# $Id: Makerules,v 1.4 2004/04/09 19:06:27 mlh-pl_rpm Exp $
+# $Id: Makerules,v 1.5 2004/04/09 19:37:19 alk-pl_rpm Exp $
 #
 
 # Base cvsps and rpmbuild in the current directory
@@ -163,7 +163,7 @@ endif
 # Build
 #
 
-NVR := $(shell rpmquery $(RPMFLAGS) $(if $(DATE),--define "date $(DATE)") --specfile SPECS/$(notdir $(SPEC)).in | head -1)
+NVR := $(shell rpmquery $(RPMFLAGS) $(if $(DATE),--define "date $(DATE)") --specfile SPECS/$(notdir $(SPEC)).in 2>/dev/null | head -1)
 ARCH := $(shell rpm $(RPMFLAGS) --showrc | sed -ne 's/^build arch[      ]*:[    ]*\(.*\)/\1/p')
 
 all: RPMS/$(ARCH)/$(NVR).$(ARCH).rpm SRPMS/$(NVR).src.rpm
@@ -182,4 +182,14 @@ SRPMS/$(NVR).src.rpm: SPECS/$(notdir $(SPEC)) $(SOURCES) .rpmmacros
 .rpmmacros:
        echo "%_topdir $(HOME)" > $@
 
-.PHONY: all
+# Remove files generated by this package
+clean:
+       rm -rf \
+       BUILD/$(Base0) \
+       RPMS/$(ARCH)/$(NVR).$(ARCH).rpm \
+       SOURCES/$(Base0)* SOURCES/$(package)* \
+       SPECS/$(notdir $(SPEC)).in SPECS/$(notdir $(SPEC)) $(MK) \
+       SRPMS/$(NVR).src.rpm \
+       .cvsps/$(subst /,#,$(CVSROOT)/$(MODULE))
+
+.PHONY: all clean