gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] libvob ./Makefile ./rules.mk bench/mark.py doc/...


From: Tuomas J. Lukka
Subject: [Gzz-commits] libvob ./Makefile ./rules.mk bench/mark.py doc/...
Date: Fri, 04 Apr 2003 07:35:00 -0500

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Tuomas J. Lukka <address@hidden>        03/04/04 07:34:59

Modified files:
        .              : Makefile rules.mk 
        bench          : mark.py 
        doc/pegboard/vobscene_recursion--tjl: peg.rst 
        include/vob    : Templates.hxx Transform.hxx 
        include/vob/geom: Quadrics.hxx 
        include/vob/jni: Define.hxx Generate.hxx Types.hxx 
        include/vob/trans: DisablablePrimitives.hxx Primitives.hxx 
        include/vob/vobs: Text.hxx Trivial.hxx 
        org/nongnu/libvob/buoy: buoymanager.py 
        src/jni        : Gen.cxx Makefile Makefile-Gen 
Added files:
        bench/vob/trans: __init__.py trivial.py 
        include/vob/trans: leaf.hxx 
        org/nongnu/libvob/demo: fisheye.py 
        src/jni        : Generator.cxx Generator.hxx GeneratorMain.cxx 

Log message:
        Build system redone faster - optimization now enabled by default

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/Makefile.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/rules.mk.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/bench/mark.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/bench/vob/trans/__init__.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/bench/vob/trans/trivial.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/Templates.hxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/Transform.hxx.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/geom/Quadrics.hxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/jni/Define.hxx.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/jni/Generate.hxx.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/jni/Types.hxx.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/trans/leaf.hxx?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/trans/DisablablePrimitives.hxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/trans/Primitives.hxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Text.hxx.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Trivial.hxx.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/buoy/buoymanager.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/demo/fisheye.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Generator.cxx?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Generator.hxx?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/GeneratorMain.cxx?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Gen.cxx.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Makefile.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Makefile-Gen.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: libvob/Makefile
diff -u libvob/Makefile:1.23 libvob/Makefile:1.24
--- libvob/Makefile:1.23        Wed Apr  2 02:34:29 2003
+++ libvob/Makefile     Fri Apr  4 07:34:59 2003
@@ -27,6 +27,7 @@
        make -C src/jni -f Makefile-Gen 
 
 jni: src/jni java
+       make -C src/jni javahs
        make -C src/jni jnilib
 
 subdirs: $(SUBDIRS)
@@ -58,6 +59,8 @@
        find -name "*.generated.*"|xargs rm -f
        find -name "*.o" |xargs rm -f
        find -name "*.class" |xargs rm -f
+       find -name "*.transjniobj" |xargs rm -f
+       find -name "*.vobjniobj" |xargs rm -f
        rm -rf CLASSES
 
 
Index: libvob/bench/mark.py
diff -u libvob/bench/mark.py:1.3 libvob/bench/mark.py:1.4
--- libvob/bench/mark.py:1.3    Tue Apr  1 14:37:25 2003
+++ libvob/bench/mark.py        Fri Apr  4 07:34:59 2003
@@ -55,10 +55,10 @@
        total = 0
        iters = 1
        while total < 1.7:
+           iters *= 2
            total = win.timeRender(vs, 1, iters) 
            ms = total / iters * 1000
            # print "Now: ",iters,total,ms
-           iters *= 2
        print ms, "ms   with ",iters," in ",total,"\n"
 
 if __name__ == "__main__":
@@ -72,7 +72,9 @@
        vob.util.dbg.option(o,a)
 
     # testmod = "bench.vob.text.overhead"
-    testmod = "bench.vob.paper.dice"
+    # testmod = "bench.vob.paper.dice"
+    # testmod = "bench.vob.trans.trivial"
+    testmod = "bench.vob."+args[0]
     exec "import "+testmod+"\ntestmod = "+testmod+"\n"
 
     print "TESTMOD: ",testmod
Index: libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst
diff -u libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst:1.1 
libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst:1.2
--- libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst:1.1     Mon Mar 31 
05:00:04 2003
+++ libvob/doc/pegboard/vobscene_recursion--tjl/peg.rst Fri Apr  4 07:34:59 2003
@@ -3,8 +3,8 @@
 =============================================================
 
 :Author:   Tuomas J. Lukka
-:Last-Modified: $Date: 2003/03/31 10:00:04 $
-:Revision: $Revision: 1.1 $
+:Last-Modified: $Date: 2003/04/04 12:34:59 $
+:Revision: $Revision: 1.2 $
 :Status:   Incomplete
 
 Performance problems in PP show that we should soon make a big
@@ -78,6 +78,17 @@
 
 - Should the child vobscene define the number of coordsys 
   in the beginning to replace with coordsys from the parent?
+
+- What about coordinate system 0? Should it be special in the child
+  and always correspond to cs 0 of the parent (i.e. unit transformation)?
+  This is made problematic by the twim roles of coordinate system 0:
+  on the one hand, it's the "root" coordinate system,
+  on the other hand, it's the "no transofrmation" coordinate system.
+
+    RESOLVED: It should be special. However, we should start a new
+    convention: coordinate system **1** is the "root" coordinate system,
+    and **0** remains the "identity" coordinate system.
+
 
 - How do we get the coordinate systems into the child vobscene? 
 
Index: libvob/include/vob/Templates.hxx
diff -u libvob/include/vob/Templates.hxx:1.1 
libvob/include/vob/Templates.hxx:1.2
--- libvob/include/vob/Templates.hxx:1.1        Thu Feb 27 00:32:19 2003
+++ libvob/include/vob/Templates.hxx    Fri Apr  4 07:34:59 2003
@@ -39,6 +39,23 @@
     template <int v> struct Int2Type {
        enum { value = v } ;
     };
+
+    /** A class which is either empty or contains one
+     * instance of the other class, depending on the boolean.
+     * Used in code :generation.
+     */
+    template <bool really, class C> class IfTempl {
+    };
+
+    template <class C> struct IfTempl<true, C> {
+       C c;
+       template<class T> IfTempl(T t) : c(t) { }
+       template<class T, class U> IfTempl(T t, U u) : c(t, u) { }
+    };
+    template <class C> struct IfTempl<false, C> {
+       template<class T> IfTempl(T t) { }
+       template<class T, class U> IfTempl(T t, U u) { }
+    };
 }
 }
 
Index: libvob/include/vob/Transform.hxx
diff -u libvob/include/vob/Transform.hxx:1.11 
libvob/include/vob/Transform.hxx:1.12
--- libvob/include/vob/Transform.hxx:1.11       Tue Apr  1 10:06:52 2003
+++ libvob/include/vob/Transform.hxx    Fri Apr  4 07:34:59 2003
@@ -31,6 +31,8 @@
 
 namespace Vob {
 
+#define ATTR(c)  __attribute__(c)
+
     /** A single "final" (i.e. composited) transform, possibly defined
      * hierarchically through primitive transforms.
      * This is the <b>external</b> coordsys interface
@@ -54,7 +56,7 @@
         * this to return e.g. a color in the ZPt always,
         * without regard to the parameter.
         */
-       virtual ZPt transform(const ZPt &p) const = 0;
+       virtual ZPt transform(const ZPt &p) const ATTR((pure)) = 0;
 
        /** Call glVertex with the given ZPt transformed
         * into this coordinate system.
@@ -63,7 +65,7 @@
 
        /** Whether the transformation is nonlinear.
         */
-       virtual bool isNonlinear() const = 0;
+       virtual bool isNonlinear() const ATTR((pure)) = 0;
 
        /** How nonlinear is the coordinate system at the given point.
         * The return value is 1/l where l would be a reasonable length 
@@ -71,14 +73,14 @@
         * Returns 0 if dicing is not required.
         * XXX This needs more thought.
         */
-       virtual float nonlinearity(const ZPt &p, float radius) const = 0; 
+       virtual float nonlinearity(const ZPt &p, float radius) const 
ATTR((pure)) = 0; 
 
        /** Whether this transformation can be performed by OpenGL
         * alone. If true, calling performGL allows the caller
         * to use plain glVertex calls to place vertices using this
         * transform.
         */
-       virtual bool canPerformGL() const = 0;
+       virtual bool canPerformGL() const ATTR((pure)) = 0;
 
        /** Try to perform the GL operations to set this
         * coordinate system in the current matrix.
@@ -119,7 +121,7 @@
         *
         * NOTE: Must be implemented also at GLVobCoorder.java.
         */
-       virtual Pt getSqSize() const = 0;
+       virtual Pt getSqSize() const ATTR((pure)) = 0;
     };
 
     /** A null transformation: directly the OpenGL coordinates.
Index: libvob/include/vob/geom/Quadrics.hxx
diff -u libvob/include/vob/geom/Quadrics.hxx:1.1 
libvob/include/vob/geom/Quadrics.hxx:1.2
--- libvob/include/vob/geom/Quadrics.hxx:1.1    Tue Apr  1 07:53:56 2003
+++ libvob/include/vob/geom/Quadrics.hxx        Fri Apr  4 07:34:59 2003
@@ -13,7 +13,7 @@
      * @param rad The radius of the circle
      * @return The projected point, or if not possible, the original pt.
      */
-    Vec project2circle(Vec pt, Vec p, Vec ctr, float rad) {
+    inline Vec project2circle(Vec pt, Vec p, Vec ctr, float rad) {
        Vec ao = pt - ctr;
        Vec ap = pt - p;
 
Index: libvob/include/vob/jni/Define.hxx
diff -u libvob/include/vob/jni/Define.hxx:1.7 
libvob/include/vob/jni/Define.hxx:1.8
--- libvob/include/vob/jni/Define.hxx:1.7       Thu Mar 27 06:11:24 2003
+++ libvob/include/vob/jni/Define.hxx   Fri Apr  4 07:34:59 2003
@@ -24,6 +24,8 @@
  * Written by Tuomas J. Lukka
  */
 
+#ifndef VOB_JNI_DEFINE_HXX
+#define VOB_JNI_DEFINE_HXX
 
 #include <boost/preprocessor/repetition/enum.hpp>
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
@@ -36,8 +38,10 @@
 #include <jni.h>
 
 #include <vob/Vob.hxx>
+#include <vob/trans/Primitives.hxx>
 
 namespace Vob {
+    using Primitives::HierarchicalTransform;
 namespace JNI {
 
     template<class T> class JParameter ;
@@ -68,5 +72,23 @@
 
     };
 
+
+    typedef HierarchicalTransform *(*HierarchicalTransformFactory)();
+
+    template<class T> HierarchicalTransform *HierFactImpl() {
+       return new Primitives::PrimitiveHierarchicalTransform<T>();
+    }
+
+    template<class T> class HierFact {
+    public:
+       HierFact(int id) {
+           transFactories[id] = HierFactImpl<T>;
+       }
+    };
+
+
 }
 }
+
+
+#endif
Index: libvob/include/vob/jni/Generate.hxx
diff -u libvob/include/vob/jni/Generate.hxx:1.18 
libvob/include/vob/jni/Generate.hxx:1.19
--- libvob/include/vob/jni/Generate.hxx:1.18    Tue Apr  1 06:03:54 2003
+++ libvob/include/vob/jni/Generate.hxx Fri Apr  4 07:34:59 2003
@@ -53,8 +53,12 @@
 #include <vob/trans/Primitives.hxx>
 #include <vob/Transform.hxx>
 
+#include <vob/Templates.hxx>
+
 #include <vob/jni/Types.hxx>
 
+extern int getTransId() ;
+
 namespace Vob {
 namespace JNI {
 
@@ -126,7 +130,7 @@
        }
 
        VobJNIGenerator(std::string name) {
-           std::cout << name << "|" ;
+           std::cout << "\t" << name << "\n" ;
            VobJavaParamList pl;
            VobSeed().params(pl);
 
@@ -173,14 +177,13 @@
 
     };
 
-    static int index;
 
     template<class Primitive> struct TransJNIGenerator {
        int ind;
        Primitives::PrimitiveHierarchicalTransform<Primitive> hier;
 
        TransJNIGenerator(std::string className, std::string methodName) {
-           ind = index++;
+           ind = getTransId();
            VOB_TRANSJAVASTREAM << "public int "<<methodName
                        <<"(int d0 ";
            for(int i=1; i<hier.getNDepends(); i++) {
@@ -215,8 +218,8 @@
 
            VOB_TRANSJAVASTREAM << "}\n";
 
-           VOB_TRANSCSTREAM << " case "<<ind<<": \n"
-                   << "\t\tTRANSTYPE("<<className<<");break;\n";
+           VOB_JNISTREAM << "static HierFact<"<<className<<"> "
+               << className<<"__fac("<<ind<<");\n";
 
 
            if(hier.getNParams() > 0) {
@@ -238,13 +241,14 @@
 }
 
 #define VOB_DEFINED(x)  \
-    JNI::VobJNIGenerator<x> x##generator(#x);
+static Templates::IfTempl<!VOB_NON_LEAF, JNI::VobJNIGenerator<x> > 
x##generator(#x);
 
 
 #define VOB_PRIMITIVETRANS_DEFINED(x, n)  \
-    JNI::TransJNIGenerator<x> x##generator(#x, n);
-
-
+static Templates::IfTempl<!VOB_NON_LEAF, JNI::TransJNIGenerator<x> > 
x##generator(#x, n);
 
+#ifndef VOB_NON_LEAF
+#define VOB_NON_LEAF 0
+#endif
 
 #endif
Index: libvob/include/vob/jni/Types.hxx
diff -u libvob/include/vob/jni/Types.hxx:1.18 
libvob/include/vob/jni/Types.hxx:1.19
--- libvob/include/vob/jni/Types.hxx:1.18       Wed Mar 26 09:00:42 2003
+++ libvob/include/vob/jni/Types.hxx    Fri Apr  4 07:34:59 2003
@@ -23,6 +23,8 @@
 /*
  * Written by Tuomas J. Lukka
  */
+#ifndef VOB_JNI_TYPES_HXX
+#define VOB_JNI_TYPES_HXX
 
 #include <jni.h>
 
@@ -40,6 +42,10 @@
 
 
 namespace Vob {
+    namespace Primitives {
+    }
+    namespace Vobs {
+    }
 namespace JNI {
     PREDBGVAR(dbg);
     PREDBGVAR(dbg_convert);
@@ -191,3 +197,5 @@
 
 }
 }
+
+#endif
Index: libvob/include/vob/trans/DisablablePrimitives.hxx
diff -u libvob/include/vob/trans/DisablablePrimitives.hxx:1.1 
libvob/include/vob/trans/DisablablePrimitives.hxx:1.2
--- libvob/include/vob/trans/DisablablePrimitives.hxx:1.1       Tue Apr  1 
06:03:54 2003
+++ libvob/include/vob/trans/DisablablePrimitives.hxx   Fri Apr  4 07:34:59 2003
@@ -34,7 +34,11 @@
 #include <GL/gl.h>
 
 #include <vob/trans/Primitives.hxx>
-#include <vob/trans/LinearPrimitives.hxx>
+
+#undef F
+#define F <vob/trans/LinearPrimitives.hxx> 
+#include <vob/trans/leaf.hxx>
+
 #include <vob/Debug.hxx>
 
 namespace Vob {
Index: libvob/include/vob/trans/Primitives.hxx
diff -u libvob/include/vob/trans/Primitives.hxx:1.2 
libvob/include/vob/trans/Primitives.hxx:1.3
--- libvob/include/vob/trans/Primitives.hxx:1.2 Tue Apr  1 10:06:52 2003
+++ libvob/include/vob/trans/Primitives.hxx     Fri Apr  4 07:34:59 2003
@@ -253,6 +253,7 @@
        virtual void setParams(const Transform **depends, float *p) = 0;
     };
 
+
     /** A hierarchical transformation, which applies the 
      * template argument primitive transformation to the result
      * of the parent transform.
Index: libvob/include/vob/vobs/Text.hxx
diff -u libvob/include/vob/vobs/Text.hxx:1.3 
libvob/include/vob/vobs/Text.hxx:1.4
--- libvob/include/vob/vobs/Text.hxx:1.3        Wed Mar 19 00:44:53 2003
+++ libvob/include/vob/vobs/Text.hxx    Fri Apr  4 07:34:59 2003
@@ -3,6 +3,9 @@
 #ifndef VOB_VOBS_TEXT_HXX
 #define VOB_VOBS_TEXT_HXX
 
+#ifndef VOB_DEFINED
+#define VOB_DEFINED(x)
+#endif
 
 #include <GLMosaicText.hxx>
 #include <vob/Types.hxx>
Index: libvob/include/vob/vobs/Trivial.hxx
diff -u libvob/include/vob/vobs/Trivial.hxx:1.12 
libvob/include/vob/vobs/Trivial.hxx:1.13
--- libvob/include/vob/vobs/Trivial.hxx:1.12    Wed Mar 26 08:39:16 2003
+++ libvob/include/vob/vobs/Trivial.hxx Fri Apr  4 07:34:59 2003
@@ -31,6 +31,7 @@
 #include <vob/Types.hxx>
 
 #include <vob/Vec23.hxx>
+#include <vob/VecGL.hxx>
 
 
 #ifndef VOB_DEFINED
@@ -112,6 +113,51 @@
 };
 VOB_DEFINED(CallListBoxCoorded);
 
+struct TransTest {
+    enum { NTrans = 1 };
+
+    int npoints;
+    int flags; // 1 == call transform(), 2 == call glVertex after transform
+
+    ZPt *points;
+
+    TransTest() : points(0) {
+    }
+    ~TransTest() {
+       if(points) delete[] points;
+    }
+
+    template<class F> void params(F &f) {
+       npoints = 0;
+       if(points) delete[] points;
+       f(npoints, flags);
+       points = new ZPt[npoints];
+       for(int i=0; i<npoints; i++) 
+           points[i] = ZPt(0,0,0);
+    }
+
+    template<class T> void render(const T &t) const {
+       ZPt *p = points;
+       if(flags & 1) {
+           for(int i=0; i<npoints; i++)
+               p[i] = t.transform(p[i]);
+           if(flags & 2) {
+               for(int i=0; i<npoints; i++)
+                   VecGL::glVertex(p[i]);
+           }
+       }
+       else {
+           glBegin(GL_TRIANGLE_FAN);
+           for(int i=0; i<npoints; i++)
+               t.vertex(p[i]);
+           glEnd();
+       }
+    }
+
+};
+
+
+VOB_DEFINED(TransTest);
 
 }}
 
Index: libvob/org/nongnu/libvob/buoy/buoymanager.py
diff -u libvob/org/nongnu/libvob/buoy/buoymanager.py:1.4 
libvob/org/nongnu/libvob/buoy/buoymanager.py:1.5
--- libvob/org/nongnu/libvob/buoy/buoymanager.py:1.4    Thu Mar 27 06:22:38 2003
+++ libvob/org/nongnu/libvob/buoy/buoymanager.py        Fri Apr  4 07:34:59 2003
@@ -160,11 +160,10 @@
             self.animationCS_main = None
 
     def key(self, key):
-        if key == "Ctrl-H":
-            import org
-            org.fenfire.util.PageSpanPaper.withHalo = not 
org.fenfire.util.PageSpanPaper.withHalo 
         if key == "Print":
             saveanim.saveframe("buoyoing.png", w)
+       else:
+           self.mainNode.keystroke(key)
             
        vob.AbstractUpdateManager.chg()
        pass
Index: libvob/rules.mk
diff -u libvob/rules.mk:1.8 libvob/rules.mk:1.9
--- libvob/rules.mk:1.8 Mon Mar 24 14:03:30 2003
+++ libvob/rules.mk     Fri Apr  4 07:34:59 2003
@@ -1,6 +1,6 @@
 GCCVER=3.2
 
-.SUFFIXES: $(SUFFIXES) .dep .cxx
+.SUFFIXES: $(SUFFIXES) .dep .cxx .vobgenobj .transgenobj .vobdep .transdep 
.vobjniobj .transjniobj .vobgenjni .transgenjni
 
 CXX=g++-$(GCCVER)
 CXXLINK=gcc-$(GCCVER)
@@ -8,8 +8,8 @@
 # Choose architecture
 ARCH=-march=pentium4 -mfpmath=sse -msse2
 
-# OPTIMIZE =  -O3 -ffast-math $(ARCH) -fomit-frame-pointer 
-foptimize-sibling-calls
-OPTIMIZE = -O0
+OPTIMIZE =  -O3 -ffast-math $(ARCH) -fomit-frame-pointer 
-foptimize-sibling-calls
+# OPTIMIZE = -O0
 
 CPPFLAGS = -I../include -I../../libvob-depends -I../../include $(EXTRAINCLUDE) 
-I../../callgl/include -I../../../callgl/include 
-I../../callgl/include/glwrapper -I../../../callgl/include/glwrapper 
-I../../glmosaictext/include -I../../../glmosaictext/include 
-I/usr/include/freetype2 `gdk-pixbuf-config --cflags`
 CXXFLAGS = -g -Wall $(OPTIMIZE) $(CPPFLAGS) 
@@ -26,3 +26,7 @@
 
 %.o: %.cxx
        $(CXX) -c $(CXXFLAGS) -o $@ $<
+%.transjniobj: %.transgenjni
+       $(CXX) -c $(CXXFLAGS) -o $@ -x c++ $<
+%.vobjniobj: %.vobgenjni
+       $(CXX) -c $(CXXFLAGS) -o $@ -x c++ $<
Index: libvob/src/jni/Gen.cxx
diff -u libvob/src/jni/Gen.cxx:1.14 libvob/src/jni/Gen.cxx:1.15
--- libvob/src/jni/Gen.cxx:1.14 Sun Mar 16 12:58:49 2003
+++ libvob/src/jni/Gen.cxx      Fri Apr  4 07:34:59 2003
@@ -26,15 +26,6 @@
 
 #define VOB_JAVAPREFIX "Java_org_nongnu_libvob_gl_GLRen_"
 
-#include <iostream>
-#include <sstream>
-#include <fstream>
-
-std::ostringstream VOB_JNISTREAM;
-std::ostringstream VOB_JAVASTREAM;
-std::ostringstream VOB_TRANSJAVASTREAM;
-std::ostringstream VOB_TRANSCSTREAM;
-
 #include <vob/jni/Generate.hxx>
 #include "jnivobs.hxx"
 
Index: libvob/src/jni/Makefile
diff -u libvob/src/jni/Makefile:1.22 libvob/src/jni/Makefile:1.23
--- libvob/src/jni/Makefile:1.22        Tue Apr  1 06:03:54 2003
+++ libvob/src/jni/Makefile     Fri Apr  4 07:34:59 2003
@@ -1,6 +1,13 @@
 include ../../rules.mk
+include Modules
+
+
+VOB_OBJS = $(VOBS:%=%.vobjniobj)
+TRANS_OBJS = $(TRANS:%=%.transjniobj)
+
+sources = TransFactory.cxx Main.cxx Strings.cxx Transform.cxx Render.cxx 
Font.cxx Paper.cxx
+
 
-sources = GLRen.gen.cxx Main.cxx Strings.cxx Transform.cxx Render.cxx Font.cxx 
Paper.cxx
 
 CALLGL=../../../callgl
 CALLGLOBJS=$(CALLGL)/src/glwrapper/GL_wrapper.o $(CALLGL)/src/callgl.o
@@ -16,9 +23,9 @@
 
 MAINOBJS=../main/Renderer.o
 
-OBJS= GLRen.gen.o Main.o Strings.o Transform.o Render.o Font.o Paper.o 
+OBJS= $(sources:%.cxx=%.o)
 
-JNIOBJS=$(OBJS) $(OSOBJS) $(TEXTUREOBJS) $(UTILOBJS) $(CALLGLOBJS) 
$(TRANSOBJS) $(MAINOBJS) $(GLMOSAICTEXTOBJS) $(PAPEROBJS)
+JNIOBJS=$(OBJS) $(VOB_OBJS) $(TRANS_OBJS) $(OSOBJS) $(TEXTUREOBJS) $(UTILOBJS) 
$(CALLGLOBJS) $(TRANSOBJS) $(MAINOBJS) $(GLMOSAICTEXTOBJS) $(PAPEROBJS)
 
 
 EXTRAINCLUDE=-I${JAVAHOME}/include -I${JAVAHOME}/include/linux 
@@ -29,23 +36,21 @@
 
 jnilib: libvobjni.so
 
-Gen: Gen.o
-       $(CXX) -o Gen Gen.o ../util/Debug.o $(LIBS)
 
-GLRen.gen.cxx: Gen GLRen.template.java
-       (cd ../..; src/jni/Gen)
 
-GLRen.gen.o: made_org_nongnu_libvob_gl_GLRen.h
-Main.o: made_org_nongnu_libvob_gl_GL.h
+GLRen.gen.o: org_nongnu_libvob_gl_GLRen.h
+Main.o: org_nongnu_libvob_gl_GL.h
 
 libvobjni.so: $(JNIOBJS) Makefile
        $(CXXLINK) -rdynamic -fpic -o libvobjni.so $(SHARED) $(CXXFLAGS) 
$(JNIOBJS) $(LIBS)
 
-$(sources:.cxx=.dep) $(OBJS): made_org_nongnu_libvob_gl_GL.h 
made_org_nongnu_libvob_gl_GLRen.h made_org_nongnu_libvob_gl_Paper.h
+$(sources:.cxx=.dep) $(OBJS): org_nongnu_libvob_gl_GL.h 
org_nongnu_libvob_gl_GLRen.h org_nongnu_libvob_gl_Paper.h
 
 include $(sources:.cxx=.dep)
 
+.PHONY: javahs
 
+javahs: made_org_nongnu_libvob_gl_GL.h made_org_nongnu_libvob_gl_GLRen.h 
made_org_nongnu_libvob_gl_Paper.h
 
 made_org_nongnu_libvob_gl_GL.h: ../../CLASSES/org/nongnu/libvob/gl/GL.class
        javah -classpath $(CLASSPATH):../../CLASSES org.nongnu.libvob.gl.GL && 
touch made_org_nongnu_libvob_gl_GL.h
Index: libvob/src/jni/Makefile-Gen
diff -u libvob/src/jni/Makefile-Gen:1.3 libvob/src/jni/Makefile-Gen:1.4
--- libvob/src/jni/Makefile-Gen:1.3     Tue Apr  1 07:53:56 2003
+++ libvob/src/jni/Makefile-Gen Fri Apr  4 07:34:59 2003
@@ -1,16 +1,48 @@
 include ../../rules.mk
+include Modules
+
+VOB_OBJS = $(VOBS:%=%.vobgenobj)
+TRANS_OBJS = $(TRANS:%=%.transgenobj)
+
+%.vobgenobj: 
+       $(CXX) -c $(CXXFLAGS) "-DC_OUTPUT_FILE=src/jni/$*.vobgenjni" 
"-DHEADER_FILE=<vob/vobs/$*.hxx>" -o $@ Generator.cxx
+
+%.vobdep: 
+       $(SHELL) -ec '$(CXX) -M $(CPPFLAGS) 
"-DC_OUTPUT_FILE=src/jni/$*.vobgenjni" "-DHEADER_FILE=<vob/vobs/$*.hxx>" 
Generator.cxx \
+                      | sed '\''s/Generator.o[ :]*/$*.vobgenobj $@ : /g'\'' > 
$@; \
+                      [ -s $@ ] || rm -f $@'
+
+
+%.transgenobj: 
+       $(CXX) -c $(CXXFLAGS) "-DC_OUTPUT_FILE=src/jni/$*.transgenjni" 
"-DHEADER_FILE=<vob/trans/$*.hxx>" -o $@ Generator.cxx
+
+%.transdep: 
+       $(SHELL) -ec '$(CXX) -M $(CPPFLAGS) -D 
"C_OUTPUT_FILE=src/jni/$*.transgenjni" -D "HEADER_FILE=<vob/trans/$*.hxx>" 
Generator.cxx \
+                      | sed '\''s/Generator.o[ :]*/$*.transgenobj $@ : /g'\'' 
> $@; \
+                      [ -s $@ ] || rm -f $@'
+
+
+
 LIBS=-lGL -lGLU -lstdc++ -lfreetype `gdk-pixbuf-config --libs`
 
-sources = Gen.cxx
+all: TransFactory.gen.hxx
+       for i in $(VOBS); do \
+           cmp $$i.vobgenjni $$i.vobgenjninew || cp $$i.vobgenjninew 
$$i.vobgenjni ;\
+       done
+       for i in $(TRANS); do \
+           cmp $$i.transgenjni $$i.transgenjninew || cp $$i.transgenjninew 
$$i.transgenjni ;\
+       done
 
-all: GLRen.gen.cxx
 
-GLRen.gen.cxx: Gen GLRen.template.java
-       (cd ../..; src/jni/Gen)
+TransFactory.gen.hxx: Generator GLRen.template.java
+       (cd ../..; src/jni/Generator)
 
 EXTRAINCLUDE=-I${JAVAHOME}/include -I${JAVAHOME}/include/linux 
 
-Gen: Gen.o
-       $(CXX) -o Gen $(CXXFLAGS) $(EXTRAINCLUDE) Gen.o ../util/Debug.o $(LIBS)
 
-include Gen.dep
+Generator: GeneratorMain.o $(VOB_OBJS) $(TRANS_OBJS)
+       $(CXX) -o Generator $(CXXFLAGS) $(EXTRAINCLUDE) GeneratorMain.cxx 
$(VOB_OBJS) $(TRANS_OBJS) ../util/Debug.o $(LIBS)
+
+
+include $(VOBS:%=%.vobdep)
+include $(TRANS:%=%.transdep)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]