Commits

Anonymous committed cef3abf

Running game now pass through . Makefile is now able to determine the right python binary to use.

  • Participants
  • Parent commits 4695b25

Comments (0)

Files changed (7)

+# Targets to delete in Distclean rule
 DISTCLEAN = saves
+# Targets to delete in Clean rule
 CLEAN = output.ps output.dot src/__pycache__
+# Targets to tar in dist rule
 DIST = doc res src AUTHORS basic-robots.py Makefile README.md TODO
 
 NAME = basic-robots
 VERSION = 0.42
 
+ENTRY_POINT = src/main.py
 
-.PHONY: doc
+SUPPORTED_BINARY = python2.4 python2.5 python2.6 python2.7
+# Compute the value of the binary
+BINARY = $(shell for i in ${SUPPORTED_BINARY}; do 	\
+		if [ -e /usr/bin/$$i ] ; then 		\
+			echo $$i;			\
+			break;				\
+		fi;					\
+	done;)
 
+.PHONY: doc
 
 run:
-	@./basic-robots.py
+	@${BINARY} ${ENTRY_POINT}
 
 viewImport:
-	@./src/modelViewer/modelViewer.py importScan
+	@${BINARY} src/modelViewer/modelViewer.py importScan
 	@dot output.dot -Tps -o output.ps
 
 viewInheritance:
-	@./src/modelViewer/modelViewer.py inheritanceScan
+	@${BINARY} src/modelViewer/modelViewer.py inheritanceScan
 	@dot output.dot -Tps -o output.ps
 
 doc:

File basic-robots.py

-#!/usr/bin/python
-#-*-coding:Utf-8 -*
-
-# basic-robots.py for BASIC-RoBots in /home/surply_p
-# 
-# Made by Pierre Surply
-# <pierre.surply@gmail.com>
-# 
-# Started on  Sat May  5 13:04:07 2012 Pierre Surply
-## Last update Sun Jul 29 10:52:14 2012 Pierre Surply
-#
-
-from src import main
-
-if __name__ == "__main__":
-    a = main.Main()
-    a.run()
         wm = worldmap.WorldMap(path)
         wm.load(self.input)
         return wm
+
+
+if __name__ == "__main__":
+    Main().run()

File src/modelViewer/importScan.py

+#!/usr/bin/python2
+
 import re
 
 

File src/modelViewer/inheritanceScan.py

+#!/usr/bin/python2
+
 import re
 
 def getScan():

File src/modelViewer/modelViewer.py

-#!/usr/bin/python
+#!/usr/bin/python2
 #-*-coding:Utf-8 -*
 
 import os

File src/robot/robotsos.py

 import os
 from pygame.locals import *
 
-from .. import terminal
+os.chdir('src/robot')
+import terminal
+os.chdir('../../')
 import basic
 
 class Command: