source: UsbWattMeter/trunk/asp_dcre/utils/makerelease@ 164

Last change on this file since 164 was 164, checked in by coas-nagasima, 7 years ago

TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加

File size: 4.3 KB
Line 
1#! /usr/bin/perl
2#
3# TOPPERS Software
4# Toyohashi Open Platform for Embedded Real-Time Systems
5#
6# Copyright (C) 2006-2011 by Embedded and Real-Time Systems Laboratory
7# Graduate School of Information Science, Nagoya Univ., JAPAN
8#
9# ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
10# ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
11# •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
12# (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
13# Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
14# ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
15# (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
16# —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
17ƒƒ“ƒgi—˜—p
18# ŽÒƒ}ƒjƒ…
19ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
20# ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
21# (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
22# —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
23# ‚ƁD
24# (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
25ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
26ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
27# ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
28# (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
29# •ñ‚·‚邱‚ƁD
30# (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
31# ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
32# ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
33# —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
34# –Ɛӂ·‚邱‚ƁD
35#
36# –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
37# ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
38# ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
39# ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
40# ‚̐ӔC‚𕉂í‚È‚¢D
41#
42# @(#) $Id: makerelease 2253 2011-09-11 01:23:40Z ertl-hiro $
43#
44
45require 'getcwd.pl';
46
47$cwd = getcwd();
48$cwd =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
49$prefix = "./".$cwd;
50
51@file_list = ();
52%file_list = ();
53
54if ($#ARGV >= 0) {
55 $arg1 = $ARGV[0];
56 $arg1 =~ s/\.\///;
57}
58else {
59 $arg1 = "MANIFEST";
60}
61
62sub gen_path
63{
64 local($base, $path) = @_;
65
66 while ($path =~ /^..\/(.*)$/) {
67 $path = $1;
68 $base =~ s/(\/?)[^\/]*\/$/$1/;
69 }
70 return($base.$path);
71}
72
73sub read_file {
74 local($filename) = @_;
75 local($fh, $dirname);
76
77 if ($filename =~ /^(.*\/)[^\/]*$/) {
78 $dirname = $1;
79 }
80 else {
81 $dirname = "";
82 }
83
84 open($fh, $filename) || die "Cannot open $filename";
85 while ($line = <$fh>) {
86 chomp $line;
87 $line =~ s/\r$//;
88 $line =~ s/[ \t]*\#.*$//;
89 next if ($line =~ /^[ \t]*$/);
90
91 if ($line =~ /^E_PACKAGE[ \t]+(.*)$/) {
92 if ($package) {
93 die "Duplicated E_PACKAGE directive.";
94 }
95 else {
96 $package = $1;
97 $e_package = 1;
98 }
99 }
100 elsif ($line =~ /^PACKAGE[ \t]+(.*)$/) {
101 if ($package) {
102 if (!$e_package && $package != $1) {
103 die "Inconsistent PACKAGE directive.";
104 }
105 }
106 else {
107 $package = $1;
108 }
109 }
110 elsif ($line =~ /^VERSION[ \t]+(.*)$/) {
111 if ($version) {
112 if (!$e_package && $version != $1) {
113 die "Inconsistent VERSION directive.";
114 }
115 }
116 else {
117 $version = $1;
118 if ($version =~ /%date/) {
119 @current_time = localtime();
120 $vdate = sprintf("%04d%02d%02d", $current_time[5]+1900,
121 $current_time[4]+1, $current_time[3]);
122 $version =~ s/%date/$vdate/;
123 }
124 }
125 }
126 elsif ($line =~ /^INCLUDE[ \t]+(.*)$/) {
127 read_file(gen_path($dirname, $1));
128 }
129 else {
130 $filename = $prefix."/".$dirname.$line;
131 while ($filename =~ s|/[^/]+/\.\./|/|) {}
132 if ($file_list{$filename}) {
133 die "$filename is duplicated.";
134 }
135 else {
136 push(@file_list, $filename);
137 $file_list{$filename} = $filename;
138 }
139 }
140 }
141 close($fh);
142}
143
144read_file($arg1);
145unless ($package) {
146 die "PACKAGE/E_PACKAGE directive not found.";
147}
148unless ($version) {
149 die "VERSION directive not found.";
150}
151
152if (! -d "RELEASE") {
153 mkdir("RELEASE");
154}
155
156$archive_name = $package."-".$version.".tar.gz";
157$file_list = join(" ", @file_list);
158$command = "tar cvfz RELEASE/$archive_name -C .. $file_list\n";
159die if (system($command));
160print STDERR "== RELEASE/$archive_name is generated. ==\n";
Note: See TracBrowser for help on using the repository browser.