Permalink
Browse files

Add Makefile to the project

This commit adds a makefile to the project to simplify rebuilding,
installation and running from the sources. README.md updated as to cover
the changes.
  • Loading branch information...
1 parent b264fe6 commit 3f710e9521a15d5ce2787643600ab3c547df2540 @lczerner lczerner committed Dec 4, 2012
Showing with 55 additions and 13 deletions.
  1. +39 −0 Makefile
  2. +16 −13 README.md
View
@@ -0,0 +1,39 @@
+# (C)2012 Lukas Czerner <lczerner@loguj.cz>
+
+all:
+ rm -f monorail/ai.c monorail/ai.so
+ rm -rf monorail/data
+ @python setup.py build_ext --inplace
+ ln -s $(CURDIR)/data/800x600/ monorail/data
+
+help:
+ @echo "Usage: make <target>"
+ @echo
+ @echo "Available targets are:"
+ @echo " help show this text"
+ @echo " clean remove python bytecode and temp files"
+ @echo " git-clean remove all files outside git tree"
+ @echo " install install program on current system"
+ @echo " source create source tarball"
+ @echo " rebuild-all rebuild everything including all assets"
+
+clean:
+ @python setup.py clean
+ rm -f MANIFEST
+ rm -f monorail/ai.c monorail/ai.so
+ rm -rf monorail/data
+ rm -rf assets/tmp
+ find . -\( -name "*.pyc" -o -name '*.pyo' -o -name "*~" -\) -delete
+
+git-clean:
+ git clean -f
+
+install:
+ @python setup.py install
+
+source: clean
+ @python setup.py sdist
+
+rebuild-all: clean
+ @python setup.py build_ext --inplace
+ @python build.py
View
@@ -64,23 +64,26 @@ Requirements
How to Run the Game
-------------------
-- Copy the data/800x600/ folder as data folder in the "monorail" directory
-- Run the monorail.py file
-- For non i386 architectures you have to rebuild the ai.so:
- To do this, go to the "monorail" directory and run: python setup.py build_ext --inplace
+In root directory of MysticMine sources:
+- Run 'make'
+- Run './MysticMine'
+
+
+Install Instructions
+--------------------
+In root directory of MysticMine sources:
+- Run 'make install'
+
+This will install all files to the python site-packages directory and a start
+script to you bin directory, so that you can start it by just calling
+'MysticMine'
Build Instructions
------------------
-Just run:
- python setup.py install
-in the root directory of the MysticMine sources.
-This will install all files to the python site-packages directory, and a start script
-to your bin directory, so that you can start is by just calling "MysticMine"
-
-To rebuild the graphics, you have to run:
- python build.py
-in the root directory of the MysticMine sources.
+You can rebuild everything including all assets of the game. In root directory
+of MysticMine sources:
+- Run 'make rebuild-all'
License

0 comments on commit 3f710e9

Please sign in to comment.