changes to make building plugins possible; build wxSound SDL plugin on Unix
[wxWidgets.git] / build / bakefiles / wx.bkl
1 <?xml version="1.0" ?>
2 <!-- $Id$ -->
3
4
5 <!-- Master bakefile for wxWindows -->
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     <!-- wxWindows 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     <!-- OpenGL canvas is built as separate library in both cases: -->
27     <include file="opengl.bkl"/>
28     <!-- Dynamically loadable plugins: -->
29     <include file="plugins.bkl"/>
30  
31     <!-- Samples target (not dependency of 'all'): -->
32     <subproject id="samples">
33         <installable>no</installable>
34         <dir cond="FORMAT=='autoconf'">samples</dir>
35         <dir cond="FORMAT!='autoconf' and TOOLKIT=='MSW'">../../samples</dir>
36     </subproject>
37
38     <if cond="FORMAT=='autoconf'">       
39         <!-- "make install": -->
40
41         <data-files>
42             <files>wxwin.m4</files>
43             <install-to>$(DATADIR)/aclocal</install-to>
44         </data-files>
45
46         <data-files-tg id="install-afm" cond="USE_GUI=='1'">
47             <files>misc/afm/*.afm</files>
48             <install-to>$(DATADIR)/wx/$(WXVER_MAJOR).$(WXVER_MINOR)/afm</install-to>
49         </data-files-tg>
50         <data-files-tg id="install-gsafm" cond="USE_GUI=='1'">
51             <files>misc/gs_afm/*.afm</files>
52             <install-to>$(DATADIR)/wx/$(WXVER_MAJOR).$(WXVER_MINOR)/gs_afm</install-to>
53         </data-files-tg>
54
55         <action id="install-wxconfig">
56             <dependency-of>install</dependency-of>
57             <command>
58                 $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
59                 $(INSTALL_PROGRAM) wx$(TOOLCHAIN_NAME)-config $(DESTDIR)$(BINDIR)
60                 (cd $(DESTDIR)$(BINDIR) &amp;&amp; rm -f wx-config &amp;&amp; $(LN_S) wx$(TOOLCHAIN_NAME)-config wx-config)
61             </command>
62         </action>
63
64         <data-files>
65             <srcdir>$(BUILDDIR)</srcdir>
66             <files>lib/wx/include/$(TOOLCHAIN_NAME)/wx/setup.h</files>
67             <install-to>$(LIBDIR)/wx/include/$(TOOLCHAIN_NAME)/wx</install-to>
68         </data-files>
69
70         <headers>
71             <srcdir>$(SRCDIR)/include</srcdir>
72             <files>$(ALL_HEADERS)</files>
73         </headers>
74
75         <!-- Locales: -->
76         <using module="gettext"/>
77         <gettext-catalogs id="locale">
78             <srcdir>$(SRCDIR)/locale</srcdir>
79             <catalog-name>wxstd</catalog-name>
80             <linguas>
81                 ca cs da de el es fi fr hu id it ja nl pl ru sl sv tr uk
82                 zh zh_CN zh_TW
83             </linguas>
84             <install-to>$(LOCALEDIR)</install-to>
85         </gettext-catalogs>
86
87         <!-- Mac OS X resources: -->
88         <set var="MACOS_R">lib/libwx_$(TOOLCHAIN_NAME).$(WXSOVERSION[0]).r</set>
89         <set var="MACOS_RSRC">lib/libwx_$(TOOLCHAIN_NAME).$(WXSOVERSION[0]).rsrc</set>
90         <action id="macos-res" cond="TOOLKIT=='MAC'">
91             <dependency-of>all</dependency-of>
92             <set var="__targetname">$(MACOS_R)</set>
93             <command>
94                 $(RESCOMP) -d __UNIX__ -useDF $(top_srcdir)/src/mac/apprsrc.r $(top_srcdir)/src/mac/carbrsrc.r $(top_srcdir)/src/mac/corersrc.r -o $(MACOS_RSRC)
95                 $(DEREZ) $(MACOS_RSRC) Carbon.r -useDF >$(MACOS_R)
96             </command>
97             <clean-files>$(MACOS_RSRC) $(MACOS_R)</clean-files>
98         </action>
99         <action id="macos-res-install" cond="TOOLKIT=='MAC'">
100             <dependency-of>install</dependency-of>
101             <depends>macos-res</depends>
102             <command>
103                 $(INSTALL_DATA) $(MACOS_R) $(LIBDIR)
104                 $(INSTALL_DATA) $(MACOS_RSRC) $(LIBDIR)
105             </command>
106         </action>
107         <action id="cocoa-res" cond="TOOLKIT=='COCOA'">
108             <dependency-of>all</dependency-of>
109             <set var="__targetname">$(MACOS_R)</set>
110             <command>
111                 $(RESCOMP) -d __UNIX__ -useDF $(top_srcdir)/src/cocoa/dummy.r -o $(MACOS_RSRC)
112                 $(DEREZ) $(MACOS_RSRC) -useDF >$(MACOS_R)
113             </command>
114             <clean-files>$(MACOS_RSRC) $(MACOS_R)</clean-files>
115         </action>
116         <action id="cocoa-res-install" cond="TOOLKIT=='COCOA'">
117             <dependency-of>install</dependency-of>
118             <depends>macos-res</depends>
119             <command>
120                 $(INSTALL_DATA) $(MACOS_R) $(LIBDIR)
121                 $(INSTALL_DATA) $(MACOS_RSRC) $(LIBDIR)
122             </command>
123         </action>
124
125     </if>
126
127
128     <!-- copy setup.h on Windows: -->    
129     <if cond="FORMAT!='autoconf' and TOOLKIT=='MSW'">
130         <mkdir id="libdir">
131             <dir>$(LIBDIRNAME)</dir>
132         </mkdir>
133         <mkdir id="libdir_setup">
134             <depends>libdir</depends>
135             <dir>$(SETUPHDIR)</dir>            
136         </mkdir>
137         <mkdir id="libdir_setup_wx">
138             <depends>libdir_setup</depends>
139             <dependency-of>setup_h</dependency-of>
140             <dir>$(SETUPHDIR)/wx</dir>            
141         </mkdir>
142
143         <set var="SETUP_H_SUBDIR">
144             <if cond="WXUNIV=='1'">univ</if>
145             <if cond="WXUNIV=='0'">msw</if>
146         </set>
147         
148         <copy-file-to-file-if-not-exist id="master_setup.h">
149             <src>$(SRCDIR)/include/wx/$(SETUP_H_SUBDIR)/setup0.h</src>
150             <dst>$(SRCDIR)/include/wx/$(SETUP_H_SUBDIR)/setup.h</dst>
151             <dependency-of>setup_h</dependency-of>
152         </copy-file-to-file-if-not-exist>
153         <copy-file-to-file-if-not-exist id="setup.h">
154             <dependency-of>setup_h</dependency-of>
155             <src>$(SRCDIR)/include/wx/$(SETUP_H_SUBDIR)/setup.h</src>
156             <dst>$(SETUPHDIR)/wx/setup.h</dst>
157         </copy-file-to-file-if-not-exist>
158
159     </if>
160
161
162     <if cond="FORMAT=='autoconf'">
163
164         <!-- Show this banner after installation: -->
165         <modify-target target="install">
166             <command>
167 @echo " "
168 @echo " ------------------------------------------------------"
169 @echo " "
170 @echo " The installation of wxWindows is finished.  On certain"
171 @echo " platforms (e.g. Linux) you'll now have to run ldconfig"
172 @echo " if you installed a shared library and also modify the"
173 @echo " LD_LIBRARY_PATH (or equivalent) environment variable."
174 @echo " "
175 @echo " wxWindows comes with no guarantees and doesn't claim"
176 @echo " to be suitable for any purpose."
177 @echo " "
178 @echo " Read the wxWindows Licence on licencing conditions."
179 @echo " "
180 @echo " ------------------------------------------------------"
181 @echo " "
182             </command>
183         </modify-target>
184
185         <!-- add "make dist" target to autoconf: -->
186         <set var="VARS_DONT_ELIMINATE" append="1">
187             ALL_BASE_SOURCES WX_VERSION
188         </set>
189         <fragment format="autoconf" file="make_dist.mk"/>
190
191     </if>
192         
193     <include file="build_cfg.bkl"/>
194
195 </makefile>