fixed wxrc installation and cleaning
[wxWidgets.git] / build / bakefiles / wx.bkl
1 <?xml version="1.0" ?>
2 <!-- $Id$ -->
3
4
5 <!-- Master bakefile for wxWidgets -->
6
7 <makefile>
8
9     <!-- make sure setup.h is created as soon as possible: -->
10     <phony id="setup_h" cond="FORMAT!='autoconf'">
11         <dependency-of>all</dependency-of>
12     </phony>
13
14     <set var="BUILDING_LIB">1</set>
15     
16     <!-- common rules, names etc. for wx: -->
17     <include file="common.bkl"/>
18     
19     <!-- list of files sorted into categories: -->
20     <include file="files.bkl"/>
21     
22     <!-- wxWidgets variant where everything is in one library: -->
23     <include file="monolithic.bkl"/>
24     <!-- ...and when there are multiple libraries: -->
25     <include file="multilib.bkl"/>
26
27     <if cond="FORMAT in ['msvc6prj','msevc4prj']">
28         <set var="MSVC6PRJ_MERGED_TARGETS">
29             <if cond="MONOLITHIC=='0'">$(MSVC6PRJ_MERGED_TARGETS_MULTILIB)</if>
30             <if cond="MONOLITHIC=='1'">$(MSVC6PRJ_MERGED_TARGETS_MONOLIB)</if>
31         </set>
32     </if>
33     
34     <!-- OpenGL canvas is built as separate library in both cases: -->
35     <include file="opengl.bkl"/>
36     <!-- Dynamically loadable plugins: -->
37     <include file="plugins.bkl"/>
38  
39     <!-- Samples target (not dependency of 'all'): -->
40     <subproject id="samples">
41         <installable>no</installable>
42         <dir cond="FORMAT=='autoconf'">samples</dir>
43         <dir cond="FORMAT!='autoconf' and TOOLKIT in ['MSW','MGL']">../../samples</dir>
44     </subproject>
45     
46     <if cond="FORMAT=='autoconf'">
47     
48         <!-- WXRC compiler is built by default: -->
49         <!-- FIXME: this is dirty hack, better bakefile support for
50              conditional and optional subprojects is needed -->
51         <action id="wxrc" cond="USE_XRC=='1'">
52             <dependency-of>all</dependency-of>
53             <command>
54                 (test -d utils/wxrc &amp;&amp; cd utils/wxrc &amp;&amp; $(DOLLAR)(MAKE) all) || true
55             </command>
56         </action>
57         <action id="clean-wxrc" cond="USE_XRC=='1'">
58             <dependency-of>clean</dependency-of>
59             <command>
60                 (test -d utils/wxrc &amp;&amp; cd utils/wxrc &amp;&amp; $(DOLLAR)(MAKE) clean) || true
61             </command>
62         </action>
63         <action id="install-wxrc" cond="USE_XRC=='1'">
64             <dependency-of>install</dependency-of>
65             <command>
66                 (test -d utils/wxrc &amp;&amp; cd utils/wxrc &amp;&amp; $(DOLLAR)(MAKE) install) || true
67             </command>
68         </action>
69     
70         <!-- "make install": -->
71
72         <data-files>
73             <files>wxwin.m4</files>
74             <install-to>$(DATADIR)/aclocal</install-to>
75         </data-files>
76
77         <data-files-tg id="install-afm" cond="USE_GUI=='1'">
78             <files>misc/afm/*.afm</files>
79             <install-to>$(DATADIR)/wx/$(WX_RELEASE)/afm</install-to>
80         </data-files-tg>
81         <data-files-tg id="install-gsafm" cond="USE_GUI=='1'">
82             <files>misc/gs_afm/*.afm</files>
83             <install-to>$(DATADIR)/wx/$(WX_RELEASE)/gs_afm</install-to>
84         </data-files-tg>
85
86         <action id="install-wxconfig">
87             <dependency-of>install</dependency-of>
88             <command>
89                 $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
90                 $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/wx/config
91                 $(INSTALL_PROGRAM) lib/wx/config/$(TOOLCHAIN_FULLNAME) $(DESTDIR)$(LIBDIR)/wx/config
92                 (cd $(DESTDIR)$(BINDIR) &amp;&amp; rm -f wx-config &amp;&amp; $(LN_S) $(DESTDIR)$(LIBDIR)/wx/config/$(TOOLCHAIN_FULLNAME) wx-config)
93             </command>
94         </action>
95
96         <data-files>
97             <srcdir>$(BUILDDIR)</srcdir>
98             <files>lib/wx/include/$(TOOLCHAIN_FULLNAME)/wx/setup.h</files>
99             <install-to>$(LIBDIR)/wx/include/$(TOOLCHAIN_FULLNAME)/wx</install-to>
100         </data-files>
101
102         <headers>
103             <srcdir>$(SRCDIR)/include</srcdir>
104             <files>$(ALL_HEADERS)</files>
105             <install-to>
106                 $(INCLUDEDIR)/wx-$(WX_RELEASE)$(WX_FLAVOUR)
107             </install-to>
108         </headers>
109
110         <!-- Locales: -->
111         <using module="gettext"/>
112         <gettext-catalogs id="locale">
113             <srcdir>$(SRCDIR)/locale</srcdir>
114             <catalog-name>wxstd</catalog-name>
115             <linguas>
116                 ca cs da de el es fi fr hu id it ja nl pl ru sl sv tr uk
117                 zh zh_CN zh_TW
118             </linguas>
119             <install-to>$(LOCALEDIR)</install-to>
120         </gettext-catalogs>
121
122         <!-- Mac OS X resources: -->
123         <set var="MACOS_R">lib/libwx_$(TOOLCHAIN_NAME).$(WXSOVERSION[0]).r</set>
124         <set var="MACOS_RSRC">lib/libwx_$(TOOLCHAIN_NAME).$(WXSOVERSION[0]).rsrc</set>
125         <action id="macos-res" cond="TOOLKIT=='MAC'">
126             <dependency-of>all</dependency-of>
127             <set var="__targetname">$(MACOS_R)</set>
128             <command>
129                 $(RESCOMP) -d __UNIX__ -useDF $(top_srcdir)/src/mac/carbon/apprsrc.r $(top_srcdir)/src/mac/carbon/carbrsrc.r $(top_srcdir)/src/mac/carbon/corersrc.r -o $(MACOS_RSRC)
130                 $(DEREZ) $(MACOS_RSRC) Carbon.r -useDF >$(MACOS_R)
131             </command>
132             <clean-files>$(MACOS_RSRC) $(MACOS_R)</clean-files>
133         </action>
134         <action id="macos-res-install" cond="TOOLKIT=='MAC'">
135             <dependency-of>install</dependency-of>
136             <depends>macos-res</depends>
137             <command>
138                 $(INSTALL_DATA) $(MACOS_R) $(LIBDIR)
139                 $(INSTALL_DATA) $(MACOS_RSRC) $(LIBDIR)
140             </command>
141         </action>
142         <action id="cocoa-res" cond="TOOLKIT=='COCOA'">
143             <dependency-of>all</dependency-of>
144             <set var="__targetname">$(MACOS_R)</set>
145             <command>
146                 $(RESCOMP) -d __UNIX__ -useDF $(top_srcdir)/src/cocoa/dummy.r -o $(MACOS_RSRC)
147                 $(DEREZ) $(MACOS_RSRC) -useDF >$(MACOS_R)
148             </command>
149             <clean-files>$(MACOS_RSRC) $(MACOS_R)</clean-files>
150         </action>
151         <action id="cocoa-res-install" cond="TOOLKIT=='COCOA'">
152             <dependency-of>install</dependency-of>
153             <depends>macos-res</depends>
154             <command>
155                 $(INSTALL_DATA) $(MACOS_R) $(LIBDIR)
156                 $(INSTALL_DATA) $(MACOS_RSRC) $(LIBDIR)
157             </command>
158         </action>
159
160     </if>
161
162
163     <!-- copy setup.h on DOS/Windows: -->    
164     <if cond="FORMAT!='autoconf' and TOOLKIT in ['MSW','MGL']">
165         <mkdir id="libdir">
166             <dir>$(LIBDIRNAME)</dir>
167         </mkdir>
168         <mkdir id="libdir_setup">
169             <depends>libdir</depends>
170             <dir>$(SETUPHDIR)</dir>            
171         </mkdir>
172         <mkdir id="libdir_setup_wx">
173             <depends>libdir_setup</depends>
174             <dependency-of>setup_h</dependency-of>
175             <dir>$(SETUPHDIR)/wx</dir>            
176         </mkdir>
177
178         <set var="SETUP_H_SUBDIR">
179             <if cond="WXUNIV=='1'">univ</if>
180             <if cond="WXUNIV=='0'">$(TOOLKIT_LOWERCASE)</if>
181         </set>
182         
183         <copy-file-to-file-if-not-exist id="master_setup.h">
184             <src>$(SRCDIR)/include/wx/$(SETUP_H_SUBDIR)/setup0.h</src>
185             <dst>$(SRCDIR)/include/wx/$(SETUP_H_SUBDIR)/setup.h</dst>
186             <dependency-of>setup_h</dependency-of>
187         </copy-file-to-file-if-not-exist>
188         <copy-file-to-file-if-not-exist id="setup.h">
189             <dependency-of>setup_h</dependency-of>
190             <src>$(SRCDIR)/include/wx/$(SETUP_H_SUBDIR)/setup.h</src>
191             <dst>$(SETUPHDIR)/wx/setup.h</dst>
192         </copy-file-to-file-if-not-exist>
193
194     </if>
195
196
197     <if cond="FORMAT=='autoconf'">
198
199         <!-- Show this banner after installation: -->
200         <modify-target target="install">
201             <command>
202 @echo " "
203 @echo " ------------------------------------------------------"
204 @echo " "
205 @echo " The installation of wxWidgets is finished.  On certain"
206 @echo " platforms (e.g. Linux) you'll now have to run ldconfig"
207 @echo " if you installed a shared library and also modify the"
208 @echo " LD_LIBRARY_PATH (or equivalent) environment variable."
209 @echo " "
210 @echo " wxWidgets comes with no guarantees and doesn't claim"
211 @echo " to be suitable for any purpose."
212 @echo " "
213 @echo " Read the wxWidgets Licence on licencing conditions."
214 @echo " "
215 @echo " ------------------------------------------------------"
216 @echo " "
217             </command>
218         </modify-target>
219
220         <!-- add "make dist" target to autoconf: -->
221         <set var="VARS_DONT_ELIMINATE" append="1">
222             ALL_BASE_SOURCES WX_VERSION
223         </set>
224         <fragment format="autoconf" file="make_dist.mk"/>
225
226     </if>
227         
228     <include file="build_cfg.bkl"/>
229
230 </makefile>