Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Dec 17, 2017 7:52 am

All times are UTC




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Makefile patches
PostPosted: Fri Aug 13, 2004 2:22 am 
Offline
Engineer
Engineer

Joined: Fri Aug 13, 2004 1:23 am
Posts: 4
First, the shell's ``if`` can't be used to conditionalize make's ``$(error)``
because make variables are expanded and functions are evaluated before they get to the shell. This results in the `install` target never working, even when given INSTALL=1. Solution: use make's ``$(if)``.

Second, copying only ``*.grf`` files in the ``data`` subdir didn't produce a working isntall because it missed things like ``sample.cat``. Solution: copy all files there.

Code:
--- openttd-0.3.3/Makefile      2004-07-14 18:46:12.000000000 +0300
+++ openttd/Makefile    2004-08-12 17:17:33.000000000 +0300
@@ -537,15 +537,15 @@
 ifndef OSX
 ifndef MORPHOS
 install:
-       @if [ "$(INSTALL)" == "" ]; then $(error make install is highly experimental at his state and not\
-       tested very much - use at your own risk - to use run \"make install INSTALL:=1\" - make sure makefile.config\
-       is set correctly up - run \"make upgradeconf\")
-       @if [ "$(DATA_DIR)" == "" ]; then $(error no install path set - check makefile.config)
+       @$(if $(INSTALL),,$(error make install is highly experimental at his state and not\
+               tested very much - use at your own risk - to use run \"make install INSTALL:=1\" - make sure makefile.config\
+               is set correctly up - run \"make upgradeconf\"))
+       @$(if $(DATA_DIR),,$(error no install path set - check makefile.config))
        mkdir -p $(DATA_DIR)/lang
        mkdir -p $(DATA_DIR)/data
        cp $(TTD) $(BINARY_INSTALL)
        cp lang/*.lng $(DATA_DIR)/lang
-       cp data/*.grf $(DATA_DIR)/data
+       cp data/* $(DATA_DIR)/data
 else   #MorphOS
 install:
        $(error make install is not supported on MorphOS)


Top
   
 Post subject: Re: Makefile patches
PostPosted: Fri Aug 13, 2004 8:49 am 
Offline
Tycoon
Tycoon

Joined: Mon Mar 08, 2004 1:10 pm
Posts: 2088
cben wrote:
Second, copying only ``*.grf`` files in the ``data`` subdir didn't produce a working isntall because it missed things like ``sample.cat``. Solution: copy all files there.

That would not help at all since it copies the files from the data folder in the svn working copy, which is only the grf files we made yourself, not the TTD ones and not sample.cat.


Top
   
 Post subject: Re: Makefile patches
PostPosted: Fri Aug 20, 2004 1:32 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 13, 2004 1:23 am
Posts: 4
Bjarni wrote:
cben wrote:
Second, copying only ``*.grf`` files in the ``data`` subdir didn't produce a working isntall because it missed things like ``sample.cat``. Solution: copy all files there.

That would not help at all since it copies the files from the data folder in the svn working copy, which is only the grf files we made yourself, not the TTD ones and not sample.cat.

True, unless one copies the files there before the final install. It's not entirely clear from the readme where should you copy them. If you don't like the idea (I agree that it's just a quick hack), you can apply the patch without it.
The first part of the patch is more important: the install target doesn't run at all without it.
Also, I recommend to remove the INSTALL=1 test. It doesn't achieve anything except annoying the user. Its only purpose seems to warn the user that it's experimental; an echo at the end of the install and a note in the readme would be enough IMHO. Besides. the install target does work (after this patch) ;-).


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.