Module Name:    src
Committed By:   tsutsui
Date:           Sun Jan 22 16:50:00 UTC 2012

Modified Files:
        src/distrib/common/bootimage: Makefile.bootimage Makefile.installimage
            Makefile.liveimage

Log Message:
Fix checks for RELEASEDIR (and xxxxIMGBASE) variables to perform it
only on live_image or install_image targets.  PR toolchain/45864


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/common/bootimage/Makefile.bootimage \
    src/distrib/common/bootimage/Makefile.installimage \
    src/distrib/common/bootimage/Makefile.liveimage

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.1 src/distrib/common/bootimage/Makefile.bootimage:1.2
--- src/distrib/common/bootimage/Makefile.bootimage:1.1	Sun Jan 22 03:53:30 2012
+++ src/distrib/common/bootimage/Makefile.bootimage	Sun Jan 22 16:50:00 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
+#	$NetBSD: Makefile.bootimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -123,11 +123,6 @@
 	@echo "Error: IMGBASE is not set"
 	@false
 .endif
-.if empty(RELEASEDIR)
-.BEGIN:
-	@echo "Error: RELEASEDIR is not set"
-	@false
-.endif
 
 # should be defined elsewhere? 
 CAT?=		cat
Index: src/distrib/common/bootimage/Makefile.installimage
diff -u src/distrib/common/bootimage/Makefile.installimage:1.1 src/distrib/common/bootimage/Makefile.installimage:1.2
--- src/distrib/common/bootimage/Makefile.installimage:1.1	Sun Jan 22 03:53:30 2012
+++ src/distrib/common/bootimage/Makefile.installimage	Sun Jan 22 16:50:00 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.installimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
+#	$NetBSD: Makefile.installimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
 #
 # Common Makefile to create a bootable installation image for USB flash etc.
 #
@@ -11,15 +11,14 @@
 # See Makefile.bootimage for other variables.
 #
 
-.if empty(INSTIMGBASE)
-.BEGIN:
+.if !target(check_INSTIMGBASE)
+check_INSTIMGBASE: .PHONY .NOTMAIN
+.if !defined(INSTIMGBASE)
 	@echo "Error: INSTIMGBASE is not set"
 	@false
+.else
+	@true
 .endif
-.if empty(RELEASEDIR)
-.BEGIN:
-	@echo "Error: RELEASEDIR is not set"
-	@false
 .endif
 
 SWAPMB=		0			# no swap
@@ -54,7 +53,7 @@ INSTIMG_RELEASEDIR?=	${RELEASEMACHINEDIR
 # should be defined elsewhere? 
 MKDIR?=		mkdir -p
 
-install_image: ${IMGBASE}.img.gz
+install_image: check_INSTIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
 	${MKDIR} ${INSTIMG_RELEASEDIR}
 	${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR}
 	# note ${MAKESUM} will be calculated in src/etc/Makefile
Index: src/distrib/common/bootimage/Makefile.liveimage
diff -u src/distrib/common/bootimage/Makefile.liveimage:1.1 src/distrib/common/bootimage/Makefile.liveimage:1.2
--- src/distrib/common/bootimage/Makefile.liveimage:1.1	Sun Jan 22 03:53:30 2012
+++ src/distrib/common/bootimage/Makefile.liveimage	Sun Jan 22 16:50:00 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.liveimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
+#	$NetBSD: Makefile.liveimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
 #
 # Common Makefile to create a bootable FS image for USB flash or emulators
 #
@@ -11,15 +11,14 @@
 # See Makefile.bootimage for other variables.
 #
 
-.if empty(LIVEIMGBASE)
-.BEGIN:
+.if !target(check_LIVEIMGBASE)
+check_LIVEIMGBASE: .PHONY .NOTMAIN
+.if !defined(LIVEIMGBASE)
 	@echo "Error: LIVEIMGBASE is not set"
 	@false
+.else
+	@true
 .endif
-.if empty(RELEASEDIR)
-.BEGIN:
-	@echo "Error: RELEASEDIR is not set"
-	@false
 .endif
 
 IMGBASE=	${LIVEIMGBASE}
@@ -34,7 +33,7 @@ LIVEIMG_RELEASEDIR?=	${RELEASEMACHINEDIR
 # should be defined elsewhere? 
 MKDIR?=		mkdir -p
 
-live_image: ${IMGBASE}.img.gz
+live_image: check_LIVEIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
 	${MKDIR} ${LIVEIMG_RELEASEDIR}
 	${RELEASE_INSTALL} ${IMGBASE}.img.gz ${LIVEIMG_RELEASEDIR}
 	# note ${MAKESUM} will be calculated in src/etc/Makefile

Reply via email to