-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
174 lines (151 loc) · 3.38 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
require 'rake/c'
machine = `#{C.cc} -dumpmachine`.strip
strip = ENV['STRIP'] || 'strip'
if machine.match(/darwin/)
C.cflags = '-Wall -Os'
host = "mac"
else
C.cflags = '-Wall -Os'
C.ldflags = '-Os'
host = "linux"
end
C.library 'tai', [
'tai.c',
]
C.library 'i18n', [
'i18n.c',
'i18n_error.c',
]
C.library '6d6', [
'6d6.c',
'find_timestamp.c',
]
C.library 's2x', [
's2x.c',
's2x_channel.c',
]
C.library 'blockreader', [
'blockreader.c',
]
C.library 'options', [
'options.c',
]
C.library 'utime', [
'utime.c',
]
C.library 'bcd', [
'bcd_diff.c',
'bcd_mjd.c',
'bcd_parse.c',
'bcd_valid.c',
'bcd_weekday.c',
'bcd_format.c',
]
C.library 'samplerate', [
'samplerate.c',
'src_linear.c',
'src_sinc.c',
'src_zoh.c',
]
C.program '6d6copy', [
'6d6copy.c',
'lib6d6.a',
'liboptions.a',
'libbcd.a',
'libtai.a',
'libi18n.a',
'-lm',
]
C.program '6d6read', [
'6d6read.c',
'lib6d6.a',
'libs2x.a',
'libbcd.a',
'libtai.a',
'liboptions.a',
'libi18n.a',
'-lm',
]
C.program '6d6info', [
'6d6info.c',
'lib6d6.a',
'liboptions.a',
'libbcd.a',
'libtai.a',
'libi18n.a',
'-lm',
]
C.program '6d6mseed', [
'6d6mseed.c',
'lib6d6.a',
'liboptions.a',
'libbcd.a',
'libtai.a',
'libi18n.a',
'libsamplerate.a',
'-lm',
]
C.program '6d6strip', [
'6d6strip.c',
'lib6d6.a',
'liboptions.a',
'libbcd.a',
'libtai.a',
'libi18n.a',
'-lm',
]
C.program 's2xshift', [
's2xshift.c',
'libs2x.a',
'-lm',
]
C.program 's2xdump', [
's2xdump.c',
'libs2x.a',
'-lm',
]
C.program 'tai', [
'tai.c',
'libtai.a',
]
C.program 'mseed-check', [
'mseed-check.c',
'libtai.a',
]
require './i18n'
file 'src/i18n/i18n.h' => ['i18n/en_GB.txt', 'i18n/de_DE.txt', 'i18n.rb'] do
i18n = I18n.new
i18n.add_lang 'en_GB', 'i18n/en_GB.txt'
i18n.add_lang 'de_DE', 'i18n/de_DE.txt'
system 'mkdir -p src/i18n/'
i18n.write_h 'src/i18n/i18n.h'
end
desc "Install everything."
task :install => ['build/6d6info', 'build/6d6copy', 'build/6d6read', 'build/6d6mseed'] do
#system 'strip build/6d6info build/6d6copy build/6d6read build/6d6mseed'
system 'sudo install -m 4755 "build/6d6info" "/usr/local/bin/"'
system 'sudo install -m 4755 "build/6d6copy" "/usr/local/bin/"'
system 'sudo install -m 0755 "build/6d6read" "/usr/local/bin/"'
system 'sudo install -m 4755 "build/6d6mseed" "/usr/local/bin/"'
system 'sudo install -m 4755 "build/6d6strip" "/usr/local/bin/"'
end
desc "Create a packaged version."
task :package => [
'build/6d6info', 'build/6d6copy', 'build/6d6read', 'build/6d6mseed', 'build/6d6strip',
'src/version.h', 'package/install', 'package/README', 'package/6d6update', 'LICENCE'
] do
v = File.read 'src/version.h'
version = v.match(/KUM_6D6_COMPAT_VERSION\s+"([^"]+)"/)[1]
date = v.match(/KUM_6D6_COMPAT_DATE\s+"([^"]+)"/)[1]
archive = "6d6-compat-#{date}-#{version}-#{host}"
system "rm -rf '#{archive}' '#{archive}.tar.gz'"
system "mkdir '#{archive}'"
system "cp build/6d6info build/6d6copy build/6d6read build/6d6mseed build/6d6strip package/6d6update package/install package/README LICENCE '#{archive}'"
system "cp src/samplerate/COPYING '#{archive}/LICENCE-SRC'"
system "#{strip} '#{archive}/6d6info'"
system "#{strip} '#{archive}/6d6copy'"
system "#{strip} '#{archive}/6d6read'"
system "#{strip} '#{archive}/6d6mseed'"
system "#{strip} '#{archive}/6d6strip'"
system "tar czf '#{archive}.tar.gz' '#{archive}'"
end