]> git.saurik.com Git - wxWidgets.git/commitdiff
generate makefile.unx files using bakefile
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 10 Oct 2006 10:04:10 +0000 (10:04 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 10 Oct 2006 10:04:10 +0000 (10:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41872 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/bakefiles/Bakefiles.bkgen
build/bakefiles/common_samples.bkl
build/bakefiles/common_samples_intree.bkl [new file with mode: 0644]
build/bakefiles/common_samples_outoftree.bkl [new file with mode: 0644]
samples/db/db.bkl
samples/dialogs/dialogs.bkl
samples/opengl/cube/cube.bkl
samples/opengl/isosurf/isosurf.bkl
samples/opengl/penguin/penguin.bkl
samples/render/render.bkl

index 97c32e6071a81ea9a78745a6d8d04485a46df70a..4b93267534d39ee42c11dc98606cb35570485e0e 100644 (file)
         -DOPTIONS_FILE=../../../../build/msw/config.wat
     </add-flags>
 
+    
+    <!-- Makefiles for out-of-tree building of samples on Unix: -->
+    <add-formats files="../../samples/*/*.bkl,../../samples/*/*/*.bkl">
+        gnu
+    </add-formats>
+    <add-flags files="../../samples/*/*.bkl,../../samples/*/*/*.bkl"
+               formats="gnu">
+        -DOUT_OF_TREE_MAKEFILES=1 -o$(INPUT_FILE_DIR)/makefile.unx
+    </add-flags>
 
     <!-- Personal customizations (not in CVS): -->
     <include file="Bakefiles.local.bkgen" ignore_missing="1"/>
index 0633b53fe4af6fbf91e9af3183d4022933694d24..07889de21c43798cd6a94daa13d57b94a9272678 100644 (file)
 
 <makefile>
     
-    <include file="common.bkl"/>
     <set var="file_common_samples_included">1</set>
     
-    <!-- =============================================================== -->
-    <!--                    Template for wxWidgets samples:              -->
-    <!-- =============================================================== -->
-
-    <if cond="FORMAT=='autoconf'">
-        <set var="MACOSX_RESOURCES">
-            <if cond="TOOLKIT=='MAC'">
-                Carbon.r sample.r
-            </if>
-        </set>
+    <if cond="not isdefined('OUT_OF_TREE_MAKEFILES')">
+        <set var="OUT_OF_TREE_MAKEFILES">0</set>
     </if>
 
-    <set var="DLLFLAG">
-        <if cond="SHARED=='1'">WXUSINGDLL</if>
-    </set>
-    
-    <template id="wx_util_b" template="wx">
-        <include>$(SRCDIR)</include>
-        <define>$(DLLFLAG)</define>
-    </template>
-    
-    <template id="wx_util" template="wx_util_b">
-        <app-type>gui</app-type>
-        <mac-res cond="FORMAT=='autoconf'">$(MACOSX_RESOURCES)</mac-res>
-        <!-- resource files includes: -->
-        <include>$(SRCDIR)/$(WXTOPDIR)samples</include>
-        <!-- this include is not added via <include> for autoconf, see
-             common.bkl: -->
-        <if cond="FORMAT=='autoconf'">
-            <res-include>$(RCDEFDIR)</res-include>
-            <res-include>$(TOP_SRCDIR)include</res-include>
-        </if>
-        
-        <win32-res>$(WXTOPDIR)samples/sample.rc</win32-res>
-        <if cond="FORMAT=='autoconf'">
-            <wx-os2-lib-resource/>
-        </if>
-
-        <!-- FIXME: temporary, until bakefile can reuse existing pch files -->
-        <if cond="FORMAT!='autoconf'">
-            <define>NOPCH</define>
-        </if>
-    </template>
-    
-    <template id="wx_util_console" template="wx_util_b">
-        <app-type>console</app-type>
-        <define>wxUSE_GUI=0</define>
-    </template>
-    
-    <template id="wx_sample" template="wx_util">
-        <if cond="FORMAT=='autoconf'">
-            <wx-mac-app-bundle/>
-            <ldflags>$(SAMPLES_RPATH_FLAG)</ldflags>
-            <postlink-command>$(SAMPLES_RPATH_POSTLINK)</postlink-command>
-        </if>
-    </template>
-    <template id="wx_sample_console" template="wx_util_console">
-        <if cond="FORMAT=='autoconf'">
-            <ldflags>$(SAMPLES_RPATH_FLAG)</ldflags>
-            <postlink-command>$(SAMPLES_RPATH_POSTLINK)</postlink-command>
-        </if>
-    </template>
-    
-    
-    <!-- =============================================================== -->
-    <!--                    Support for samples data files:              -->
-    <!-- =============================================================== -->
-
-    <define-rule name="wx-data" extends="copy-files">
-        <template>
-            <dependency-of>all</dependency-of>
-            <dstdir>$(BUILDDIR)</dstdir>
-            <srcdir>$(SRCDIR)</srcdir>
-        </template>
-
-        <!--
-        VS - FIXME:
-        Don't clean the files because it would wipe out sources files if
-        BUILDDIR==SRCDIR. This is same behaviour as in the old build system,
-        but it would be better to delete the files during "make clean" if
-        BUILDDIR!=SRCDIR.
-        
-        <define-tag name="files">
-            <clean-files>
-                $(' '.join(['$(BUILDDIR)$(DIRSEP)%s'%x for x in value.split()]))
-            </clean-files>
-        </define-tag>
-        -->
-    </define-rule>
-    
-    
-    <!-- =============================================================== -->
-    <!--                    Misc platform specialities:                  -->
-    <!-- =============================================================== -->
-
-    <if cond="FORMAT=='autoconf'">
-        <include file="mac_bundles.bkl"/>
-
-        <!--
-        A hack to include precompiled OS/2 resource file in apps instead of
-        compiling it from .rc file (gcc on OS/2 doesn't ship with resource
-        compiler):
-        -->
-        <define-tag name="wx-os2-lib-resource" rules="exe">        
-            <set var="os2_lib_res">
-                <if cond="PLATFORM_OS2=='1'">
-                    $(TOP_SRCDIR)include/wx/os2/wx.res
-                </if>
-            </set>
-            <set var="__objects" append="1">$(os2_lib_res)</set>
-        </define-tag>
+    <if cond="OUT_OF_TREE_MAKEFILES=='1'">
+        <include file="common_samples_outoftree.bkl"/>
+    </if>
+    <if cond="OUT_OF_TREE_MAKEFILES=='0'">
+        <include file="common_samples_intree.bkl"/>
     </if>
-    
 
 </makefile>
diff --git a/build/bakefiles/common_samples_intree.bkl b/build/bakefiles/common_samples_intree.bkl
new file mode 100644 (file)
index 0000000..6b9b66c
--- /dev/null
@@ -0,0 +1,121 @@
+<?xml version="1.0" ?>
+<!-- $Id$ -->
+
+<makefile>
+
+    <include file="common.bkl"/>
+    
+    <!-- =============================================================== -->
+    <!--                    Template for wxWidgets samples:              -->
+    <!-- =============================================================== -->
+
+    <if cond="FORMAT=='autoconf'">
+        <set var="MACOSX_RESOURCES">
+            <if cond="TOOLKIT=='MAC'">
+                Carbon.r sample.r
+            </if>
+        </set>
+    </if>
+
+    <set var="DLLFLAG">
+        <if cond="SHARED=='1'">WXUSINGDLL</if>
+    </set>
+    
+    <template id="wx_util_b" template="wx">
+        <include>$(SRCDIR)</include>
+        <define>$(DLLFLAG)</define>
+    </template>
+    
+    <template id="wx_util" template="wx_util_b">
+        <app-type>gui</app-type>
+        <mac-res cond="FORMAT=='autoconf'">$(MACOSX_RESOURCES)</mac-res>
+        <!-- resource files includes: -->
+        <include>$(SRCDIR)/$(WXTOPDIR)samples</include>
+        <!-- this include is not added via <include> for autoconf, see
+             common.bkl: -->
+        <if cond="FORMAT=='autoconf'">
+            <res-include>$(RCDEFDIR)</res-include>
+            <res-include>$(TOP_SRCDIR)include</res-include>
+        </if>
+        
+        <win32-res>$(WXTOPDIR)samples/sample.rc</win32-res>
+        <if cond="FORMAT=='autoconf'">
+            <wx-os2-lib-resource/>
+        </if>
+
+        <!-- FIXME: temporary, until bakefile can reuse existing pch files -->
+        <if cond="FORMAT!='autoconf'">
+            <define>NOPCH</define>
+        </if>
+    </template>
+    
+    <template id="wx_util_console" template="wx_util_b">
+        <app-type>console</app-type>
+        <define>wxUSE_GUI=0</define>
+    </template>
+    
+    <template id="wx_sample" template="wx_util">
+        <if cond="FORMAT=='autoconf'">
+            <wx-mac-app-bundle/>
+            <ldflags>$(SAMPLES_RPATH_FLAG)</ldflags>
+            <postlink-command>$(SAMPLES_RPATH_POSTLINK)</postlink-command>
+        </if>
+    </template>
+    <template id="wx_sample_console" template="wx_util_console">
+        <if cond="FORMAT=='autoconf'">
+            <ldflags>$(SAMPLES_RPATH_FLAG)</ldflags>
+            <postlink-command>$(SAMPLES_RPATH_POSTLINK)</postlink-command>
+        </if>
+    </template>
+    
+    
+    <!-- =============================================================== -->
+    <!--                    Support for samples data files:              -->
+    <!-- =============================================================== -->
+
+    <define-rule name="wx-data" extends="copy-files">
+        <template>
+            <dependency-of>all</dependency-of>
+            <dstdir>$(BUILDDIR)</dstdir>
+            <srcdir>$(SRCDIR)</srcdir>
+        </template>
+
+        <!--
+        VS - FIXME:
+        Don't clean the files because it would wipe out sources files if
+        BUILDDIR==SRCDIR. This is same behaviour as in the old build system,
+        but it would be better to delete the files during "make clean" if
+        BUILDDIR!=SRCDIR.
+        
+        <define-tag name="files">
+            <clean-files>
+                $(' '.join(['$(BUILDDIR)$(DIRSEP)%s'%x for x in value.split()]))
+            </clean-files>
+        </define-tag>
+        -->
+    </define-rule>
+    
+    
+    <!-- =============================================================== -->
+    <!--                    Misc platform specialities:                  -->
+    <!-- =============================================================== -->
+
+    <if cond="FORMAT=='autoconf'">
+        <include file="mac_bundles.bkl"/>
+
+        <!--
+        A hack to include precompiled OS/2 resource file in apps instead of
+        compiling it from .rc file (gcc on OS/2 doesn't ship with resource
+        compiler):
+        -->
+        <define-tag name="wx-os2-lib-resource" rules="exe">        
+            <set var="os2_lib_res">
+                <if cond="PLATFORM_OS2=='1'">
+                    $(TOP_SRCDIR)include/wx/os2/wx.res
+                </if>
+            </set>
+            <set var="__objects" append="1">$(os2_lib_res)</set>
+        </define-tag>
+    </if>
+    
+</makefile>
diff --git a/build/bakefiles/common_samples_outoftree.bkl b/build/bakefiles/common_samples_outoftree.bkl
new file mode 100644 (file)
index 0000000..afdb4db
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" ?>
+<!-- $Id$ -->
+
+<makefile>
+    
+    <!-- =============================================================== -->
+    <!-- Templates for out-of-tree Unix makefiles for wxWidgets samples: -->
+    <!-- =============================================================== -->
+
+    <include file="wxpresets/presets/wx.bkl"/>
+
+    <template id="wx_app_base" template="wx">
+        <include>$(SRCDIR)</include>
+    </template>
+    
+    <template id="wx_util" template="wx_app_base">
+        <app-type>gui</app-type>
+    </template>
+    
+    <template id="wx_util_console" template="wx_app_base">
+        <app-type>console</app-type>
+    </template>
+    
+    <template id="wx_sample" template="wx_util"/>
+    <template id="wx_sample_console" template="wx_util_console"/>
+    
+
+    <define-rule name="wx-gui-plugin" extends="module">
+        <template template="wx_app_base"/>
+    </define-rule>
+
+
+    <!-- empty stubs for things that don't make sense for makefile.unx: -->
+    <template id="wx_append"/>
+    <template id="wx_append_base"/>
+
+    <define-rule name="wx-data" pseudo="1">
+        <define-tag name="files"/>
+        <define-tag name="dstdir"/>
+        <define-tag name="srcdir"/>
+    </define-rule>
+
+</makefile>
index bdadb27d1788ef8a54b325941382579be2447b00..22d5c339c06ae79d98216865b18582c5cc62cb98 100644 (file)
@@ -3,6 +3,10 @@
 
     <include file="../../build/bakefiles/common_samples.bkl"/>
 
+    <if cond="OUT_OF_TREE_MAKEFILES=='1'">
+        <set var="USE_ODBC">1</set>
+    </if>
+
     <exe id="dbtest" 
          cond="USE_ODBC=='1'"
          template="wx_sample" template_append="wx_append">
index 684193e7dfcaaf044c1a0e2c530cbeeed5d67ec4..d859d8075224fe412740050245a8aea1085aca98 100644 (file)
@@ -4,6 +4,9 @@
     <include file="../../build/bakefiles/common_samples.bkl"/>
 
     <set var="GENERIC_DIALOGS_IN_NATIVE_BUILDS">
+        <if cond="OUT_OF_TREE_MAKEFILES=='1'">
+            <!-- no files that are not part of the sample in this case -->
+        </if>
         <if cond="TOOLKIT=='MSW' and WXUNIV=='0' and SHARED=='0'">
             $(WXTOPDIR)src/generic/colrdlgg.cpp
             $(WXTOPDIR)src/generic/dirdlgg.cpp
index 342b43bb7a1ca0c47b159eca2139d4ec629c8e83..a391390a711d6291a6a7471cbd8a5cc5a43c939b 100644 (file)
@@ -5,6 +5,10 @@
 
     <include file="../../../build/bakefiles/common_samples.bkl"/>
 
+    <if cond="OUT_OF_TREE_MAKEFILES=='1'">
+        <set var="USE_OPENGL">1</set>
+    </if>
+
     <exe id="cube" template="wx_sample" template_append="wx_append" cond="USE_OPENGL=='1'">
         <sources>cube.cpp</sources>
         <wx-lib>gl</wx-lib>
index 05da183204ee530494498aaa98a6f3d02c291f52..3d922da7783cba423c599c0bda6929da400b4a9f 100644 (file)
@@ -5,6 +5,10 @@
 
     <include file="../../../build/bakefiles/common_samples.bkl"/>
 
+    <if cond="OUT_OF_TREE_MAKEFILES=='1'">
+        <set var="USE_OPENGL">1</set>
+    </if>
+
     <exe id="isosurf" template="wx_sample" template_append="wx_append" cond="USE_OPENGL=='1'">
         <sources>isosurf.cpp</sources>
         <wx-lib>gl</wx-lib>
index 28b64c2bae138bae443156571f779b0a4049bb01..c53872944f322fa503fe37b2a034f4da77d6763f 100644 (file)
@@ -4,6 +4,10 @@
 <makefile>
 
     <include file="../../../build/bakefiles/common_samples.bkl"/>
+    
+    <if cond="OUT_OF_TREE_MAKEFILES=='1'">
+        <set var="USE_OPENGL">1</set>
+    </if>
 
     <exe id="penguin" template="wx_sample" template_append="wx_append" cond="USE_OPENGL=='1'">
         <sources>
index 503c147147999f78f471bf9841cf755056a05fcc..d2324e13aacd203f38924fd77ab0651e2e0a7173 100644 (file)
@@ -5,6 +5,13 @@
 
     <include file="../../build/bakefiles/common_samples.bkl"/>
 
+    <if cond="OUT_OF_TREE_MAKEFILES=='1'">
+        <option name="SHARED">
+            <default-value>0</default-value>
+            <description>Build shared lib plugin</description>
+        </option>
+    </if>
+
     <exe id="render" template="wx_sample" template_append="wx_append">
         <sources>render.cpp</sources>
         <wx-lib>core</wx-lib>