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

cvs diff -r1.1 -r1.2 src/distrib/common/bootimage/Makefile.bootimage (expand / switch to unified diff)

--- 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,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile.bootimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $ 1# $NetBSD: Makefile.bootimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
2# 2#
3# Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. 3# Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved.
4# 4#
5# Redistribution and use in source and binary forms, with or without 5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions 6# modification, are permitted provided that the following conditions
7# are met: 7# are met:
8# 1. Redistributions of source code must retain the above copyright 8# 1. Redistributions of source code must retain the above copyright
9# notice, this list of conditions and the following disclaimer. 9# notice, this list of conditions and the following disclaimer.
10# 2. Redistributions in binary form must reproduce the above copyright 10# 2. Redistributions in binary form must reproduce the above copyright
11# notice, this list of conditions and the following disclaimer in the 11# notice, this list of conditions and the following disclaimer in the
12# documentation and/or other materials provided with the distribution. 12# documentation and/or other materials provided with the distribution.
13# 13#
14# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
@@ -113,31 +113,26 @@ @@ -113,31 +113,26 @@
113# 113#
114 114
115.include <bsd.sys.mk> # for HOST_SH 115.include <bsd.sys.mk> # for HOST_SH
116.include <bsd.own.mk> # 116.include <bsd.own.mk> #
117.include <bsd.endian.mk> # for TARGET_ENDIANNESS 117.include <bsd.endian.mk> # for TARGET_ENDIANNESS
118 118
119.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" 119.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
120 120
121.if empty(IMGBASE) 121.if empty(IMGBASE)
122.BEGIN: 122.BEGIN:
123 @echo "Error: IMGBASE is not set" 123 @echo "Error: IMGBASE is not set"
124 @false 124 @false
125.endif 125.endif
126.if empty(RELEASEDIR) 
127.BEGIN: 
128 @echo "Error: RELEASEDIR is not set" 
129 @false 
130.endif 
131 126
132# should be defined elsewhere?  127# should be defined elsewhere?
133CAT?= cat 128CAT?= cat
134CHMOD?= chmod 129CHMOD?= chmod
135CP?= cp 130CP?= cp
136DD?= dd 131DD?= dd
137MKDIR?= mkdir -p 132MKDIR?= mkdir -p
138RM?= rm 133RM?= rm
139 134
140# 135#
141# common definitions for image 136# common definitions for image
142# 137#
143BOOTDISK?= sd0 138BOOTDISK?= sd0

cvs diff -r1.1 -r1.2 src/distrib/common/bootimage/Makefile.installimage (expand / switch to unified diff)

--- 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,35 +1,34 @@ @@ -1,35 +1,34 @@
1# $NetBSD: Makefile.installimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $ 1# $NetBSD: Makefile.installimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
2# 2#
3# Common Makefile to create a bootable installation image for USB flash etc. 3# Common Makefile to create a bootable installation image for USB flash etc.
4# 4#
5 5
6# 6#
7# Required variables: 7# Required variables:
8# INSTIMGBASE 8# INSTIMGBASE
9# Basename of the liveimage 9# Basename of the liveimage
10# 10#
11# See Makefile.bootimage for other variables. 11# See Makefile.bootimage for other variables.
12# 12#
13 13
14.if empty(INSTIMGBASE) 14.if !target(check_INSTIMGBASE)
15.BEGIN: 15check_INSTIMGBASE: .PHONY .NOTMAIN
 16.if !defined(INSTIMGBASE)
16 @echo "Error: INSTIMGBASE is not set" 17 @echo "Error: INSTIMGBASE is not set"
17 @false 18 @false
 19.else
 20 @true
18.endif 21.endif
19.if empty(RELEASEDIR) 
20.BEGIN: 
21 @echo "Error: RELEASEDIR is not set" 
22 @false 
23.endif 22.endif
24 23
25SWAPMB= 0 # no swap 24SWAPMB= 0 # no swap
26OMIT_SWAPIMG= yes # nothing to write 25OMIT_SWAPIMG= yes # nothing to write
27 26
28KERN_SET?= kern-GENERIC 27KERN_SET?= kern-GENERIC
29SETS?= modules base etc 28SETS?= modules base etc
30 29
31FSTAB_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in 30FSTAB_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in
32 31
33.if ${USE_MBR} != "no" 32.if ${USE_MBR} != "no"
34DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in 33DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in
35.else 34.else
@@ -44,20 +43,20 @@ IMGDIR_EXCLUDE+= -s ',./installation/ins @@ -44,20 +43,20 @@ IMGDIR_EXCLUDE+= -s ',./installation/ins
44 43
45IMGBASE= ${INSTIMGBASE} 44IMGBASE= ${INSTIMGBASE}
46 45
47.include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage" 46.include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
48 47
49# INSTIMG_RELEASEDIR specifies where to install ${INSTIMGBASE}.img.gz. 48# INSTIMG_RELEASEDIR specifies where to install ${INSTIMGBASE}.img.gz.
50# This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc 49# This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
51# but also set default here for manual builds. 50# but also set default here for manual builds.
52INSTIMG_RELEASEDIR?= ${RELEASEMACHINEDIR}/installation/installimage 51INSTIMG_RELEASEDIR?= ${RELEASEMACHINEDIR}/installation/installimage
53 52
54# should be defined elsewhere?  53# should be defined elsewhere?
55MKDIR?= mkdir -p 54MKDIR?= mkdir -p
56 55
57install_image: ${IMGBASE}.img.gz 56install_image: check_INSTIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
58 ${MKDIR} ${INSTIMG_RELEASEDIR} 57 ${MKDIR} ${INSTIMG_RELEASEDIR}
59 ${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR} 58 ${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR}
60 # note ${MAKESUM} will be calculated in src/etc/Makefile 59 # note ${MAKESUM} will be calculated in src/etc/Makefile
61 60
62release: 61release:
63 62

cvs diff -r1.1 -r1.2 src/distrib/common/bootimage/Makefile.liveimage (expand / switch to unified diff)

--- 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,43 +1,42 @@ @@ -1,43 +1,42 @@
1# $NetBSD: Makefile.liveimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $ 1# $NetBSD: Makefile.liveimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
2# 2#
3# Common Makefile to create a bootable FS image for USB flash or emulators 3# Common Makefile to create a bootable FS image for USB flash or emulators
4# 4#
5 5
6# 6#
7# Required variables: 7# Required variables:
8# LIVEIMGBASE 8# LIVEIMGBASE
9# Basename of the liveimage 9# Basename of the liveimage
10# 10#
11# See Makefile.bootimage for other variables. 11# See Makefile.bootimage for other variables.
12# 12#
13 13
14.if empty(LIVEIMGBASE) 14.if !target(check_LIVEIMGBASE)
15.BEGIN: 15check_LIVEIMGBASE: .PHONY .NOTMAIN
 16.if !defined(LIVEIMGBASE)
16 @echo "Error: LIVEIMGBASE is not set" 17 @echo "Error: LIVEIMGBASE is not set"
17 @false 18 @false
 19.else
 20 @true
18.endif 21.endif
19.if empty(RELEASEDIR) 
20.BEGIN: 
21 @echo "Error: RELEASEDIR is not set" 
22 @false 
23.endif 22.endif
24 23
25IMGBASE= ${LIVEIMGBASE} 24IMGBASE= ${LIVEIMGBASE}
26 25
27.include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage" 26.include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
28 27
29# LIVEIMG_RELEASEDIR specifies where to install ${LIVEIMGBASE}.img.gz. 28# LIVEIMG_RELEASEDIR specifies where to install ${LIVEIMGBASE}.img.gz.
30# This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc 29# This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
31# but also set default here for manual builds. 30# but also set default here for manual builds.
32LIVEIMG_RELEASEDIR?= ${RELEASEMACHINEDIR}/installation/liveimage 31LIVEIMG_RELEASEDIR?= ${RELEASEMACHINEDIR}/installation/liveimage
33 32
34# should be defined elsewhere?  33# should be defined elsewhere?
35MKDIR?= mkdir -p 34MKDIR?= mkdir -p
36 35
37live_image: ${IMGBASE}.img.gz 36live_image: check_LIVEIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
38 ${MKDIR} ${LIVEIMG_RELEASEDIR} 37 ${MKDIR} ${LIVEIMG_RELEASEDIR}
39 ${RELEASE_INSTALL} ${IMGBASE}.img.gz ${LIVEIMG_RELEASEDIR} 38 ${RELEASE_INSTALL} ${IMGBASE}.img.gz ${LIVEIMG_RELEASEDIR}
40 # note ${MAKESUM} will be calculated in src/etc/Makefile 39 # note ${MAKESUM} will be calculated in src/etc/Makefile
41 40
42release: 41release:
43 42