Sun Jan 22 16:50:00 2012 UTC ()
Fix checks for RELEASEDIR (and xxxxIMGBASE) variables to perform it
only on live_image or install_image targets. PR toolchain/45864
(tsutsui)
diff -r1.1 -r1.2 src/distrib/common/bootimage/Makefile.bootimage
diff -r1.1 -r1.2 src/distrib/common/bootimage/Makefile.installimage
diff -r1.1 -r1.2 src/distrib/common/bootimage/Makefile.liveimage
--- src/distrib/common/bootimage/Makefile.bootimage 2012/01/22 03:53:30 1.1
+++ src/distrib/common/bootimage/Makefile.bootimage 2012/01/22 16:50:00 1.2
@@ -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.
#
@@ -121,11 +121,6 @@
.if empty(IMGBASE)
.BEGIN:
@echo "Error: IMGBASE is not set"
- @false
-.endif
-.if empty(RELEASEDIR)
-.BEGIN:
- @echo "Error: RELEASEDIR is not set"
@false
.endif
--- src/distrib/common/bootimage/Makefile.installimage 2012/01/22 03:53:30 1.1
+++ src/distrib/common/bootimage/Makefile.installimage 2012/01/22 16:50:00 1.2
@@ -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 @@
# 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
--- src/distrib/common/bootimage/Makefile.liveimage 2012/01/22 03:53:30 1.1
+++ src/distrib/common/bootimage/Makefile.liveimage 2012/01/22 16:50:00 1.2
@@ -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 @@
# 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