source: uKadecot/trunk/ssp/utils/makerelease@ 101

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

TOPPERS/uKadecotのソースコードを追加

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-2010 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 1866 2010-07-25 13:19:17Z ertl-hiro $
43#
44
45use Cwd;
46
47
48$cwd = getcwd();
49$cwd =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
50$prefix = "./".$cwd;
51
52@file_list = ();
53%file_list = ();
54
55if ($#ARGV >= 0) {
56 $arg1 = $ARGV[0];
57 $arg1 =~ s/\.\///;
58}
59else {
60 $arg1 = "MANIFEST";
61}
62
63sub gen_path
64{
65 local($base, $path) = @_;
66
67 while ($path =~ /^..\/(.*)$/) {
68 $path = $1;
69 $base =~ s/(\/?)[^\/]*\/$/$1/;
70 }
71 return($base.$path);
72}
73
74sub read_file {
75 local($filename) = @_;
76 local($fh, $dirname);
77
78 if ($filename =~ /^(.*\/)[^\/]*$/) {
79 $dirname = $1;
80 }
81 else {
82 $dirname = "";
83 }
84
85 open($fh, $filename) || die "Cannot open $filename";
86 while ($line = <$fh>) {
87 chomp $line;
88 $line =~ s/\r$//;
89 $line =~ s/[ \t]*\#.*$//;
90 next if ($line =~ /^[ \t]*$/);
91
92 if ($line =~ /^E_PACKAGE[ \t]+(.*)$/) {
93 if ($package) {
94 die "Duplicated E_PACKAGE directive.";
95 }
96 else {
97 $package = $1;
98 $e_package = 1;
99 }
100 }
101 elsif ($line =~ /^PACKAGE[ \t]+(.*)$/) {
102 if ($package) {
103 if (!$e_package && $package != $1) {
104 die "Inconsistent PACKAGE directive.";
105 }
106 }
107 else {
108 $package = $1;
109 }
110 }
111 elsif ($line =~ /^VERSION[ \t]+(.*)$/) {
112 if ($version) {
113 if (!$e_package && $version != $1) {
114 die "Inconsistent VERSION directive.";
115 }
116 }
117 else {
118 $version = $1;
119 if ($version =~ /%date/) {
120 @current_time = localtime();
121 $vdate = sprintf("%04d%02d%02d", $current_time[5]+1900,
122 $current_time[4]+1, $current_time[3]);
123 $version =~ s/%date/$vdate/;
124 }
125 }
126 }
127 elsif ($line =~ /^INCLUDE[ \t]+(.*)$/) {
128 read_file(gen_path($dirname, $1));
129 }
130 else {
131 $filename = $prefix."/".$dirname.$line;
132 while ($filename =~ s|/[^/]+/\.\./|/|) {}
133 if ($file_list{$filename}) {
134 die "$filename is duplicated.";
135 }
136 else {
137 push(@file_list, $filename);
138 $file_list{$filename} = $filename;
139 }
140 }
141 }
142 close($fh);
143}
144
145read_file($arg1);
146unless ($package) {
147 die "PACKAGE/E_PACKAGE directive not found.";
148}
149unless ($version) {
150 die "VERSION directive not found.";
151}
152
153if (! -d "RELEASE") {
154 mkdir("RELEASE");
155}
156
157$archive_name = $package."-".$version.".tar.gz";
158$file_list = join(" ", @file_list);
159$command = "tar cvfz RELEASE/$archive_name -C .. $file_list\n";
160die if (system($command));
161print STDERR "== RELEASE/$archive_name is generated. ==\n";
Note: See TracBrowser for help on using the repository browser.