Commits

pygame  committed b98b1f4

psuedo Makefile and configure

  • Participants
  • Parent commits 72a86ea

Comments (0)

Files changed (5)

+#fake Makefile for pygame, to support the common
+# ./configure;make;make install
+
+PYTHON = python
+
+build: Setup setup.py
+	$(PYTHON) setup.py build
+
+install: Setup setup.py
+	$(PYTHON) setup.py install
+
+Setup:
+	$(PYTHON) configure.py
+
+tests:
+	$(PYTHON) run_tests.py
+
+docs:	install
+	cd docs/utils
+	$(PYTHON) makedocs.py
+
+clean:
+	rm -rf build dist
+
 
 July 17, 2004
     SysFont extra styles being applied incorrect
+    psuedo "configure" and "Makefile" for foolproof installs
 
 July 16, 2004
     mixer.set_num_channels() no longer crashes [BUG]
 
 def main():
     if os.path.isfile('Setup'):
-        if confirm('Backup existing "Setup" file'):
+        if "-auto" in sys.argv or confirm('Backup existing "Setup" file'):
             shutil.copyfile('Setup', 'Setup.bak')
-    if os.path.isdir('build'):
+    if not "-auto" in sys.argv and os.path.isdir('build'):
         if confirm('Remove old build directory (force recompile)'):
             shutil.rmtree('build', 0)
 

File config_unix.py

 configcommand = os.environ.get('SDL_CONFIG', 'sdl-config',)
 configcommand = configcommand + ' --version --cflags --libs'
 localbase = os.environ.get('LOCALBASE', '') #do we still need this?
-incdirs.append("/usr/include")
-incdirs.append("/include")
-libdirs.append("/usr/lib")
-libdirs.append("/lib")
+
 
 
 
     if not DEPS[0].found:
         print 'Unable to run "sdl-config". Please make sure a development version of SDL is installed.'
         raise SystemExit
-		
 
+    incdirs = ['/usr/include', '/include']
+    libdirs = ['/usr/lib', '/lib']
     if localbase: #unneeded?
         incdirs = [localbase + '/include/SDL']
         libdirs = [localbase + '/lib']
-    else:
-        incdirs = ['/usr/include']
-        libdirs = ['/usr/lib']
-        for arg in string.split(DEPS[0].cflags):
-            if arg[:2] == '-I':
-                incdirs.append(arg[2:])
-            elif arg[:2] == '-L':
-                libdirs.append(arg[2:])
+    for arg in string.split(DEPS[0].cflags):
+        if arg[:2] == '-I':
+            incdirs.append(arg[2:])
+        elif arg[:2] == '-L':
+            libdirs.append(arg[2:])
     for d in DEPS:
         d.configure(incdirs, libdirs)
 
 
     for d in DEPS[1:]:
-	if not d.found:
-		if not confirm("""
+        if not d.found:
+            if not confirm("""
 Warning, some of the pygame dependencies were not found. Pygame can still
 compile and install, but games that depend on those missing dependencies
 will not run. Would you like to continue the configuration?"""):
-			raise SystemExit
-		break
+                raise SystemExit
+            break
 
     return DEPS
 
+#fake configure for pygame, to support the common
+# ./configure;make;make install
+
+python config.py -auto