Generic Makefile system for NewGRFs ----------------------------------- This version: My Fancy NewGRF 0.3.0 Contents: 1 About 2 Quickstart 3 Installation 4 Building from source 5 License 6 Credits ------- 1 About ------- This NewGRF build system aims at NewGRF authors for OpenTTD and TTDPatch who want to employ an easy-to-use system in order to generate their NewGRFS. Name of this Repo: My Fancy NewGRF 0.3.0 GRF_ID: "IvB" 01 MD5 sum: 60cfa7751db31b6f32badbdbe161daf2 mynewgrf.grf Repository version: 109 -------------- 2 Quickstart -------------- If you already have the necessary devlopment tools (see chapter 3 for requirements), here is how to get a new project going: 1) copy or clone this repository to a new, empty repository 2) Configure the build system to your newgrf: - Edit Makefile.config and adjust in the first section GRF_NAME, FILENAME and GRF_ID to your desires - optional: Edit .hgignore and replace every occurance of mynewgrf to the chosen FILENAME 3) Edit license.txt and readme.txt to your needs. Mind that you can My Fancy NewGRF 0.3.0 in those documents to get an always up2date version of your newgrf name and title 4) Edit sprites/nfo/.pnfo and add a list of your nfo source files with their relative path to the repository's root. Their file extension should be .pnfo as in the example. See the supplied sprites/nfo/mynewgrf.pnfo for an example 5) optional: use "IvB" 01 and My Fancy NewGRF 0.3.0 in your action 08 of your newgrf as done in the supplied example (sprites/nfo/00header.pnfo) to have the newgrf always display the correct version. -------------- 3 Installation -------------- This Makefile system is easiest to setup if you employ a certain directory structure for your NewGRF project. Clone this project and fill in your NewGRF content. Make sure to adopt Makefile.config to your needs. Requirements for running this Makefile successfully: grfcodec (only nfo-stylee project) renum (only nfo-stylee project) NML (only nml-style project) gcc md5sum (or md5 on Mac) make If you want to bundle the grf, you'll need additionally tar zip bzip2 unix2dos (optional) Windows only: On Windows systems this means that you'll need to install MinGW and MSys in order to obtain a posix compatible environment. Then the makefile can be called the very same way as it is on linux and mac systems. MinGW/MSys contain the above mentioned programmes (except renum and grfcodec of course) and can be obtained from http://www.mingw.org/ That site also features an excellent walk-through o how to install it. If you use for OpenTTD data folder a non-default path or Windows with a non-English localization make sure to copy Makefile.local.sample to Makefile.local and edit the line with INSTALLDIR = accordingly so that it shows the full path to your OpenTTD / TTDP data directory. ------- 4 Usage ------- Before this build system can be applied to a newgrf, you have to adopt a few lines in Makefile.config, mainly you'll have to replace "mynewgrf" by the actual name of your newgrf. Also make sure to change that in the .hgignore file. The Makefile offers different targets. A brief overview is given here: all: This is the default target, if also no parameter is given to make. It will simply build the grf file, if it needs building depend: Re-run the dependency check. Usually not manually needed. bundle: This target will create a directory called "-nightly" and copy the grf file there and the documentation files, readme.txt, changelog.txt and license.txt bundle_zip This will zip the bundle directory into one zip for distribution bundle_tar This will tar the bundle directory into a tar archive for distribution or upload to bananas bundle_src Creates a source bundle install: This will create a tar archive (like bundle_tar) and copy it into the INSTALLDIR as specified in Makefile.local (or the default dir, if that isn't defined). Don't rely on a good detection of the default installation directory. It's especially bound to fail on windows machines. distclean: This phony target cleans everything from a source bundle which wasn't shipped. clean: This phony target will delete all files which this Makefile will create mrproper: This phony target will delete also all directories created by different Makefile targets remake: It's a shortcut for first cleaning the dir and then making the grf anew. 4.1 Setup --------- You'll need to adopt the repository to your new NewGRF. There are a few files which need modification: - Makefile.config - .hgignore - docs/changelog.ptxt - docs/readme.ptxt - docs/license.ptxt (you may choose GPL v2 or newer, if you use this template newgrf and build system) --------- 5 License --------- This generic NewGRF Makefile was written by Ingo von Borstel (aka planetmaker) and is free to use for anyone under the terms of the GNU Pulic License v2 or higher. See license.txt. The source code can be obtained from the #openttdcoop DevZone at http://dev.openttdcoop.org/projects/newgrf-makefile or via mercurial checkout hg clone http://dev.openttdcoop.org/projects/newgrf-makefile --------- 6 Credits --------- Author: Ingo von Borstel (aka planetmaker) Special thanks to #openttdcoop and especially Ammler who provides and works a lot on maintaining the Development Zone where this repository is hosted and who also frequently gives much valuable input. Thanks also to all the NewGRF authors whose NewGRFs can be my playground for this project.