File: simplify_gnumakefile.diff

package info (click to toggle)
oolite 1.84-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 124,644 kB
  • ctags: 3,975
  • sloc: objc: 132,132; ansic: 3,138; sh: 559; perl: 359; makefile: 276; php: 5
file content (185 lines) | stat: -rw-r--r-- 6,818 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
Description: simplify preprocessor variables data flow
 Each prepocessor variable is either never defined or defined once in
 GNUMakefile with value 1 (so that #if and #ifdef are equivalent).
 .
 Style: factorize espeak lines with a DYNAMIC_LIBRARY_EXTENSION variable.
 .
 Initial motivation: remove numerous CPP warnings about
 OO_CHECK_GL_HEAVY being defined twice.
 .
 Style: make explicit GNUMakefile that OO_OXP_VERIFIER_ENABLED is
 influenced by BUILD_WITH_DEBUG_FUNCTIONALITY.
 .
 Fix: OO_LOCALIZATION_TOOLS was enabled when
 DEPLOYMENT_RELEASE_CONFIGURATION=no and OO_LOCALIZATION_TOOLS=no,
 which was probably not intended.
 .
 Fix: typo in -DOO_FOV_INFLIGHT_CONTROL_ENABLEDD=0.
Author: Nicolas Boulenguez <nicolas@debian.org>

--- a/GNUmakefile
+++ b/GNUmakefile
@@ -34,11 +34,7 @@
         ADDITIONAL_LDFLAGS           +=
     endif
     oolite_LIB_DIRS              += -L$(GNUSTEP_LOCAL_ROOT)/lib -L$(WIN_DEPS_DIR)/lib -L$(JS_LIB_DIR)
-    ifeq ($(ESPEAK),yes)
-        ADDITIONAL_OBJC_LIBS     += -lespeak.dll
-        ADDITIONAL_OBJCFLAGS     +=-DHAVE_LIBESPEAK=1
-        GNUSTEP_OBJ_DIR_NAME     := $(GNUSTEP_OBJ_DIR_NAME).spk
-    endif
+    DYNAMIC_LIBRARY_EXTENSION    := .dll
 else
     ADDITIONAL_INCLUDE_DIRS      = -Isrc/SDL -Isrc/Core -Isrc/BSDCompat -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Core/Debug -Isrc/Core/Tables
     ADDITIONAL_OBJC_LIBS         = -lgnustep-base -lstdc++
@@ -53,11 +49,6 @@
     else
         PKG_CONFIG_LIBRARIES     += libpng
     endif
-    ifeq ($(ESPEAK),yes)
-        ADDITIONAL_OBJC_LIBS     += -lespeak
-        ADDITIONAL_OBJCFLAGS     += -DHAVE_LIBESPEAK=1
-        GNUSTEP_OBJ_DIR_NAME     := $(GNUSTEP_OBJ_DIR_NAME).spk
-    endif
     ifeq ($(OO_JAVASCRIPT_TRACE),yes)
         ADDITIONAL_OBJCFLAGS     += -DMOZ_TRACE_JSCALLS=1
     endif
@@ -77,11 +68,18 @@
     ADDITIONAL_CFLAGS            += -g -O0
     ADDITIONAL_OBJCFLAGS         += -g -O0
     GNUSTEP_OBJ_DIR_NAME         := $(GNUSTEP_OBJ_DIR_NAME).dbg
-    ADDITIONAL_CFLAGS            += -DDEBUG -DOO_DEBUG -DOO_CHECK_GL_HEAVY=1
-    ADDITIONAL_OBJCFLAGS         += -DDEBUG -DOO_DEBUG -DOO_CHECK_GL_HEAVY=1
+    ADDITIONAL_CFLAGS            += -DDEBUG -DOO_DEBUG
+    ADDITIONAL_OBJCFLAGS         += -DDEBUG -DOO_DEBUG
 endif
 
 # these are common settings for both test and deployment release configurations
+
+ifeq ($(ESPEAK),yes)
+    ADDITIONAL_OBJC_LIBS         += -lespeak$(DYNAMIC_LIBRARY_EXTENSION)
+    ADDITIONAL_OBJCFLAGS         += -DHAVE_LIBESPEAK
+    GNUSTEP_OBJ_DIR_NAME         := $(GNUSTEP_OBJ_DIR_NAME).spk
+endif
+
 ifeq ($(NO_SHADERS),yes)
     ADDITIONAL_CFLAGS            += -DNO_SHADERS=1
     ADDITIONAL_OBJCFLAGS         += -DNO_SHADERS=1
@@ -93,46 +91,62 @@
 
 # DEPLOYMENT_RELEASE_CONFIGURATION value is passed from Makefile. Note that the deployment release settings
 # are forced, while test release settings are adjustable.
+
 ifeq ($(DEPLOYMENT_RELEASE_CONFIGURATION),yes)
     ADDITIONAL_CFLAGS            += -DNDEBUG
     ADDITIONAL_OBJCFLAGS         += -DNDEBUG
-    ADDITIONAL_CFLAGS            += -DOO_CHECK_GL_HEAVY=0
-    ADDITIONAL_OBJCFLAGS         += -DOO_CHECK_GL_HEAVY=0
-    ADDITIONAL_CFLAGS            += -DOO_EXCLUDE_DEBUG_SUPPORT=1
-    ADDITIONAL_OBJCFLAGS         += -DOO_EXCLUDE_DEBUG_SUPPORT=1
-    ADDITIONAL_CFLAGS            += -DOO_OXP_VERIFIER_ENABLED=0
-    ADDITIONAL_OBJCFLAGS         += -DOO_OXP_VERIFIER_ENABLED=0
-    ADDITIONAL_CFLAGS            += -DOO_LOCALIZATION_TOOLS=0
-    ADDITIONAL_OBJCFLAGS         += -DOO_LOCALIZATION_TOOLS=0
-    ADDITIONAL_CFLAGS            += -DDEBUG_GRAPHVIZ=0
-    ADDITIONAL_OBJCFLAGS         += -DDEBUG_GRAPHVIZ=0
-    ADDITIONAL_CFLAGS            += -DOO_FOV_INFLIGHT_CONTROL_ENABLED=0
-    ADDITIONAL_OBJCFLAGS         += -DOO_FOV_INFLIGHT_CONTROL_ENABLEDD=0
 else
     ifeq ($(BUILD_WITH_DEBUG_FUNCTIONALITY),no)
         ADDITIONAL_CFLAGS        += -DNDEBUG
         ADDITIONAL_OBJCFLAGS     += -DNDEBUG
     endif
+endif
+
+ifeq ($(DEPLOYMENT_RELEASE_CONFIGURATION),no)
     ifeq ($(OO_CHECK_GL_HEAVY),yes)
         ADDITIONAL_CFLAGS        += -DOO_CHECK_GL_HEAVY=1
         ADDITIONAL_OBJCFLAGS     += -DOO_CHECK_GL_HEAVY=1
+    else ifeq ($(debug),yes)
+        ADDITIONAL_CFLAGS        += -DOO_CHECK_GL_HEAVY
+        ADDITIONAL_OBJCFLAGS     += -DOO_CHECK_GL_HEAVY
     endif
+endif
+
+ifeq ($(DEPLOYMENT_RELEASE_CONFIGURATION),yes)
+        ADDITIONAL_CFLAGS        += -DOO_EXCLUDE_DEBUG_SUPPORT
+        ADDITIONAL_OBJCFLAGS     += -DOO_EXCLUDE_DEBUG_SUPPORT
+else
     ifeq ($(OO_EXCLUDE_DEBUG_SUPPORT),yes)
         ADDITIONAL_CFLAGS        += -DOO_EXCLUDE_DEBUG_SUPPORT=1
         ADDITIONAL_OBJCFLAGS     += -DOO_EXCLUDE_DEBUG_SUPPORT=1
     endif
+endif
+
+ifeq ($(DEPLOYMENT_RELEASE_CONFIGURATION),no)
     ifeq ($(OO_OXP_VERIFIER_ENABLED),yes)
         ADDITIONAL_CFLAGS        += -DOO_OXP_VERIFIER_ENABLED=1
         ADDITIONAL_OBJCFLAGS     += -DOO_OXP_VERIFIER_ENABLED=1
+    else ifeq ($(BUILD_WITH_DEBUG_FUNCTIONALITY),yes)
+        ADDITIONAL_CFLAGS        += -DOO_OXP_VERIFIER_ENABLED
+        ADDITIONAL_OBJCFLAGS     += -DOO_OXP_VERIFIER_ENABLED
     endif
+endif
+
+ifeq ($(DEPLOYMENT_RELEASE_CONFIGURATION),no)
     ifeq ($(OO_LOCALIZATION_TOOLS),yes)
         ADDITIONAL_CFLAGS        += -DOO_LOCALIZATION_TOOLS=1
         ADDITIONAL_OBJCFLAGS     += -DOO_LOCALIZATION_TOOLS=1
     endif
+endif
+
+ifeq ($(DEPLOYMENT_RELEASE_CONFIGURATION),no)
     ifeq ($(DEBUG_GRAPHVIZ),yes)
         ADDITIONAL_CFLAGS        += -DDEBUG_GRAPHVIZ=1
         ADDITIONAL_OBJCFLAGS     += -DDEBUG_GRAPHVIZ=1
     endif
+endif
+
+ifeq ($(DEPLOYMENT_RELEASE_CONFIGURATION),no)
     ifeq ($(OO_FOV_INFLIGHT_CONTROL_ENABLED),yes)
         ADDITIONAL_CFLAGS        += -DOO_FOV_INFLIGHT_CONTROL_ENABLED=1
         ADDITIONAL_OBJCFLAGS     += -DOO_FOV_INFLIGHT_CONTROL_ENABLED=1
--- a/src/Core/OOOpenGL.h
+++ b/src/Core/OOOpenGL.h
@@ -222,10 +222,6 @@
 	OOGLEND() calls glEnd().
 	CheckOpenGLErrorsHeavy() does nothing (including not performing any parameter side-effects).
 */
-#ifndef OO_CHECK_GL_HEAVY
-#define OO_CHECK_GL_HEAVY 0
-#endif
-
 
 #if OO_CHECK_GL_HEAVY
 
--- a/src/Core/Universe.h
+++ b/src/Core/Universe.h
@@ -159,10 +159,6 @@
 // once this number has been in a stable release, cannot easily be changed
 #define SYSTEM_REPOPULATION_INTERVAL 20.0f;
 
-#ifndef OO_LOCALIZATION_TOOLS
-#define OO_LOCALIZATION_TOOLS	1
-#endif
-
 #ifndef MASS_DEPENDENT_FUEL_PRICES
 #define MASS_DEPENDENT_FUEL_PRICES	1
 #endif
--- a/src/Core/OXPVerifier/OOOXPVerifier.h
+++ b/src/Core/OXPVerifier/OOOXPVerifier.h
@@ -29,14 +29,6 @@
 
 */
 
-#ifndef OO_OXP_VERIFIER_ENABLED
-	#ifdef NDEBUG
-		#define OO_OXP_VERIFIER_ENABLED 0
-	#else
-		#define OO_OXP_VERIFIER_ENABLED 1
-	#endif
-#endif
-
 #if OO_OXP_VERIFIER_ENABLED
 
 #import "OOCocoa.h"