Commit 8a4de0d66947e8aca820025b62446d400d25280f

Werner Lemberg 2006-02-01T07:52:11

* Makefile, *.mk: Use `?=' where appropriate. * builds/detect.mk (TOP_DIR), builds/os2/os2-dev.mk (TOP_DIR), builds/win32/w32-dev.mk (TOP_DIR): Removed. Defined elsewhere.

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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
diff --git a/ChangeLog b/ChangeLog
index 52d7086..9b8e1e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,11 @@
 
 	* builds/unix/install.mk (install): Fix path for ftmodule.h.
 
+	* Makefile, *.mk: Use `?=' where appropriate.
+
+	* builds/detect.mk (TOP_DIR), builds/os2/os2-dev.mk (TOP_DIR),
+	builds/win32/w32-dev.mk (TOP_DIR): Removed.  Defined elsewhere.
+
 2006-01-31  Werner Lemberg  <wl@gnu.org>
 
 	Implement new, simplified module selection.  With GNU make it is now
diff --git a/Makefile b/Makefile
index ab8dba5..c1fa16c 100644
--- a/Makefile
+++ b/Makefile
@@ -15,22 +15,18 @@
 
 # Project names
 #
-PROJECT := freetype
+PROJECT       := freetype
 PROJECT_TITLE := FreeType
 
 # The variable TOP_DIR holds the path to the topmost directory in the project
 # engine source hierarchy.  If it is not defined, default it to `.'.
 #
-ifndef TOP_DIR
-  TOP_DIR := .
-endif
+TOP_DIR ?= .
 
 # The variable OBJ_DIR gives the location where object files and the
 # FreeType library are built.
 #
-ifndef OBJ_DIR
-  OBJ_DIR := $(TOP_DIR)/objs
-endif
+OBJ_DIR ?= $(TOP_DIR)/objs
 
 
 include $(TOP_DIR)/builds/toplevel.mk
diff --git a/builds/ansi/ansi-def.mk b/builds/ansi/ansi-def.mk
index b456439..6b8ecfa 100644
--- a/builds/ansi/ansi-def.mk
+++ b/builds/ansi/ansi-def.mk
@@ -63,9 +63,7 @@ T := -o$(space)
 #   Use the ANSIFLAGS variable to define the compiler flags used to enfore
 #   ANSI compliance.
 #
-ifndef CFLAGS
-  CFLAGS := -c
-endif
+CFLAGS ?= -c
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
diff --git a/builds/beos/beos-def.mk b/builds/beos/beos-def.mk
index c987410..7e79d04 100644
--- a/builds/beos/beos-def.mk
+++ b/builds/beos/beos-def.mk
@@ -65,9 +65,7 @@ T := -o$(space)
 #   Use the ANSIFLAGS variable to define the compiler flags used to enfore
 #   ANSI compliance.
 #
-ifndef CFLAGS
-  CFLAGS := -c
-endif
+CFLAGS ?= -c
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
diff --git a/builds/compiler/ansi-cc.mk b/builds/compiler/ansi-cc.mk
index c52c12f..3b668e2 100644
--- a/builds/compiler/ansi-cc.mk
+++ b/builds/compiler/ansi-cc.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -62,9 +62,7 @@ T := -o$(space)
 #   Use the ANSIFLAGS variable to define the compiler flags used to enfore
 #   ANSI compliance.
 #
-ifndef CFLAGS
-  CFLAGS := -c
-endif
+CFLAGS ?= -c
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
@@ -75,10 +73,8 @@ ANSIFLAGS :=
 
 # Library linking
 #
-ifndef CLEAN_LIBRARY
-  CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = $(AR) -r $@ $(subst /,$(COMPILER_SEP),$(OBJECTS_LIST))
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY   = $(AR) -r $@ $(subst /,$(COMPILER_SEP),$(OBJECTS_LIST))
 
 
 # EOF
diff --git a/builds/compiler/bcc-dev.mk b/builds/compiler/bcc-dev.mk
index 446fd4e..ba1a88a 100644
--- a/builds/compiler/bcc-dev.mk
+++ b/builds/compiler/bcc-dev.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -62,9 +62,7 @@ T := -o
 #   Use the ANSIFLAGS variable to define the compiler flags used to enfore
 #   ANSI compliance.
 #
-ifndef CFLAGS
-  CFLAGS := -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
-endif
+CFLAGS ?= -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
@@ -73,10 +71,8 @@ ANSIFLAGS := -A
 
 # Library linking
 #
-ifndef CLEAN_LIBRARY
-  CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY   = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
 
 
 # EOF
diff --git a/builds/compiler/bcc.mk b/builds/compiler/bcc.mk
index eedfa10..509cb72 100644
--- a/builds/compiler/bcc.mk
+++ b/builds/compiler/bcc.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -62,9 +62,7 @@ T := -o
 #   Use the ANSIFLAGS variable to define the compiler flags used to enfore
 #   ANSI compliance.
 #
-ifndef CFLAGS
-  CFLAGS := -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
-endif
+CFLAGS ?= -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
@@ -73,10 +71,8 @@ ANSIFLAGS := -A
 
 # Library linking
 #
-ifndef CLEAN_LIBRARY
-  CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY   = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
 
 
 # EOF
diff --git a/builds/compiler/emx.mk b/builds/compiler/emx.mk
index f2be13c..c237005 100644
--- a/builds/compiler/emx.mk
+++ b/builds/compiler/emx.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 2003 by
+# Copyright 2003, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -61,9 +61,7 @@ T := -o$(space)
 #   Use the ANSIFLAGS variable to define the compiler flags used to enfore
 #   ANSI compliance.
 #
-ifndef CFLAGS
-  CFLAGS := -c -g -O6 -Wall
-endif
+CFLAGS ?= -c -g -O6 -Wall
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
@@ -72,10 +70,8 @@ ANSIFLAGS :=
 
 # Library linking
 #
-ifndef CLEAN_LIBRARY
-  CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = $(foreach m,$(OBJECTS_LIST),$(AR) -r $@ $(m);) echo > nul
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY   = $(foreach m,$(OBJECTS_LIST),$(AR) -r $@ $(m);) echo > nul
 
 
 # EOF
diff --git a/builds/compiler/gcc-dev.mk b/builds/compiler/gcc-dev.mk
index c70f117..7e96c3e 100644
--- a/builds/compiler/gcc-dev.mk
+++ b/builds/compiler/gcc-dev.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2004, 2005 by
+# Copyright 1996-2000, 2003, 2004, 2005, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -87,10 +87,8 @@ ANSIFLAGS := -ansi -pedantic
 
 # Library linking
 #
-ifndef CLEAN_LIBRARY
-  CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY   = $(AR) -r $@ $(OBJECTS_LIST)
 
 
 # EOF
diff --git a/builds/compiler/gcc.mk b/builds/compiler/gcc.mk
index f4c5f96..e941443 100644
--- a/builds/compiler/gcc.mk
+++ b/builds/compiler/gcc.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2005 by
+# Copyright 1996-2000, 2003, 2005, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -61,9 +61,7 @@ T := -o$(space)
 #   Use the ANSIFLAGS variable to define the compiler flags used to enfore
 #   ANSI compliance.
 #
-ifndef CFLAGS
-  CFLAGS := -c -g -O6 -Wall
-endif
+CFLAGS ?= -c -g -O6 -Wall
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
@@ -72,10 +70,8 @@ ANSIFLAGS := -ansi -pedantic
 
 # Library linking
 #
-ifndef CLEAN_LIBRARY
-  CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY   = $(AR) -r $@ $(OBJECTS_LIST)
 
 
 # EOF
diff --git a/builds/compiler/intelc.mk b/builds/compiler/intelc.mk
index 954dcf6..24f2995 100644
--- a/builds/compiler/intelc.mk
+++ b/builds/compiler/intelc.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -69,9 +69,7 @@ T := /Fo
 #   _does_ compute an arithmetic value, so we disable this warning
 #   with "/Qwd32".
 #
-ifndef CFLAGS
-  CFLAGS := /nologo /c /Ox /G5 /W3 /Qwd32
-endif
+CFLAGS ?= /nologo /c /Ox /G5 /W3 /Qwd32
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
diff --git a/builds/compiler/unix-lcc.mk b/builds/compiler/unix-lcc.mk
index cf4ef5a..d79f508 100644
--- a/builds/compiler/unix-lcc.mk
+++ b/builds/compiler/unix-lcc.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -63,9 +63,7 @@ T := -o$(space)
 #   Use the ANSIFLAGS variable to define the compiler flags used to enfore
 #   ANSI compliance.
 #
-ifndef CFLAGS
-  CFLAGS := -c -g
-endif
+CFLAGS ?= -c -g
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
@@ -78,10 +76,8 @@ ANSIFLAGS := -A
 
 # library linking
 #
-ifndef CLEAN_LIBRARY
-  CLEAN_LIBRARY = $(DELETE) $(PROJECT_LIBRARY)
-endif
-LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
+CLEAN_LIBRARY ?= $(DELETE) $(PROJECT_LIBRARY)
+LINK_LIBRARY   = $(AR) -r $@ $(OBJECTS_LIST)
 
 
 # EOF
diff --git a/builds/compiler/visualage.mk b/builds/compiler/visualage.mk
index 21ef12b..c109659 100644
--- a/builds/compiler/visualage.mk
+++ b/builds/compiler/visualage.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -60,9 +60,7 @@ T := /Fo
 #
 #   These should concern: debug output, optimization & warnings.
 #
-ifndef CFLAGS
-  CFLAGS := /Q- /Gd+ /O2 /G5 /W3 /C
-endif
+CFLAGS ?= /Q- /Gd+ /O2 /G5 /W3 /C
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
diff --git a/builds/compiler/visualc.mk b/builds/compiler/visualc.mk
index 594c819..49c446f 100644
--- a/builds/compiler/visualc.mk
+++ b/builds/compiler/visualc.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2005 by
+# Copyright 1996-2000, 2003, 2005, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -66,9 +66,7 @@ TE := /Fe
 #   Use the ANSIFLAGS variable to define the compiler flags used to enfore
 #   ANSI compliance.
 #
-ifndef CFLAGS
-  CFLAGS := /nologo /c /Ox /G5 /W3 /WX
-endif
+CFLAGS ?= /nologo /c /Ox /G5 /W3 /WX
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
diff --git a/builds/compiler/watcom.mk b/builds/compiler/watcom.mk
index 12394be..4db1e7f 100644
--- a/builds/compiler/watcom.mk
+++ b/builds/compiler/watcom.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -63,9 +63,7 @@ T := -FO=
 #   Use the ANSIFLAGS variable to define the compiler flags used to enfore
 #   ANSI compliance.
 #
-ifndef CFLAGS
-  CFLAGS := -zq
-endif
+CFLAGS ?= -zq
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
@@ -74,12 +72,10 @@ ANSIFLAGS := -za
 
 # Library linking
 #
-ifndef CLEAN_LIBRARY
-  CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = $(subst /,$(COMPILER_SEP), \
-                 wlib -q -n $@; \
-                 $(foreach m, $(OBJECTS_LIST), wlib -q $@ +$(m);) \
-                 echo > nul)
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY   = $(subst /,$(COMPILER_SEP), \
+                   wlib -q -n $@; \
+                   $(foreach m, $(OBJECTS_LIST), wlib -q $@ +$(m);) \
+                   echo > nul)
 
 # EOF
diff --git a/builds/compiler/win-lcc.mk b/builds/compiler/win-lcc.mk
index c500d82..5d02d82 100644
--- a/builds/compiler/win-lcc.mk
+++ b/builds/compiler/win-lcc.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -63,9 +63,7 @@ T := -Fo
 #   Use the ANSIFLAGS variable to define the compiler flags used to enfore
 #   ANSI compliance.
 #
-ifndef CFLAGS
-  CFLAGS := -c -g2 -O
-endif
+CFLAGS ?= -c -g2 -O
 
 # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
diff --git a/builds/detect.mk b/builds/detect.mk
index eeb1300..6d85f0c 100644
--- a/builds/detect.mk
+++ b/builds/detect.mk
@@ -38,12 +38,6 @@
 #   TOP_DIR      The top-most directory in the FreeType library source
 #                hierarchy.  If not defined, it will default to `.'.
 
-# If TOP_DIR is not defined, default it to `.'
-#
-ifndef TOP_DIR
-  TOP_DIR := .
-endif
-
 # Set auto-detection default to `ansi' resp. UNIX-like operating systems.
 #
 PLATFORM     := ansi
diff --git a/builds/dos/detect.mk b/builds/dos/detect.mk
index 43c48d0..cabc6d6 100644
--- a/builds/dos/detect.mk
+++ b/builds/dos/detect.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2004 by
+# Copyright 1996-2000, 2003, 2004, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -73,9 +73,7 @@ ifeq ($(PLATFORM),dos)
   # Use DJGPP (i.e. gcc) by default.
   #
   CONFIG_FILE := dos-gcc.mk
-  ifndef CC
-    CC        := gcc
-  endif
+  CC          ?= gcc
 
   # additionally, we provide hooks for various other compilers
   #
diff --git a/builds/freetype.mk b/builds/freetype.mk
index 2f9b540..c60e9ef 100644
--- a/builds/freetype.mk
+++ b/builds/freetype.mk
@@ -105,9 +105,7 @@ CACHE_DIR    := $(PUBLIC_DIR)/cache
 
 # The documentation directory.
 #
-ifndef DOC_DIR
-  DOC_DIR := $(TOP_DIR)/docs/reference
-endif
+DOC_DIR ?= $(TOP_DIR)/docs/reference
 
 # The final name of the library file.
 #
@@ -192,9 +190,7 @@ FREETYPE_H := $(PUBLIC_H) $(BASE_H) $(CONFIG_H) $(CACHE_H) $(DEVEL_H)
 
 # ftsystem component
 #
-ifndef FTSYS_SRC
-  FTSYS_SRC := $(BASE_DIR)/ftsystem.c
-endif
+FTSYS_SRC ?= $(BASE_DIR)/ftsystem.c
 
 FTSYS_OBJ := $(OBJ_DIR)/ftsystem.$O
 
@@ -206,9 +202,7 @@ $(FTSYS_OBJ): $(FTSYS_SRC) $(FREETYPE_H)
 
 # ftdebug component
 #
-ifndef FTDEBUG_SRC
-  FTDEBUG_SRC := $(BASE_DIR)/ftdebug.c
-endif
+FTDEBUG_SRC ?= $(BASE_DIR)/ftdebug.c
 
 FTDEBUG_OBJ := $(OBJ_DIR)/ftdebug.$O
 
diff --git a/builds/os2/os2-dev.mk b/builds/os2/os2-dev.mk
index bd12215..83da8de 100644
--- a/builds/os2/os2-dev.mk
+++ b/builds/os2/os2-dev.mk
@@ -15,10 +15,6 @@
 # fully.
 
 
-ifndef TOP_DIR
-  TOP_DIR := .
-endif
-
 DEVEL_DIR := $(TOP_DIR)/devel
 
 # include OS/2-specific definitions
diff --git a/builds/toplevel.mk b/builds/toplevel.mk
index 4a6c9fc..aab0fd1 100644
--- a/builds/toplevel.mk
+++ b/builds/toplevel.mk
@@ -58,9 +58,7 @@ endif
 # FTMODULE_H, as its name suggests, indicates where the FreeType module
 # classes resides.
 #
-ifndef FTMODULE_H
-  FTMODULE_H := $(OBJ_DIR)/ftmodule.h
-endif
+FTMODULE_H ?= $(OBJ_DIR)/ftmodule.h
 
 
 include $(MODULES_CFG)
@@ -74,9 +72,7 @@ MODULES := $(FONT_MODULES)    \
            $(AUX_MODULES)
 
 
-ifndef CONFIG_MK
-  CONFIG_MK := config.mk
-endif
+CONFIG_MK ?= config.mk
 
 # If no configuration sub-makefile is present, or if `setup' is the target
 # to be built, run the auto-detection rules to figure out which
diff --git a/builds/win32/w32-dev.mk b/builds/win32/w32-dev.mk
index bf3fe3a..00cacb0 100644
--- a/builds/win32/w32-dev.mk
+++ b/builds/win32/w32-dev.mk
@@ -19,10 +19,6 @@
 #       Shell (_not_ Cygwin BASH)!
 #
 
-ifndef TOP_DIR
-  TOP_DIR := .
-endif
-
 DEVEL_DIR := $(TOP_DIR)/devel
 
 include $(TOP_DIR)/builds/win32/win32-def.mk