Makefile
changeset 2240 08cab36d20f3
parent 2236 34daee5dfc60
child 2285 410dedcf46d1
equal deleted inserted replaced
2239:c36d7bb6e54b 2240:08cab36d20f3
     1 # $Id$
     1 # $Id$
     2 
       
     3 # This Makefile is partially based on "a completely generic Makefile",
       
     4 # originally created by Justin Husted <husted@cs>
       
     5 #
       
     6 # Rewrite and sane dependencies support by Petr Baudis <pasky@ucw.cz>
       
     7 # Cygwin support and configuration by Jaen Saul <slowbyte@hot.ee>
       
     8 # A lot of modifications by Bjarni Corfitzen <bjarni@openttd.com>
       
     9 #
       
    10 # Last modified by: $Author: strigeus $
       
    11 # On: $Date: 2004/03/11 19:15:06 $
       
    12 
       
    13 
     2 
    14 ##############################################################################
     3 ##############################################################################
    15 #
     4 #
    16 # Usage
     5 # Usage
    17 #
     6 #
   291 endif
   280 endif
   292 ifndef CFLAGS_HOST
   281 ifndef CFLAGS_HOST
   293 CFLAGS_HOST = $(BASECFLAGS)
   282 CFLAGS_HOST = $(BASECFLAGS)
   294 endif
   283 endif
   295 
   284 
   296 # When calling the compiler, use these flags
       
   297 # -g	debugging symbols
       
   298 # -Wall	all warnings
       
   299 # -s    automatic strip
       
   300 #
       
   301 # You may also want:
       
   302 # -O	optimize or -O2 fully optimize (O's above 2 are not recommended)
       
   303 # -pg	profile - generate profiling data.  See "man gprof" to use this.
       
   304 
   285 
   305 CC_VERSION = $(shell $(CC) -dumpversion | cut -c 1,3)
   286 CC_VERSION = $(shell $(CC) -dumpversion | cut -c 1,3)
   306 
   287 
   307 # GNU make can only test for (in)equality
   288 # GNU make can only test for (in)equality
   308 # this is a workaround to test for >=
   289 # this is a workaround to test for >=
   309 ifeq ($(shell if test $(CC_VERSION) -ge 29; then echo true; fi), true)
   290 ifeq ($(shell expr $(CC_VERSION) \>= 29), 1)
   310   CFLAGS += -O -Wall -Wno-multichar -Wsign-compare -Wstrict-prototypes
   291   CFLAGS += -O -Wall -Wno-multichar -Wsign-compare -Wstrict-prototypes
   311   CFLAGS += -Wwrite-strings -Wpointer-arith
   292   CFLAGS += -Wwrite-strings -Wpointer-arith
   312 endif
   293 endif
   313 ifeq ($(shell if test $(CC_VERSION) -ge 30; then echo true; fi), true)
   294 ifeq ($(shell expr $(CC_VERSION) \>= 30), 1)
   314   CFLAGS += -W -Wno-unused-parameter
   295   CFLAGS += -W -Wno-unused-parameter
   315 endif
   296 endif
   316 ifeq ($(shell if test $(CC_VERSION) -ge 34; then echo true; fi), true)
   297 ifeq ($(shell expr $(CC_VERSION) \>= 34), 1)
   317   CFLAGS += -Wdeclaration-after-statement -Wold-style-definition
   298   CFLAGS += -Wdeclaration-after-statement -Wold-style-definition
   318 endif
   299 endif
   319 
   300 
   320 ifdef DEBUG
   301 ifdef DEBUG
   321   ifeq ($(shell expr $(DEBUG) \>= 1), 1)
   302   ifeq ($(shell expr $(DEBUG) \>= 1), 1)
   531 
   512 
   532 ifdef WITH_NETWORK
   513 ifdef WITH_NETWORK
   533 CDEFS += -DENABLE_NETWORK
   514 CDEFS += -DENABLE_NETWORK
   534 ifdef QNX
   515 ifdef QNX
   535 LIBS += -lsocket
   516 LIBS += -lsocket
   536 endif
       
   537 ifdef UNIX
       
   538 ifndef OSX
       
   539 ifndef MORPHOS
       
   540 # this have caused problems on many platforms and disabling it didn't break anything
       
   541 # now we test if disabling it as a general breaks it for anybody
       
   542 #LIBS += -lresolv
       
   543 endif
       
   544 endif
       
   545 endif
   517 endif
   546 endif
   518 endif
   547 
   519 
   548 
   520 
   549 ifdef SECOND_DATA_PATH
   521 ifdef SECOND_DATA_PATH