Commit 89df58f8e691967b490bd0bf17a066c7cd2f306c

Werner Lemberg 2002-06-14T08:09:25

* Makefile, configure, */*.mk, builds/unix/unix-def.in, docs/CHANGES, docs/INSTALL: s/TOP/TOP_DIR/.

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
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
diff --git a/ChangeLog b/ChangeLog
index 3110f6a..69602d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-06-14  Werner Lemberg  <wl@gnu.org>
+
+	* Makefile, configure, */*.mk, builds/unix/unix-def.in,
+	docs/CHANGES, docs/INSTALL: s/TOP/TOP_DIR/.
+
 2002-06-12  Werner Lemberg  <wl@gnu.org>
 
 	* src/bdf/bdflib.c: s/FT_Short/short/ for consistency.
diff --git a/Makefile b/Makefile
index 04881c0..e1fbdf2 100644
--- a/Makefile
+++ b/Makefile
@@ -20,13 +20,13 @@ PROJECT_TITLE := FreeType
 
 USE_MODULES := 1
 
-# The variable TOP holds the path to the topmost directory in the project
+# 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
-  TOP := .
+ifndef TOP_DIR
+  TOP_DIR := .
 endif
 
-include $(TOP)/builds/toplevel.mk
+include $(TOP_DIR)/builds/toplevel.mk
 
 # EOF
diff --git a/builds/ansi/ansi-def.mk b/builds/ansi/ansi-def.mk
index e755e75..032a7b8 100644
--- a/builds/ansi/ansi-def.mk
+++ b/builds/ansi/ansi-def.mk
@@ -13,14 +13,14 @@
 # fully.
 
 
-ifndef TOP
-  TOP := .
+ifndef TOP_DIR
+  TOP_DIR := .
 endif
 
 DELETE   := rm -f
 SEP      := /
 HOSTSEP  := $(SEP)
-BUILD    := $(TOP)/builds/ansi
+BUILD    := $(TOP_DIR)/builds/ansi
 PLATFORM := ansi
 
 
@@ -28,13 +28,13 @@ PLATFORM := ansi
 #
 # This lets you build the library in your own directory with something like
 #
-#   set TOP=.../path/to/freetype2/top/dir...
+#   set TOP_DIR=.../path/to/freetype2/top/dir...
 #   set OBJ_DIR=.../path/to/obj/dir
-#   make -f $TOP/Makefile setup [options]
-#   make -f $TOP/Makefile
+#   make -f $TOP_DIR/Makefile setup [options]
+#   make -f $TOP_DIR/Makefile
 #
 ifndef OBJ_DIR
-  OBJ_DIR := $(TOP)$(SEP)objs
+  OBJ_DIR := $(TOP_DIR)$(SEP)objs
 endif
 
 
diff --git a/builds/ansi/ansi.mk b/builds/ansi/ansi.mk
index 6a49774..739d485 100644
--- a/builds/ansi/ansi.mk
+++ b/builds/ansi/ansi.mk
@@ -13,8 +13,8 @@
 # fully.
 
 
-include $(TOP)/builds/ansi/ansi-def.mk
-include $(TOP)/builds/compiler/ansi-cc.mk
-include $(TOP)/builds/link_std.mk
+include $(TOP_DIR)/builds/ansi/ansi-def.mk
+include $(TOP_DIR)/builds/compiler/ansi-cc.mk
+include $(TOP_DIR)/builds/link_std.mk
 
 # EOF
diff --git a/builds/beos/beos-def.mk b/builds/beos/beos-def.mk
index 60f9def..eb55db9 100644
--- a/builds/beos/beos-def.mk
+++ b/builds/beos/beos-def.mk
@@ -15,14 +15,14 @@
 # fully.
 
 
-ifndef TOP
-  TOP := .
+ifndef TOP_DIR
+  TOP_DIR := .
 endif
 
 DELETE   := rm -f
 SEP      := /
 HOSTSEP  := $(SEP)
-BUILD    := $(TOP)/builds/neos
+BUILD    := $(TOP_DIR)/builds/neos
 PLATFORM := beos
 
 
@@ -30,13 +30,13 @@ PLATFORM := beos
 #
 # This lets you build the library in your own directory with something like
 #
-#   set TOP=.../path/to/freetype2/top/dir...
+#   set TOP_DIR=.../path/to/freetype2/top/dir...
 #   set OBJ_DIR=.../path/to/obj/dir
-#   make -f $TOP/Makefile setup [options]
-#   make -f $TOP/Makefile
+#   make -f $TOP_DIR/Makefile setup [options]
+#   make -f $TOP_DIR/Makefile
 #
 ifndef OBJ_DIR
-  OBJ_DIR := $(TOP)$(SEP)objs
+  OBJ_DIR := $(TOP_DIR)$(SEP)objs
 endif
 
 
diff --git a/builds/beos/beos.mk b/builds/beos/beos.mk
index 9c0ff5f..1ccf8ce 100644
--- a/builds/beos/beos.mk
+++ b/builds/beos/beos.mk
@@ -11,9 +11,9 @@
 # indicate that you have read the license and understand and accept it
 # fully.
 
-include $(TOP)/builds/compiler/ansi-cc.mk
-include $(TOP)/builds/beos/beos-def.mk
-include $(TOP)/builds/link_std.mk
+include $(TOP_DIR)/builds/compiler/ansi-cc.mk
+include $(TOP_DIR)/builds/beos/beos-def.mk
+include $(TOP_DIR)/builds/link_std.mk
 
 # EOF
 
diff --git a/builds/beos/detect.mk b/builds/beos/detect.mk
index 30330c7..89b3f68 100644
--- a/builds/beos/detect.mk
+++ b/builds/beos/detect.mk
@@ -30,7 +30,7 @@ ifeq ($(PLATFORM),beos)
   DELETE   := rm -f
   SEP      := /
   HOSTSEP  := $(SEP)
-  BUILD    := $(TOP)/builds/beos
+  BUILD    := $(TOP_DIR)/builds/beos
   CONFIG_FILE := beos.mk
 
   setup: std_setup
diff --git a/builds/detect.mk b/builds/detect.mk
index 99467a9..ad825ad 100644
--- a/builds/detect.mk
+++ b/builds/detect.mk
@@ -34,13 +34,13 @@
 #
 # You need to set the following variable(s) before calling it:
 #
-#   TOP          The top-most directory in the FreeType library source
+#   TOP_DIR      The top-most directory in the FreeType library source
 #                hierarchy.  If not defined, it will default to `.'.
 
-# If TOP is not defined, default it to `.'
+# If TOP_DIR is not defined, default it to `.'
 #
-ifndef TOP
-  TOP := .
+ifndef TOP_DIR
+  TOP_DIR := .
 endif
 
 # Set auto-detection default to `ansi' resp. UNIX-like operating systems.
@@ -52,7 +52,7 @@ DELETE   := $(RM)
 COPY     := cp
 SEP      := /
 
-BUILD_CONFIG_ = $(TOP)$(SEP)builds$(SEP)
+BUILD_CONFIG_ = $(TOP_DIR)$(SEP)builds$(SEP)
 BUILD         = $(BUILD_CONFIG_)$(PLATFORM)
 CONFIG_RULES  = $(BUILD)$(SEP)$(CONFIG_FILE)
 
diff --git a/builds/dos/dos-def.mk b/builds/dos/dos-def.mk
index a535305..d2bcbd4 100644
--- a/builds/dos/dos-def.mk
+++ b/builds/dos/dos-def.mk
@@ -15,7 +15,7 @@
 
 DELETE   := del
 HOSTSEP  := $(strip \ )
-BUILD    := $(TOP)$(SEP)builds$(SEP)dos
+BUILD    := $(TOP_DIR)$(SEP)builds$(SEP)dos
 PLATFORM := dos
 
 # except for DJGPP/GCC on Dos
@@ -28,13 +28,13 @@ endif
 #
 # This lets you build the library in your own directory with something like
 #
-#   set TOP=.../path/to/freetype2/top/dir...
+#   set TOP_DIR=.../path/to/freetype2/top/dir...
 #   set OBJ_DIR=.../path/to/obj/dir
-#   make -f %TOP%/Makefile setup [options]
-#   make -f %TOP%/Makefile
+#   make -f %TOP_DIR%/Makefile setup [options]
+#   make -f %TOP_DIR%/Makefile
 #
 ifndef OBJ_DIR
-  OBJ_DIR := $(TOP)$(SEP)objs
+  OBJ_DIR := $(TOP_DIR)$(SEP)objs
 endif
 
 
diff --git a/builds/dos/dos-gcc.mk b/builds/dos/dos-gcc.mk
index 1fab6f0..14a9d38 100644
--- a/builds/dos/dos-gcc.mk
+++ b/builds/dos/dos-gcc.mk
@@ -15,8 +15,8 @@
 
 SEP := /
 
-include $(TOP)/builds/dos/dos-def.mk
-include $(TOP)/builds/compiler/gcc.mk
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/dos/dos-def.mk
+include $(TOP_DIR)/builds/compiler/gcc.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 # EOF
diff --git a/builds/freetype.mk b/builds/freetype.mk
index 96473d8..9b5921c 100644
--- a/builds/freetype.mk
+++ b/builds/freetype.mk
@@ -21,7 +21,7 @@
 # environment, or on the command line) are used:
 #
 #   BUILD          The architecture dependent directory,
-#                  e.g. `$(TOP)/builds/unix'.
+#                  e.g. `$(TOP_DIR)/builds/unix'.
 #
 #   OBJ_DIR        The directory in which object files are created.
 #
@@ -62,7 +62,7 @@
 #                  variables which is to be removed for the `clean' resp.
 #                  `distclean' target.
 #
-#   TOP, SEP,
+#   TOP_DIR, SEP,
 #   LIBRARY, CC,
 #   A, I, O, T     Check `config.mk' for details.
 
@@ -83,7 +83,7 @@ multi: objects library
 
 # The FreeType source directory, usually `./src'.
 #
-SRC := $(TOP)$(SEP)src
+SRC := $(TOP_DIR)$(SEP)src
 
 
 # The directory where the base layer components are placed, usually
@@ -95,7 +95,7 @@ BASE_DIR := $(SRC)$(SEP)base
 # as macro.
 #
 ifndef FT_BUILD_H
-  FT_BUILD_H  := $(TOP)$(SEP)include$(SEP)ft2build.h
+  FT_BUILD_H  := $(TOP_DIR)$(SEP)include$(SEP)ft2build.h
   FTBUILD_CMD :=
 else
   FTBUILD_CMD = $(D)FT_BUILD_H=$(FT_BUILD_H)
@@ -104,14 +104,14 @@ endif
 # A few short-cuts in order to avoid typing $(SEP) all the time for the
 # directory separator.
 #
-# For example: $(SRC_) equals to `./src/' where `.' is $(TOP).
+# For example: $(SRC_) equals to `./src/' where `.' is $(TOP_DIR).
 #
 #
 SRC_      := $(SRC)$(SEP)
 BASE_     := $(BASE_DIR)$(SEP)
 OBJ_      := $(OBJ_DIR)$(SEP)
 LIB_      := $(LIB_DIR)$(SEP)
-PUBLIC_   := $(TOP)$(SEP)include$(SEP)freetype$(SEP)
+PUBLIC_   := $(TOP_DIR)$(SEP)include$(SEP)freetype$(SEP)
 INTERNAL_ := $(PUBLIC_)internal$(SEP)
 CONFIG_   := $(PUBLIC_)config$(SEP)
 CACHE_    := $(PUBLIC_)cache$(SEP)
@@ -130,7 +130,7 @@ PROJECT_LIBRARY := $(LIB_)$(LIBRARY).$A
 #                 in the `freetype/builds/<system>' directory, as these
 #                 files will override the default sources.
 #
-INCLUDES := $(OBJ_DIR) $(BUILD) $(TOP)$(SEP)include
+INCLUDES := $(OBJ_DIR) $(BUILD) $(TOP_DIR)$(SEP)include
 
 INCLUDE_FLAGS = $(INCLUDES:%=$I%)
 
@@ -149,7 +149,7 @@ FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS)
 
 # Include the `modules' rules file.
 #
-include $(TOP)/builds/modules.mk
+include $(TOP_DIR)/builds/modules.mk
 
 
 # Initialize the list of objects.
@@ -158,7 +158,7 @@ OBJECTS_LIST :=
 
 
 # Define $(PUBLIC_H) as the list of all public header files located in
-# `$(TOP)/include/freetype'.  $(BASE_H), $(CACHE_H), and $(CONFIG_H) are
+# `$(TOP_DIR)/include/freetype'.  $(BASE_H), $(CACHE_H), and $(CONFIG_H) are
 # defined similarly.
 #
 # This is used to simplify the dependency rules -- if one of these files
diff --git a/builds/link_dos.mk b/builds/link_dos.mk
index 044a86b..bc36ed0 100644
--- a/builds/link_dos.mk
+++ b/builds/link_dos.mk
@@ -20,7 +20,7 @@ ifdef BUILD_PROJECT
   # Now include the main sub-makefile.  It contains all the rules used to
   # build the library with the previous variables defined.
   #
-  include $(TOP)/builds/$(PROJECT).mk
+  include $(TOP_DIR)/builds/$(PROJECT).mk
 
   # The cleanup targets.
   #
diff --git a/builds/link_std.mk b/builds/link_std.mk
index 193c342..d59f2c3 100644
--- a/builds/link_std.mk
+++ b/builds/link_std.mk
@@ -20,7 +20,7 @@ ifdef BUILD_PROJECT
   # Now include the main sub-makefile.  It contains all the rules used to
   # build the library with the previous variables defined.
   #
-  include $(TOP)/builds/$(PROJECT).mk
+  include $(TOP_DIR)/builds/$(PROJECT).mk
 
   # The cleanup targets.
   #
diff --git a/builds/modules.mk b/builds/modules.mk
index 3f911de..536ca54 100644
--- a/builds/modules.mk
+++ b/builds/modules.mk
@@ -26,7 +26,7 @@
 # resides.  For now, it is in `include/freetype/config/ftmodule.h'.
 #
 ifndef MODULE_LIST
-  MODULE_LIST := $(TOP)$(SEP)include$(SEP)$(PROJECT)$(SEP)config$(SEP)ftmodule.h
+  MODULE_LIST := $(TOP_DIR)$(SEP)include$(SEP)$(PROJECT)$(SEP)config$(SEP)ftmodule.h
 endif
 
 # To build the modules list, we invoke the `make_module_list' target.
@@ -71,6 +71,6 @@ ECHO_DRIVER_DONE := )"
 # Each `module.mk' in the `src' sub-dirs is used to add one rule to the
 # target `make_module_list'.
 #
-include $(wildcard $(TOP)/src/*/module.mk)
+include $(wildcard $(TOP_DIR)/src/*/module.mk)
 
 # EOF
diff --git a/builds/os2/os2-def.mk b/builds/os2/os2-def.mk
index 8f20ffb..ef4b811 100644
--- a/builds/os2/os2-def.mk
+++ b/builds/os2/os2-def.mk
@@ -15,7 +15,7 @@
 
 DELETE   := del
 HOSTSEP  := $(strip \ )
-BUILD    := $(TOP)$(SEP)builds$(SEP)os2
+BUILD    := $(TOP_DIR)$(SEP)builds$(SEP)os2
 PLATFORM := os2
 
 # except for GCC+emx on OS/2
@@ -28,13 +28,13 @@ endif
 #
 # This lets you build the library in your own directory with something like
 #
-#   set TOP=.../path/to/freetype2/top/dir...
+#   set TOP_DIR=.../path/to/freetype2/top/dir...
 #   set OBJ_DIR=.../path/to/obj/dir
-#   make -f %TOP%/Makefile setup [options]
-#   make -f %TOP%/Makefile
+#   make -f %TOP_DIR%/Makefile setup [options]
+#   make -f %TOP_DIR%/Makefile
 #
 ifndef OBJ_DIR
-  OBJ_DIR := $(TOP)$(SEP)objs
+  OBJ_DIR := $(TOP_DIR)$(SEP)objs
 endif
 
 
diff --git a/builds/os2/os2-dev.mk b/builds/os2/os2-dev.mk
index f1e96d2..6527b79 100644
--- a/builds/os2/os2-dev.mk
+++ b/builds/os2/os2-dev.mk
@@ -15,19 +15,19 @@
 # fully.
 
 
-ifndef TOP
-  TOP := .
+ifndef TOP_DIR
+  TOP_DIR := .
 endif
 
 SEP   := /
 
-include $(TOP)/builds/os2/os2-def.mk
-BUILD := $(TOP)/builds/devel
+include $(TOP_DIR)/builds/os2/os2-def.mk
+BUILD := $(TOP_DIR)/builds/devel
 
-include $(TOP)/builds/compiler/gcc-dev.mk
+include $(TOP_DIR)/builds/compiler/gcc-dev.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 
 # EOF
diff --git a/builds/os2/os2-gcc.mk b/builds/os2/os2-gcc.mk
index 275dacc..5853862 100644
--- a/builds/os2/os2-gcc.mk
+++ b/builds/os2/os2-gcc.mk
@@ -16,12 +16,12 @@
 SEP := /
 
 # include OS/2-specific definitions
-include $(TOP)/builds/os2/os2-def.mk
+include $(TOP_DIR)/builds/os2/os2-def.mk
 
 # include gcc-specific definitions
-include $(TOP)/builds/compiler/gcc.mk
+include $(TOP_DIR)/builds/compiler/gcc.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 # EOF
diff --git a/builds/toplevel.mk b/builds/toplevel.mk
index 27a7af7..2e9fbd0 100644
--- a/builds/toplevel.mk
+++ b/builds/toplevel.mk
@@ -52,7 +52,7 @@ endif
 # configuration rules file to use.
 #
 # Note that the configuration file is put in the current directory, which is
-# not necessarily $(TOP).
+# not necessarily $(TOP_DIR).
 
 # If `config.mk' is not present, set `check_platform'.
 #
@@ -81,10 +81,10 @@ ifdef check_platform
     #modules: make_module_list setup
   endif
 
-  include $(TOP)/builds/detect.mk
+  include $(TOP_DIR)/builds/detect.mk
 
   ifdef USE_MODULES
-    include $(TOP)/builds/modules.mk
+    include $(TOP_DIR)/builds/modules.mk
 
     ifeq ($(wildcard $(MODULE_LIST)),)
       setup: make_module_list
diff --git a/builds/unix/detect.mk b/builds/unix/detect.mk
index a6eb658..516f8ff 100644
--- a/builds/unix/detect.mk
+++ b/builds/unix/detect.mk
@@ -75,10 +75,10 @@ ifeq ($(PLATFORM),unix)
   have_mk := $(strip $(wildcard $(OBJ_DIR)/Makefile))
   ifneq ($(have_mk),)
     # we are building FT2 not in the src tree
-    unix-def.mk: $(TOP)/builds/unix/unix-def.in
-	    $(TOP)/builds/unix/configure $(CFG)
+    unix-def.mk: $(TOP_DIR)/builds/unix/unix-def.in
+	    $(TOP_DIR)/builds/unix/configure $(CFG)
   else
-    unix-def.mk: $(TOP)/builds/unix/unix-def.in
+    unix-def.mk: $(TOP_DIR)/builds/unix/unix-def.in
 	    cd builds/unix; ./configure $(CFG)
   endif
 
diff --git a/builds/unix/unix-def.in b/builds/unix/unix-def.in
index 6fcf06e..7a35588 100644
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
@@ -13,16 +13,16 @@
 # fully.
 
 
-ifndef TOP
-  TOP := .
+ifndef TOP_DIR
+  TOP_DIR := .
 endif
-TOP := $(shell cd $(TOP); pwd)
+TOP_DIR := $(shell cd $(TOP_DIR); pwd)
 
 DELETE   := @RMF@
 DELDIR   := @RMDIR@
 SEP      := /
 HOSTSEP  := $(SEP)
-BUILD    := $(TOP)/builds/unix
+BUILD    := $(TOP_DIR)/builds/unix
 PLATFORM := unix
 
 # this is used for `make distclean' and `make install'
@@ -66,13 +66,13 @@ version_info := @version_info@
 #
 # This lets you build the library in your own directory with something like
 #
-#   set TOP=.../path/to/freetype2/top/dir...
+#   set TOP_DIR=.../path/to/freetype2/top/dir...
 #   set OBJ_DIR=.../path/to/obj/dir
-#   make -f $TOP/Makefile setup [options]
-#   make -f $TOP/Makefile
+#   make -f $TOP_DIR/Makefile setup [options]
+#   make -f $TOP_DIR/Makefile
 #
 ifndef OBJ_DIR
-  OBJ_DIR := $(shell cd $(TOP)/objs; pwd)
+  OBJ_DIR := $(shell cd $(TOP_DIR)/objs; pwd)
 endif
 
 
diff --git a/builds/unix/unix-dev.mk b/builds/unix/unix-dev.mk
index 7d5d459..2f10734 100644
--- a/builds/unix/unix-dev.mk
+++ b/builds/unix/unix-dev.mk
@@ -16,10 +16,10 @@
 # fully.
 
 
-include $(TOP)/builds/unix/unixddef.mk
-BUILD := $(TOP)/builds/devel
+include $(TOP_DIR)/builds/unix/unixddef.mk
+BUILD := $(TOP_DIR)/builds/devel
 
-include $(TOP)/builds/compiler/gcc-dev.mk
-include $(TOP)/builds/link_std.mk
+include $(TOP_DIR)/builds/compiler/gcc-dev.mk
+include $(TOP_DIR)/builds/link_std.mk
 
 # EOF
diff --git a/builds/unix/unix-lcc.mk b/builds/unix/unix-lcc.mk
index dab175c..4ade02c 100644
--- a/builds/unix/unix-lcc.mk
+++ b/builds/unix/unix-lcc.mk
@@ -16,8 +16,8 @@
 # fully.
 
 
-include $(TOP)/builds/unix/unixddef.mk
-include $(TOP)/builds/compiler/unix-lcc.mk
-include $(TOP)/builds/link_std.mk
+include $(TOP_DIR)/builds/unix/unixddef.mk
+include $(TOP_DIR)/builds/compiler/unix-lcc.mk
+include $(TOP_DIR)/builds/link_std.mk
 
 # EOF
diff --git a/builds/unix/unix.mk b/builds/unix/unix.mk
index 57d951a..fae08b3 100644
--- a/builds/unix/unix.mk
+++ b/builds/unix/unix.mk
@@ -12,10 +12,10 @@
 # indicate that you have read the license and understand and accept it
 # fully.
 
-have_mk := $(strip $(wildcard $(TOP)/builds/unix/unix-def.mk))
+have_mk := $(strip $(wildcard $(TOP_DIR)/builds/unix/unix-def.mk))
 ifneq ($(have_mk),)
-  include $(TOP)/builds/unix/unix-def.mk
-  include $(TOP)/builds/unix/unix-cc.mk
+  include $(TOP_DIR)/builds/unix/unix-def.mk
+  include $(TOP_DIR)/builds/unix/unix-cc.mk
 else
   # we are building FT2 not in the src tree
   include $(OBJ_DIR)/unix-def.mk
@@ -29,7 +29,7 @@ ifdef BUILD_PROJECT
   # Now include the main sub-makefile.  It contains all the rules used to
   # build the library with the previous variables defined.
   #
-  include $(TOP)/builds/$(PROJECT).mk
+  include $(TOP_DIR)/builds/$(PROJECT).mk
 
 
   # The cleanup targets.
@@ -52,6 +52,6 @@ endif
 
 endif
 
-include $(TOP)/builds/unix/install.mk
+include $(TOP_DIR)/builds/unix/install.mk
 
 # EOF
diff --git a/builds/unix/unixddef.mk b/builds/unix/unixddef.mk
index b593db5..1ea1543 100644
--- a/builds/unix/unixddef.mk
+++ b/builds/unix/unixddef.mk
@@ -14,17 +14,17 @@
 # fully.
 
 
-ifndef TOP
-  TOP := .
+ifndef TOP_DIR
+  TOP_DIR := .
 endif
-TOP := $(shell cd $(TOP); pwd)
+TOP_DIR := $(shell cd $(TOP_DIR); pwd)
 
 DELETE   := rm -f
 SEP      := /
 HOSTSEP  := $(SEP)
 
 # we use a special devel ftoption.h
-BUILD    := $(TOP)/builds/devel
+BUILD    := $(TOP_DIR)/builds/devel
 
 # do not set the platform to `unix', or libtool will trick you
 PLATFORM := unixdev
@@ -33,7 +33,7 @@ PLATFORM := unixdev
 # The directory where all object files are placed.
 #
 ifndef OBJ_DIR
-  OBJ_DIR := $(shell cd $(TOP)/objs; pwd)
+  OBJ_DIR := $(shell cd $(TOP_DIR)/objs; pwd)
 endif
 
 
diff --git a/builds/win32/w32-bcc.mk b/builds/win32/w32-bcc.mk
index 824ddad..5c24724 100644
--- a/builds/win32/w32-bcc.mk
+++ b/builds/win32/w32-bcc.mk
@@ -14,10 +14,10 @@
 
 
 SEP := /
-include $(TOP)/builds/win32/win32-def.mk
-include $(TOP)/builds/compiler/bcc.mk
+include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/compiler/bcc.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 # EOF
diff --git a/builds/win32/w32-bccd.mk b/builds/win32/w32-bccd.mk
index 3c56d5d..80e44ff 100644
--- a/builds/win32/w32-bccd.mk
+++ b/builds/win32/w32-bccd.mk
@@ -15,12 +15,12 @@
 
 SEP   := /
 
-include $(TOP)/builds/win32/win32-def.mk
-BUILD := $(TOP)/builds/devel
+include $(TOP_DIR)/builds/win32/win32-def.mk
+BUILD := $(TOP_DIR)/builds/devel
 
-include $(TOP)/builds/compiler/bcc-dev.mk
+include $(TOP_DIR)/builds/compiler/bcc-dev.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 # EOF
diff --git a/builds/win32/w32-dev.mk b/builds/win32/w32-dev.mk
index 42932d0..17aa0aa 100644
--- a/builds/win32/w32-dev.mk
+++ b/builds/win32/w32-dev.mk
@@ -19,19 +19,19 @@
 #       Shell (_not_ Cygwin BASH)!
 #
 
-ifndef TOP
-  TOP := .
+ifndef TOP_DIR
+  TOP_DIR := .
 endif
 
 SEP   := /
 
-include $(TOP)/builds/win32/win32-def.mk
-BUILD := $(TOP)/builds/devel
+include $(TOP_DIR)/builds/win32/win32-def.mk
+BUILD := $(TOP_DIR)/builds/devel
 
-include $(TOP)/builds/compiler/gcc-dev.mk
+include $(TOP_DIR)/builds/compiler/gcc-dev.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 
 
diff --git a/builds/win32/w32-gcc.mk b/builds/win32/w32-gcc.mk
index 0aed554..86f6ddd 100644
--- a/builds/win32/w32-gcc.mk
+++ b/builds/win32/w32-gcc.mk
@@ -18,12 +18,12 @@
 SEP := /
 
 # include Win32-specific definitions
-include $(TOP)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/win32/win32-def.mk
 
 # include gcc-specific definitions
-include $(TOP)/builds/compiler/gcc.mk
+include $(TOP_DIR)/builds/compiler/gcc.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 # EOF
diff --git a/builds/win32/w32-icc.mk b/builds/win32/w32-icc.mk
index 49812ed..8b63ce0 100644
--- a/builds/win32/w32-icc.mk
+++ b/builds/win32/w32-icc.mk
@@ -13,10 +13,10 @@
 # fully.
 
 
-include $(TOP)/builds/win32/win32-def.mk
-include $(TOP)/builds/compiler/visualage.mk
+include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/compiler/visualage.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 # EOF
diff --git a/builds/win32/w32-intl.mk b/builds/win32/w32-intl.mk
index 6ae022f..4f6a034 100644
--- a/builds/win32/w32-intl.mk
+++ b/builds/win32/w32-intl.mk
@@ -14,10 +14,10 @@
 
 
 SEP := /
-include $(TOP)/builds/win32/win32-def.mk
-include $(TOP)/builds/compiler/intelc.mk
+include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/compiler/intelc.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 # EOF
diff --git a/builds/win32/w32-lcc.mk b/builds/win32/w32-lcc.mk
index 29473bc..a147c4c 100644
--- a/builds/win32/w32-lcc.mk
+++ b/builds/win32/w32-lcc.mk
@@ -14,11 +14,11 @@
 
 
 SEP := /
-include $(TOP)/builds/win32/win32-def.mk
-include $(TOP)/builds/compiler/win-lcc.mk
+include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/compiler/win-lcc.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 # EOF
 
diff --git a/builds/win32/w32-mingw32.mk b/builds/win32/w32-mingw32.mk
index 87f9887..236e810 100644
--- a/builds/win32/w32-mingw32.mk
+++ b/builds/win32/w32-mingw32.mk
@@ -18,14 +18,14 @@
 SEP := /
 
 # include Win32-specific definitions
-include $(TOP)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/win32/win32-def.mk
 
 LIBRARY := lib$(PROJECT)
 
 # include gcc-specific definitions
-include $(TOP)/builds/compiler/gcc.mk
+include $(TOP_DIR)/builds/compiler/gcc.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 # EOF
diff --git a/builds/win32/w32-vcc.mk b/builds/win32/w32-vcc.mk
index 516b028..459e187 100644
--- a/builds/win32/w32-vcc.mk
+++ b/builds/win32/w32-vcc.mk
@@ -14,10 +14,10 @@
 
 
 SEP := /
-include $(TOP)/builds/win32/win32-def.mk
-include $(TOP)/builds/compiler/visualc.mk
+include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/compiler/visualc.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 # EOF
diff --git a/builds/win32/w32-wat.mk b/builds/win32/w32-wat.mk
index b5fed58..ab250dc 100644
--- a/builds/win32/w32-wat.mk
+++ b/builds/win32/w32-wat.mk
@@ -16,11 +16,11 @@
 SEP  := /
 ISEP := $(strip \ )
 
-include $(TOP)/builds/win32/win32-def.mk
-include $(TOP)/builds/compiler/watcom.mk
+include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/compiler/watcom.mk
 
 # include linking instructions
-include $(TOP)/builds/link_dos.mk
+include $(TOP_DIR)/builds/link_dos.mk
 
 # EOF
 
diff --git a/builds/win32/win32-def.mk b/builds/win32/win32-def.mk
index c71d856..9b43a03 100644
--- a/builds/win32/win32-def.mk
+++ b/builds/win32/win32-def.mk
@@ -15,7 +15,7 @@
 
 DELETE   := del
 HOSTSEP  := $(strip \ )
-BUILD    := $(TOP)$(SEP)builds$(SEP)win32
+BUILD    := $(TOP_DIR)$(SEP)builds$(SEP)win32
 PLATFORM := win32
 
 # by default, we use "\" as a separator on Win32
@@ -30,13 +30,13 @@ endif
 #
 # This lets you build the library in your own directory with something like
 #
-#   set TOP=.../path/to/freetype2/top/dir...
+#   set TOP_DIR=.../path/to/freetype2/top/dir...
 #   set OBJ_DIR=.../path/to/obj/dir
-#   make -f %TOP%/Makefile setup [options]
-#   make -f %TOP%/Makefile
+#   make -f %TOP_DIR%/Makefile setup [options]
+#   make -f %TOP_DIR%/Makefile
 #
 ifndef OBJ_DIR
-  OBJ_DIR := $(TOP)$(SEP)objs
+  OBJ_DIR := $(TOP_DIR)$(SEP)objs
 endif
 
 
diff --git a/configure b/configure
index 982a1df..1198380 100644
--- a/configure
+++ b/configure
@@ -47,7 +47,7 @@ abs_ft2_dir=`cd "$ft2_dir" && pwd`
 
 if test "$abs_curr_dir" != "$abs_ft2_dir"; then
   echo "OBJ_DIR=$abs_curr_dir"          > Makefile
-  echo "TOP=$abs_ft2_dir"              >> Makefile
+  echo "TOP_DIR=$abs_ft2_dir"          >> Makefile
   echo "OBJ_BUILD=$abs_curr_dir"       >> Makefile
   echo "LIBTOOL=$abs_curr_dir/libtool" >> Makefile
   echo "include $abs_ft2_dir/Makefile" >> Makefile
diff --git a/docs/CHANGES b/docs/CHANGES
index d084179..3af33e8 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -1270,7 +1270,7 @@ OLD CHANGES 16 May 2000
 
     Here's a layout of the new directory hierarchy:
 
-    TOP
+    TOP_DIR
       include/
          freetype/
             freetype.h
@@ -1298,7 +1298,7 @@ OLD CHANGES 16 May 2000
 
 
     Compiling a module is now  much easier, for example, the following
-    should work when in the TOP directory on an ANSI build:
+    should work when in the TOP_DIR directory on an ANSI build:
 
        gcc -c -I./include -I./src/base src/base/ftbase.c
        gcc -c -I./include -I./src/sfnt src/sfnt/sfnt.c
diff --git a/docs/INSTALL b/docs/INSTALL
index e959ed8..22207e3 100644
--- a/docs/INSTALL
+++ b/docs/INSTALL
@@ -118,15 +118,15 @@ II. From the command line
 
 
   If you want  to build FreeType 2 in another  directory, you must set
-  two environment  variables, `OJB_DIR'  and `TOP'.  The  former gives
-  the  directory where  the object  files  and the  library should  be
+  two  environment  variables,  `OJB_DIR'  and  `TOP_DIR'.  The former
+  gives the directory where the object files and the library should  be
   created (this directory must exist), the latter the top directory of
   the FreeType 2 source tree.  Example:
 
-    OBJ_DIR=~/freetype2.compiled TOP=~/freetype2 \
-      make -f$TOP/Makefile setup ansi
-    OBJ_DIR=~/freetype2.compiled TOP=~/freetype2 \
-      make -f$TOP/Makefile
+    OBJ_DIR=~/freetype2.compiled TOP_DIR=~/freetype2 \
+      make -f$TOP_DIR/Makefile setup ansi
+    OBJ_DIR=~/freetype2.compiled TOP_DIR=~/freetype2 \
+      make -f$TOP_DIR/Makefile
 
   On  Unix boxes,  calling  `configure' from  the  build directory  is
   sufficient;  it  will  build  a  small   Makefile  which  calls  the