FreeCalypso > hg > fc-tourmaline
comparison src/cs/layer1/tools/make_cmd.pl @ 0:4e78acac3d88
src/{condat,cs,gpf,nucleus}: import from Selenite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 16 Oct 2020 06:23:26 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4e78acac3d88 |
---|---|
1 #!perl | |
2 | |
3 # generate a dynamic Linker command file | |
4 # PARAMETER ARE: | |
5 # 1 : Name of the Linker command file | |
6 # 2 : Name of the file with the parameter | |
7 # | |
8 | |
9 my ($cmd_file_temp,$tmp_file)=@ARGV; | |
10 | |
11 open (TMP, "$tmp_file"); | |
12 my $const_boot_lib = <TMP>; | |
13 my $bss_boot_lib = <TMP>; | |
14 my $bss_libs = <TMP>; | |
15 my $const_libs = <TMP>; | |
16 my $toolchoice_type = <TMP>; | |
17 close TMP; | |
18 | |
19 # define the REPLACE STRINGS | |
20 my $const_boot_str="(CONST_BOOT_LIB)"; | |
21 my $bss_boot_str="(BSS_BOOT_LIB)"; | |
22 my $bss_str="(BSS_LIBS)"; | |
23 my $const_str="(CONST_LIBS)"; | |
24 | |
25 # define some local variables | |
26 my $temp; | |
27 my @CMD; | |
28 my $line; | |
29 | |
30 # determine the cmd file name | |
31 @CMD=split /.template/, $cmd_file_temp; | |
32 $cmd_file=$CMD[0].".cmd"; | |
33 | |
34 open (TMP1, ">$cmd_file"); | |
35 open (TMP,$cmd_file_temp); | |
36 while ($line=<TMP>) { | |
37 if ($line =~ m/$const_boot_str/g) { | |
38 $line=mak_libs ($const_boot_lib) | |
39 } | |
40 if ($line =~ m/$bss_boot_str/g) { | |
41 $line=mak_libs ($bss_boot_lib) | |
42 } | |
43 if ($line =~ m/$bss_str/g) { | |
44 # insert the Libs | |
45 $line=mak_libs ($bss_libs); | |
46 } | |
47 if ($line =~ m/$const_str/g) { | |
48 $line=mak_libs ($const_libs) | |
49 } | |
50 | |
51 # NEW COMPILER MANAGEMENT | |
52 # If use of VISUAL LINKER, needs to manage trampoline download. | |
53 # Case of: | |
54 # - TOOL_CHOICE == 0 => compiler v1.22e with vlinker v1.9902 | |
55 if ($toolchoice_type == 0) { | |
56 $line =~ s(COMMENT2START)(); | |
57 $line =~ s(COMMENT2END)(); | |
58 } | |
59 | |
60 if ($toolchoice_type == 3) { | |
61 $line =~ s(COMMENT2START)(/*); | |
62 $line =~ s(COMMENT2END)(*/); | |
63 } | |
64 | |
65 print TMP1 $line; | |
66 } | |
67 close TMP; | |
68 close TMP1; | |
69 unlink $tmp_file; | |
70 | |
71 sub mak_libs | |
72 { | |
73 my ($bss_libs) =@_; | |
74 my @temp; | |
75 @temp = split /=/, $bss_libs; | |
76 $_="\t\t\t" . $temp[1]; | |
77 s/\) /)\n\t\t\t/g; | |
78 $_ =~ tr /\"//d; | |
79 return $_; | |
80 } | |
81 |