~ubuntu-branches/ubuntu/raring/simutrans/raring-proposed

« back to all changes in this revision

Viewing changes to nettools/Makefile

  • Committer: Package Import Robot
  • Author(s): Ansgar Burchardt
  • Date: 2011-11-03 19:59:02 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20111103195902-uopgwf488mfctb75
Tags: 111.0-1
* New upstream release.
* debian/rules: Update get-orig-source target for new upstream release.
* Use xz compression for source and binary packages.
* Use override_* targets to simplify debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
CFG ?= default
 
2
-include ../config.$(CFG)
 
3
 
 
4
OSTYPES       = beos cygwin freebsd haiku linux mingw mac
 
5
 
 
6
ifeq ($(findstring $(OSTYPE), $(OSTYPES)),)
 
7
  $(error Unkown OSTYPE "$(OSTYPE)", must be one of "$(OSTYPES)")
 
8
endif
 
9
 
 
10
# Absolutely essential
 
11
CFLAGS += -DNETTOOL
 
12
CXXFLAGS += -DNETTOOL
 
13
 
 
14
ifeq ($(OSTYPE),cygwin)
 
15
  OS_INC   ?= -I/usr/include/mingw
 
16
  OS_OPT   ?= -mwin32
 
17
  STD_LIBS += -lwinmm -lcurses
 
18
endif
 
19
 
 
20
ifeq ($(OSTYPE),mingw)
 
21
  CC ?= gcc
 
22
  OS_OPT   ?= -mno-cygwin -march=pentium
 
23
  # we need the libraries EXACTLY in this order to link
 
24
  STD_LIBS = -lmingw32 -lstdc++ -lwsock32
 
25
endif
 
26
 
 
27
ifeq ($(OSTYPE),mac)
 
28
  CFLAGS   += -DUSE_HW -DUSE_C  -Os -fast
 
29
  CXXFLAGS   += -DUSE_HW -DUSE_C
 
30
endif
 
31
 
 
32
ifneq ($(OPTIMISE),)
 
33
  CFLAGS   += -O3 -fno-schedule-insns
 
34
  CXXFLAGS += -O3 -fno-schedule-insns
 
35
  ifneq ($(OSTYPE),mac)
 
36
    CFLAGS  += -minline-all-stringops
 
37
  endif
 
38
else
 
39
  CFLAGS   += -O
 
40
  CXXFLAGS += -O
 
41
endif
 
42
 
 
43
ifdef DEBUG
 
44
  ifeq ($(shell expr $(DEBUG) \>= 1), 1)
 
45
    CFLAGS   += -g -DDEBUG
 
46
    CXXFLAGS += -g -DDEBUG
 
47
  endif
 
48
  ifeq ($(shell expr $(DEBUG) \>= 2), 1)
 
49
    CFLAGS   += -fno-inline
 
50
    CXXFLAGS += -fno-inline
 
51
  endif
 
52
  ifeq ($(shell expr $(DEBUG) \>= 3), 1)
 
53
    CFLAGS   += -O0
 
54
    CXXFLAGS += -O0
 
55
  endif
 
56
else
 
57
  CFLAGS += -DNDEBUG
 
58
  CXXFLAGS += -DNDEBUG
 
59
endif
 
60
 
 
61
ifneq ($(PROFILE),)
 
62
  CFLAGS   += -pg -DPROFILE -fno-inline
 
63
  CXXFLAGS += -pg -DPROFILE -fno-inline
 
64
  LDFLAGS += -pg
 
65
endif
 
66
 
 
67
CFLAGS   += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -Wstrict-prototypes $(OS_INC) $(OS_OPT) $(FLAGS)
 
68
CXXFLAGS += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align $(OS_INC) $(OS_OPT) $(FLAGS)
 
69
 
 
70
# SOLO_SOURCES contains files which are unique to nettool;
 
71
# SHARED_SOURCES contains those with the exact same object code in nettool and simutrans;
 
72
# VARIANT_SOURCES contains those which need different .o files for nettool and simutrans.
 
73
# At the moment they're all treated identically, of course.
 
74
SOLO_SOURCES += nettool.cc
 
75
SHARED_SOURCES += ../dataobj/freelist.cc
 
76
SHARED_SOURCES += ../dataobj/network_address.cc
 
77
SHARED_SOURCES += ../dataobj/network_cmd.cc
 
78
SHARED_SOURCES += ../dataobj/network_packet.cc
 
79
SHARED_SOURCES += ../dataobj/network_socket_list.cc
 
80
SHARED_SOURCES += ../simdebug.cc
 
81
SHARED_SOURCES += ../simmem.cc
 
82
SHARED_SOURCES += ../utils/memory_rw.cc
 
83
SHARED_SOURCES += ../utils/simstring.cc
 
84
SHARED_SOURCES += ../utils/fetchopt.cc
 
85
VARIANT_SOURCES += ../utils/log.cc
 
86
VARIANT_SOURCES += ../dataobj/network.cc
 
87
VARIANT_SOURCES += ../dataobj/network_file_transfer.cc
 
88
 
 
89
SOURCES ?= $(SOLO_SOURCES) $(SHARED_SOURCES) $(VARIANT_SOURCES)
 
90
 
 
91
BUILDDIR ?= build/$(CFG)
 
92
TOOL  = nettool
 
93
PROG ?= nettool
 
94
ifeq ($(origin NETTOOL_PROGDIR), undefined)
 
95
  NETTOOL_PROGDIR := $(BUILDDIR)/$(TOOL)
 
96
endif
 
97
 
 
98
BUILDDIR := ../$(BUILDDIR)
 
99
NETTOOL_PROGDIR := ../$(NETTOOL_PROGDIR)
 
100
 
 
101
TOOL_PROGDIR = $(NETTOOL_PROGDIR)
 
102
 
 
103
include ../uncommon.mk