]> git.saurik.com Git - wxWidgets.git/commitdiff
Better uninstall handling and some other tweaks
authorRobin Dunn <robin@alldunn.com>
Thu, 26 Aug 1999 04:05:01 +0000 (04:05 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 26 Aug 1999 04:05:01 +0000 (04:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/wxPython/distrib/build.py
utils/wxPython/modules/glcanvas/build.cfg

index f56df7c7461341857d1a653b4c7b53ee7b252825..02b3673c8ff4a43b33cbbba84c007dfbfa2f867e 100755 (executable)
@@ -257,6 +257,9 @@ class BuildConfig:
             self.RESFILE = ''
             self.RESRULE = ''
             self.OVERRIDEFLAGS = '/GX-'
+            self.RMCMD  = '-erase '
+            self.WXPSRCDIR = os.path.normpath(self.WXPSRCDIR)
+
 
         else:
             self.MAKE      = 'make'
@@ -273,6 +276,7 @@ class BuildConfig:
                           '-I$(WXPSRCDIR)'
             self.LFLAGS = '-L$(WXPSRCDIR) `wx-config --libs`'
             self.LIBS   = '-l$(HELPERLIB)'
+            self.RMCMD  = '-rm -f '
 
             # **** What to do when I start supporting Motif, etc.???
             self.GENCODEDIR = 'gtk'
@@ -366,6 +370,14 @@ class BuildConfig:
         self.PYMODULES = splitlines(swapslash(pymodules))
 
 
+        # now make a list of the python files that would need uninstalled
+        pycleanup = ""
+        for name in self.SWIGFILES:
+            pycleanup = pycleanup + self.makeCleanupList(name)
+        for name in self.PYFILES:
+            pycleanup = pycleanup + self.makeCleanupList(name)
+        self.PYCLEANUP = swapslash(pycleanup)
+
 
         # finally, build the makefile
         if sys.platform == 'win32':
@@ -383,6 +395,16 @@ class BuildConfig:
         print "Makefile created: ", self.MAKEFILE
 
 
+
+    #------------------------------------------------------------
+    def makeCleanupList(self, name):
+        st = ""
+        st = st + '\t%s$(TARGETDIR)\\%s.py\n' % (self.RMCMD, os.path.splitext(name)[0])
+        st = st + '\t%s$(TARGETDIR)\\%s.pyc\n' % (self.RMCMD, os.path.splitext(name)[0])
+        st = st + '\t%s$(TARGETDIR)\\%s.pyo\n' % (self.RMCMD, os.path.splitext(name)[0])
+        return st
+
+
     #------------------------------------------------------------
     def readConfigFiles(self, args):
         return self.processFile(self.bldCfg, 1) and \
@@ -433,6 +455,7 @@ class BuildConfig:
 
 
 
+#----------------------------------------------------------------------------
 #----------------------------------------------------------------------------
 #----------------------------------------------------------------------------
 
@@ -516,7 +539,8 @@ clean:
 
 uninstall:
        -erase $(TARGETDIR)\\$(TARGET)
-       -erase $(PYMODULES)
+%(PYCLEANUP)s
+
 
 #----------------------------------------------------------------------
 # implicit rule for compiling .cpp and .c files
@@ -652,12 +676,12 @@ endif
 install: $(TARGETDIR) $(TARGETDIR)/$(TARGET) pycfiles %(OTHERINSTALLTARGETS)s
 
 clean:
-       -rm -f *.o *.so *~
+       -rm -f *.o *$(SO) *~
        -rm -f $(TARGET)
 
 uninstall:
        -rm -f $(TARGETDIR)/$(TARGET)
-       -rm -f $(PYMODULES)
+%(PYCLEANUP)s
 
 
 #----------------------------------------------------------------------
index f9bcc56d487509f4b12c34c7eb20736c994f8bce..fb9ad4b057200a4cd90a8764e6df54812dbff5a6 100644 (file)
@@ -13,7 +13,8 @@ if sys.platform == 'win32':
     OTHERLIBS = '$(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib'
 else:
     SOURCES = [GENCODEDIR+'/_glcanvas.cpp']
-    print "Warning: assuming MesaGL libraries. Override OTHERLIBS in build.local if you have native GL!"
+    print "Warning: Assuming MesaGL libraries. Override OTHERLIBS in build.local\n"\
+          "         if you have native GL!"
     OTHERLIBS = "-lMesaGL -lMesaGLU"
     OTHERRULES = """
 $(GENCODEDIR)/_glcanvas.cpp :