advance compiling to the m*.cc point
[ardour.git] / gtk2_ardour / SConscript
1 # -*- python -*-
2
3 import os
4 import os.path
5 import glob
6
7 Import('env install_prefix final_prefix config_prefix libraries i18n version')
8
9 gtkardour = env.Copy()
10
11 #
12 # this defines the version number of the GTK interface to ardour
13 #
14
15 domain = 'gtk_ardour'
16
17 gtkardour.Append(DOMAIN=domain, MAJOR=1,MINOR=0,MICRO=2)
18 gtkardour.Append(CXXFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
19 gtkardour.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
20 gtkardour.Append(CXXFLAGS="-DFLOWCANVAS_AA")
21 gtkardour.Append(PACKAGE=domain)
22 gtkardour.Append(POTFILE=domain + '.pot')
23
24 gtkardour.Merge ([
25     libraries['ardour'],
26     libraries['gtkmm2ext'],
27     libraries['flowcanvas'],
28     libraries['midi++2'],
29     libraries['pbd3'],
30     libraries['gtkmm2'],
31     libraries['glib2'],
32     libraries['libgnomecanvas2'],
33     libraries['libgnomecanvasmm'],
34     libraries['sysmidi'],
35     libraries['sndfile'],
36     libraries['lrdf'],
37     libraries['glibmm2'],
38     libraries['pangomm'],
39     libraries['atkmm'],
40     libraries['gdkmm2'],
41     libraries['sigc2'],
42     libraries['gtk2'],
43     libraries['xml'],
44     libraries['soundtouch'],
45     libraries['samplerate'],
46     libraries['jack'],
47     libraries['libglademm']
48 ])
49
50 if gtkardour['VST']:
51     gtkardour.Merge ([ libraries['fst']])
52
53 skipped_files=Split("""
54 connection_editor.cc
55 """)
56
57 gtkardour_files=Split("""
58 about.cc
59 actions.cc
60 add_route_dialog.cc
61 ardour_dialog.cc
62 ardour_message.cc
63 ardour_ui.cc
64 ardour_ui2.cc
65 ardour_ui_dependents.cc
66 ardour_ui_dialogs.cc
67 ardour_ui_ed.cc
68 ardour_ui_mixer.cc
69 audio_clock.cc
70 audio_time_axis.cc
71 automation_gain_line.cc
72 automation_line.cc
73 automation_pan_line.cc
74 automation_time_axis.cc
75 axis_view.cc
76 canvas-imageframe.c
77 canvas-simpleline.c
78 simpleline.cc
79 canvas-simplerect.c
80 simplerect.cc
81 canvas-waveview.c
82 crossfade_edit.cc
83 crossfade_view.cc
84 curvetest.cc
85 default_keys.cc
86 editing.cc
87 editor.cc
88 editor_actions.cc
89 editor_audiotrack.cc
90 editor_canvas_events.cc
91 editor_cursors.cc
92 editor_edit_groups.cc
93 editor_export_audio.cc
94 editor_hscroller.cc
95 editor_imageframe.cc
96 editor_keyboard.cc
97 editor_keys.cc
98 editor_markers.cc
99 editor_mixer.cc
100 editor_mouse.cc
101 editor_nudge.cc
102 editor_ops.cc
103 editor_region_list.cc
104 editor_route_list.cc
105 editor_rulers.cc
106 editor_scrub.cc
107 editor_selection_list.cc
108 editor_tempodisplay.cc
109 editor_timefx.cc
110 export_dialog.cc
111 gain_automation_time_axis.cc
112 gain_meter.cc
113 ghostregion.cc
114 glade_path.cc
115 glade_factory.cc
116 grouped_buttons.cc
117 gtk-custom-hruler.c
118 gtk-custom-ruler.c
119 imageframe.cc
120 imageframe_socket_handler.cc
121 imageframe_time_axis.cc
122 imageframe_time_axis_group.cc
123 imageframe_time_axis_view.cc
124 imageframe_view.cc
125 io_selector.cc
126 keyboard.cc
127 location_ui.cc
128 main.cc
129 marker.cc
130 marker_time_axis.cc
131 marker_time_axis_view.cc
132 marker_view.cc
133 meter_bridge.cc
134 meter_bridge_strip.cc
135 mixer_strip.cc
136 mixer_ui.cc
137 new_session_dialog.cc
138 option_editor.cc
139 opts.cc
140 pan_automation_time_axis.cc
141 panner2d.cc
142 panner_ui.cc
143 playlist_selector.cc
144 plugin_selector.cc
145 plugin_ui.cc
146 prompter.cc
147 public_editor.cc
148 redirect_automation_line.cc
149 redirect_automation_time_axis.cc
150 redirect_box.cc
151 region_editor.cc
152 region_gain_line.cc
153 region_selection.cc
154 regionview.cc
155 route_params_ui.cc
156 route_redirect_selection.cc
157 route_ui.cc
158 selection.cc
159 sfdb_ui.cc
160 send_ui.cc
161 streamview.cc
162 tempo_dialog.cc
163 time_axis_view.cc
164 time_axis_view_item.cc
165 time_selection.cc
166 utils.cc
167 version.cc
168 visual_time_axis.cc
169 waveview.cc
170 """)
171
172 glade_files=glob.glob('glade/*.glade')
173
174 intl_files = gtkardour_files + glade_files + glob.glob('*.h')
175
176 mtest_files=Split("""
177 mtest.cc
178 """)
179
180 itest_files=Split("""
181 itest.cc
182 """)
183
184 extra_sources = []
185 vst_files = [ 'vst_pluginui.cc' ]
186
187 if env['VST']:
188    extra_sources += vst_files
189
190 intl_files += extra_sources
191
192 gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
193 gtkardour.Append(CXXFLAGS="-DDATA_DIR=\\\""+final_prefix+"/share\\\"")
194 gtkardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
195 gtkardour.Append(CXXFLAGS="-DGLADEPATH=\\\""+final_prefix+"/share/ardour/glade\\\"")
196
197 versionflag = '-DVERSIONSTRING=\\\"' + env['VERSION'] + '\\\"'
198
199 gtkardour.Append(CXXFLAGS=versionflag)
200
201 gtkardour.VersionBuild(['version.cc','version.h'], 'SConscript')
202
203 executable = 'ardour.bin'
204
205 ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
206 mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
207 itest = gtkardour.Program(target = 'itest', source = itest_files)
208
209 Default(ardour)
210
211 if env['VERSIONED']:
212     Default (env.VersionedExecutable ('tagged_executable', ardour))
213
214 if env['NLS']:
215     Export('gtkardour', 'intl_files')
216     SConscript ('po/SConscript')
217     
218 #install
219
220
221 env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour', ardour))
222 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour'), 'ardour_ui.rc'))
223 env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour'), 'splash.ppm'))
224 env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour/glade'), glade_files))
225
226 #dist
227 env.Alias ('tarball', env.Distribute (env['DISTTREE'],
228                                       [ 'SConscript',
229                                         'i18n.h', 'gettext.h',
230                                         'editor_xpms', 'misc_xpms', 'transport_xpms',
231                                         'ardour_ui.rc', 'splash.ppm'
232                                         ] +
233                                       gtkardour_files + vst_files + glade_files +
234                                       glob.glob('po/*.po') + glob.glob('*.h')))
235
236 # generate a prototype full-featured ardour_ui.rc file
237
238 env.Alias ('protorc', env.Command ('proto.rc', gtkardour_files, """
239      grep set_name $SOURCES | \
240 sed 's/.*("\([a-zA-Z_][a-zA-Z_]*\)").*/\\1/' | \
241 grep -v '\\.' | sort | uniq | \
242 awk '/\\./ {} { printf ("style \\"%s\\"\\n{\\n\
243   fg[NORMAL] =   { 0, 0, 0 }\\n\
244   fg[ACTIVE] =   { 0, 0, 0 }\\n\
245   fg[SELECTED] = { 0, 0, 0 }\\n\
246   bg[NORMAL] =   { 0, 0, 0 }\\n\
247   bg[ACTIVE] =   { 0, 0, 0 }\\n\
248   bg[SELECTED] = { 0, 0, 0 }\\n\
249 }\\nwidget \\"*%s\\" style \\"%s\\"\\nwidget \\"*%s*\\" style \\"%s\\"\\n\\n", \
250   $$0, $$0, $$0, $$0, $$0) }' > $TARGET && \
251      grep 'color_map\[[a-zA-Z_][a-zA-Z]*\]' $SOURCES | \
252  sed 's/.*\[\([a-zA-Z_][a-zA-Z_]*\)].*/\\1/'| \
253  sort | uniq | \
254  awk '{ printf ("style \\"%s\\"\\n{\\n\
255   fg[NORMAL] =   { 0, 0, 0 }\\n\
256   fg[ACTIVE] =   { 0, 0, 0 }\\n\
257 }\\nwidget \\"*%s\\" style \\"%s\\"\\n \\n\\n", $$0, $$0, $$0) }' >> $TARGET ;
258 """
259 ))