Better uninstall handling and some other tweaks
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		| @@ -257,6 +257,9 @@ class BuildConfig: | |||||||
|             self.RESFILE = '' |             self.RESFILE = '' | ||||||
|             self.RESRULE = '' |             self.RESRULE = '' | ||||||
|             self.OVERRIDEFLAGS = '/GX-' |             self.OVERRIDEFLAGS = '/GX-' | ||||||
|  |             self.RMCMD  = '-erase ' | ||||||
|  |             self.WXPSRCDIR = os.path.normpath(self.WXPSRCDIR) | ||||||
|  |  | ||||||
|  |  | ||||||
|         else: |         else: | ||||||
|             self.MAKE      = 'make' |             self.MAKE      = 'make' | ||||||
| @@ -273,6 +276,7 @@ class BuildConfig: | |||||||
|                           '-I$(WXPSRCDIR)' |                           '-I$(WXPSRCDIR)' | ||||||
|             self.LFLAGS = '-L$(WXPSRCDIR) `wx-config --libs`' |             self.LFLAGS = '-L$(WXPSRCDIR) `wx-config --libs`' | ||||||
|             self.LIBS   = '-l$(HELPERLIB)' |             self.LIBS   = '-l$(HELPERLIB)' | ||||||
|  |             self.RMCMD  = '-rm -f ' | ||||||
|  |  | ||||||
|             # **** What to do when I start supporting Motif, etc.??? |             # **** What to do when I start supporting Motif, etc.??? | ||||||
|             self.GENCODEDIR = 'gtk' |             self.GENCODEDIR = 'gtk' | ||||||
| @@ -366,6 +370,14 @@ class BuildConfig: | |||||||
|         self.PYMODULES = splitlines(swapslash(pymodules)) |         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 |         # finally, build the makefile | ||||||
|         if sys.platform == 'win32': |         if sys.platform == 'win32': | ||||||
| @@ -383,6 +395,16 @@ class BuildConfig: | |||||||
|         print "Makefile created: ", self.MAKEFILE |         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): |     def readConfigFiles(self, args): | ||||||
|         return self.processFile(self.bldCfg, 1) and \ |         return self.processFile(self.bldCfg, 1) and \ | ||||||
| @@ -433,6 +455,7 @@ class BuildConfig: | |||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | #---------------------------------------------------------------------------- | ||||||
| #---------------------------------------------------------------------------- | #---------------------------------------------------------------------------- | ||||||
| #---------------------------------------------------------------------------- | #---------------------------------------------------------------------------- | ||||||
|  |  | ||||||
| @@ -516,7 +539,8 @@ clean: | |||||||
|  |  | ||||||
| uninstall: | uninstall: | ||||||
| 	-erase $(TARGETDIR)\\$(TARGET) | 	-erase $(TARGETDIR)\\$(TARGET) | ||||||
| 	-erase $(PYMODULES) | %(PYCLEANUP)s | ||||||
|  |  | ||||||
|  |  | ||||||
| #---------------------------------------------------------------------- | #---------------------------------------------------------------------- | ||||||
| # implicit rule for compiling .cpp and .c files | # implicit rule for compiling .cpp and .c files | ||||||
| @@ -652,12 +676,12 @@ endif | |||||||
| install: $(TARGETDIR) $(TARGETDIR)/$(TARGET) pycfiles %(OTHERINSTALLTARGETS)s | install: $(TARGETDIR) $(TARGETDIR)/$(TARGET) pycfiles %(OTHERINSTALLTARGETS)s | ||||||
|  |  | ||||||
| clean: | clean: | ||||||
| 	-rm -f *.o *.so *~ | 	-rm -f *.o *$(SO) *~ | ||||||
| 	-rm -f $(TARGET) | 	-rm -f $(TARGET) | ||||||
|  |  | ||||||
| uninstall: | uninstall: | ||||||
| 	-rm -f $(TARGETDIR)/$(TARGET) | 	-rm -f $(TARGETDIR)/$(TARGET) | ||||||
| 	-rm -f $(PYMODULES) | %(PYCLEANUP)s | ||||||
|  |  | ||||||
|  |  | ||||||
| #---------------------------------------------------------------------- | #---------------------------------------------------------------------- | ||||||
|   | |||||||
| @@ -13,7 +13,8 @@ if sys.platform == 'win32': | |||||||
|     OTHERLIBS = '$(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib' |     OTHERLIBS = '$(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib' | ||||||
| else: | else: | ||||||
|     SOURCES = [GENCODEDIR+'/_glcanvas.cpp'] |     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" |     OTHERLIBS = "-lMesaGL -lMesaGLU" | ||||||
|     OTHERRULES = """ |     OTHERRULES = """ | ||||||
| $(GENCODEDIR)/_glcanvas.cpp : | $(GENCODEDIR)/_glcanvas.cpp : | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user