Commit 59939244adfdd423ebe5c0af56ecb081a1b73ebc

Werner Lemberg 2006-01-31T20:17:42

Implement new, simplified module selection. With GNU make it is now sufficient to modify a single file, `modules.cfg', to control the inclusion of modules and base extension files. This change also fixes the creation of ftmodule.h; it now depends on `modules.cfg' and thus is rebuilt only if necessary. Finally, a version of `ftoption.h' in OBJ_DIR is preferred over the default location. * modules.cfg: New file. * builds/freetype.mk: Don't include `modules.mk'. Include all `rules.mk' files as specified in `modules.cfg'. (FTOPTION_FLAG, FTOPTION_H): New variables. (FT_CFLAGS): Add macro definition for FT_CONFIG_MODULES_H. Add FTOPTION_FLAG. ($(FT_INIT_OBJ)): Don't use FT_MODULE_LIST. (CONFIG_H): Add FTMODULE_H and FTOPTION_H. (INCLUDES): Add DEVEL_DIR. (INCLUDE_FLAGS, FTSYS_SRC, FTSYS_OBJ, FTDEBUG_SRC, FTDEBUG_OBJ, OBJ_M, OBJ_S): Use `:=', not `='. (remove_ftmodule_h): New phony target to delete `ftmodule.h'. (distclean): Add remove_ftmodule_h. * builds/modules.mk: (MODULE_LIST): Removed. (make_module_list, clean_module_list): Replace targets with... (FTMODULE_H_INIT, FTMODULE_H_CREATE, FTMODULE_H_DONE): New variables. Reason for the change is that it is not possible to have a phony prerequisite which is run only if the target file must be rebuilt (phony prerequisites act like subroutines and are *always* executed). We only want to rebuild `ftmodule.h' if `module.cfg' is changed. Update all callers. ($FTMODULE_H)): Rule to create `ftmodule.h', depending on `modules.cfg'. * builds/toplevel.mk: Rewrite and simplify module handling. (MODULES_CFG, FTMODULE_H): New variables. Include MODULES_CFG. (MODULES): New variable to include all `module.mk' and `rules.mk' files. We no longer use make's `wildcard' function for this. * Makefile (USE_MODULES): Remove. Update all users. (OBJ_DIR): Define it here. * src/*/module.mk: Change make_module_list: foo foo: ... to FTMODULE_H_COMMANDS += FOO define FOO ... endef in all files. `FTMODULE_H_COMMANDS' is used in `FTMODULE_H_CREATE'. * src/base/rules.mk (BASE_EXT_SRC): Use BASE_EXTENSIONS. * builds/unix/detect.mk (setup): Always execute `configure' script. (have_mk): Rename to... (have_Makefile): This. Don't use `strip' function. * builds/unix/unix.mk: Include `install.mk' only if BUILD_PROJECT is defined. (have_mk): Don't use `strip' function. Test for unix-def.mk in OBJ_DIR, not BUILD_DIR (and invert the test accordingly). * builds/unix/install.mk (install, uninstall): Handle `ftmodule.h'. * builds/os2/os2-dev.mk, builds/unix/unix-dev.mk, builds/win32/w32-bccd.mk, builds/win32/w32-dev.mk: Don't define BUILD_DIR but DEVEL_DIR for development header files. * builds/ansi/ansi-def.mk (TOP_DIR, OBJ_DIR), builds/beos/beos-def.mk (TOP_DIR, OBJ_DIR), builds/unix/unix-def.in (TOP_DIR, OBJ_DIR): Removed. Defined elsewhere. * builds/dos/dos-def.mk (OBJ_DIR), builds/os2/os2-def.mk (OBJ_DIR), builds/win32/win32-def.mk (OBJ_DIR): Removed. Defined elsewhere. * builds/unix/unixddef.mk: Don't define BUILD_DIR but DEVEL_DIR for development header files. Don't define PLATFORM. * configure: Copy `modules.cfg' to builddir if builddir != srcdir. Update snippet taken from autoconf's m4sh.m4 to current CVS version. Be more verbose. * include/freetype/config/ftmodule.h: Add comments -- this file is no longer used if FreeType is built with GNU make. * docs/CHANGES, docs/CUSTOMIZE, docs/INSTALL, docs/INSTALL.ANY, docs/INSTALL.GNU, docs/INSTALL.UNX: Document new build mechanism. Other minor updates. * modules.txt: Removed. Contents included in `modules.cfg'. * include/freetype/internal/ftmemory.h (FT_QAlloc_Debug, FT_Free_Debug) [FT_STRICT_ALIASING]: Fix typos. * src/base/ftdbgmem.c (FT_Alloc_Debug, FT_Realloc_Debug, FT_QAlloc_Debug, FT_QRealloc_Debug, FT_Free_Debug) [FT_STRICT_ALIASING]: Implement.

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
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
diff --git a/ChangeLog b/ChangeLog
index e9a636c..c2f700d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,123 @@
+2006-01-29  Werner Lemberg  <wl@gnu.org>
+
+	Implement new, simplified module selection.  With GNU make it is now
+	sufficient to modify a single file, `modules.cfg', to control the
+	inclusion of modules and base extension files.
+
+	This change also fixes the creation of ftmodule.h; it now depends on
+	`modules.cfg' and thus is rebuilt only if necessary.
+
+	Finally, a version of `ftoption.h' in OBJ_DIR is preferred over the
+	default location.
+
+	* modules.cfg: New file.
+
+	* builds/freetype.mk: Don't include `modules.mk'.
+	Include all `rules.mk' files as specified in `modules.cfg'.
+	(FTOPTION_FLAG, FTOPTION_H): New variables.
+	(FT_CFLAGS): Add macro definition for FT_CONFIG_MODULES_H.
+	Add FTOPTION_FLAG.
+	($(FT_INIT_OBJ)): Don't use FT_MODULE_LIST.
+	(CONFIG_H): Add FTMODULE_H and FTOPTION_H.
+	(INCLUDES): Add DEVEL_DIR.
+	(INCLUDE_FLAGS, FTSYS_SRC, FTSYS_OBJ, FTDEBUG_SRC, FTDEBUG_OBJ,
+	OBJ_M, OBJ_S): Use `:=', not `='.
+	(remove_ftmodule_h): New phony target to delete `ftmodule.h'.
+	(distclean): Add remove_ftmodule_h.
+
+	* builds/modules.mk: (MODULE_LIST): Removed.
+	(make_module_list, clean_module_list): Replace targets
+	with...
+	(FTMODULE_H_INIT, FTMODULE_H_CREATE, FTMODULE_H_DONE): New
+	variables.  Reason for the change is that it is not possible to have
+	a phony prerequisite which is run only if the target file must be
+	rebuilt (phony prerequisites act like subroutines and are *always*
+	executed).  We only want to rebuild `ftmodule.h' if `module.cfg' is
+	changed.
+	Update all callers.
+	($FTMODULE_H)): Rule to create `ftmodule.h', depending on
+	`modules.cfg'.
+
+	* builds/toplevel.mk: Rewrite and simplify module handling.
+	(MODULES_CFG, FTMODULE_H): New variables.
+	Include MODULES_CFG.
+	(MODULES): New variable to include all `module.mk' and `rules.mk'
+	files.  We no longer use make's `wildcard' function for this.
+
+	* Makefile (USE_MODULES): Remove.  Update all users.
+	(OBJ_DIR): Define it here.
+
+	* src/*/module.mk: Change
+
+	    make_module_list: foo
+	    foo: ...
+
+	to
+
+	    FTMODULE_H_COMMANDS += FOO
+	    define FOO
+	    ...
+	    endef
+
+	in all files.  `FTMODULE_H_COMMANDS' is used in `FTMODULE_H_CREATE'.
+
+	* src/base/rules.mk (BASE_EXT_SRC): Use BASE_EXTENSIONS.
+
+	* builds/unix/detect.mk (setup): Always execute `configure' script.
+	(have_mk): Rename to...
+	(have_Makefile): This.
+	Don't use `strip' function.
+
+	* builds/unix/unix.mk: Include `install.mk' only if BUILD_PROJECT is
+	defined.
+	(have_mk): Don't use `strip' function.
+	Test for unix-def.mk in OBJ_DIR, not BUILD_DIR (and invert the test
+	accordingly).
+
+	* builds/unix/install.mk (install, uninstall): Handle `ftmodule.h'.
+
+	* builds/os2/os2-dev.mk, builds/unix/unix-dev.mk,
+	builds/win32/w32-bccd.mk, builds/win32/w32-dev.mk: Don't define
+	BUILD_DIR but DEVEL_DIR for development header files.
+
+	* builds/ansi/ansi-def.mk (TOP_DIR, OBJ_DIR),
+	builds/beos/beos-def.mk (TOP_DIR, OBJ_DIR), builds/unix/unix-def.in
+	(TOP_DIR, OBJ_DIR): Removed.  Defined elsewhere.
+
+	* builds/dos/dos-def.mk (OBJ_DIR), builds/os2/os2-def.mk (OBJ_DIR),
+	builds/win32/win32-def.mk (OBJ_DIR): Removed.  Defined elsewhere.
+
+	* builds/unix/unixddef.mk: Don't define BUILD_DIR but DEVEL_DIR for
+	development header files.
+	Don't define PLATFORM.
+
+	* configure: Copy `modules.cfg' to builddir if builddir != srcdir.
+	Update snippet taken from autoconf's m4sh.m4 to current CVS version.
+	Be more verbose.
+
+	* include/freetype/config/ftmodule.h: Add comments -- this file is
+	no longer used if FreeType is built with GNU make.
+
+	* docs/CHANGES, docs/CUSTOMIZE, docs/INSTALL, docs/INSTALL.ANY,
+	docs/INSTALL.GNU, docs/INSTALL.UNX: Document new build mechanism.
+	Other minor updates.
+
+	* modules.txt: Removed.  Contents included in `modules.cfg'.
+
+
+	* include/freetype/internal/ftmemory.h (FT_QAlloc_Debug,
+	FT_Free_Debug) [FT_STRICT_ALIASING]: Fix typos.
+
+	* src/base/ftdbgmem.c (FT_Alloc_Debug, FT_Realloc_Debug,
+	FT_QAlloc_Debug, FT_QRealloc_Debug, FT_Free_Debug)
+	[FT_STRICT_ALIASING]: Implement.
+
 2006-01-31  Chia-I Wu  <b90201047@ntu.edu.tw>
 
 	* src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
-	(cid_face_init), src/pfr/pfrobjs.c (pfr_face_init), src/type1/t1objs.c
-	(T1_Face_Init): Set face->height to
-	MAX(1.2 * units_per_EM, ascender - descender).
+	(cid_face_init), src/pfr/pfrobjs.c (pfr_face_init),
+	src/type1/t1objs.c (T1_Face_Init): Set face->height to MAX(1.2 *
+	units_per_EM, ascender - descender).
 
 2006-01-31  Chia-I Wu  <b90201047@ntu.edu.tw>
 
@@ -13,8 +127,8 @@
 
 	* src/type1/t1afm.c (T1_Read_Metrics): Use the metrics from the AFM.
 
-	* include/freetype/freetype.h (FT_FaceRec): Mention that fields may be
-	changed after file attachment.
+	* include/freetype/freetype.h (FT_FaceRec): Mention that fields may
+	be changed after file attachment.
 
 2006-01-28  Werner Lemberg  <wl@gnu.org>
 
diff --git a/Makefile b/Makefile
index 8caf1f0..ab8dba5 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002 by
+# Copyright 1996-2000, 2002, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -18,8 +18,6 @@
 PROJECT := freetype
 PROJECT_TITLE := FreeType
 
-USE_MODULES := 1
-
 # 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 `.'.
 #
@@ -27,6 +25,14 @@ ifndef TOP_DIR
   TOP_DIR := .
 endif
 
+# 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
+
+
 include $(TOP_DIR)/builds/toplevel.mk
 
 # EOF
diff --git a/builds/ansi/ansi-def.mk b/builds/ansi/ansi-def.mk
index bf2aa36..b456439 100644
--- a/builds/ansi/ansi-def.mk
+++ b/builds/ansi/ansi-def.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,
@@ -13,30 +13,12 @@
 # fully.
 
 
-ifndef TOP_DIR
-  TOP_DIR := .
-endif
-
 DELETE    := rm -f
 SEP       := /
 BUILD_DIR := $(TOP_DIR)/builds/ansi
 PLATFORM  := ansi
 
 
-# The directory where all object files are placed.
-#
-# This lets you build the library in your own directory with something like
-#
-#   set TOP_DIR=.../path/to/freetype2/top/dir...
-#   set OBJ_DIR=.../path/to/obj/dir
-#   make -f $TOP_DIR/Makefile setup [options]
-#   make -f $TOP_DIR/Makefile
-#
-ifndef OBJ_DIR
-  OBJ_DIR := $(TOP_DIR)/objs
-endif
-
-
 # The directory where all library files are placed.
 #
 # By default, this is the same as $(OBJ_DIR); however, this can be changed
diff --git a/builds/beos/beos-def.mk b/builds/beos/beos-def.mk
index b569fe6..c987410 100644
--- a/builds/beos/beos-def.mk
+++ b/builds/beos/beos-def.mk
@@ -5,7 +5,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,
@@ -15,30 +15,12 @@
 # fully.
 
 
-ifndef TOP_DIR
-  TOP_DIR := .
-endif
-
 DELETE    := rm -f
 SEP       := /
 BUILD_DIR := $(TOP_DIR)/builds/beos
 PLATFORM  := beos
 
 
-# The directory where all object files are placed.
-#
-# This lets you build the library in your own directory with something like
-#
-#   set TOP_DIR=.../path/to/freetype2/top/dir...
-#   set OBJ_DIR=.../path/to/obj/dir
-#   make -f $TOP_DIR/Makefile setup [options]
-#   make -f $TOP_DIR/Makefile
-#
-ifndef OBJ_DIR
-  OBJ_DIR := $(TOP_DIR)/objs
-endif
-
-
 # The directory where all library files are placed.
 #
 # By default, this is the same as $(OBJ_DIR); however, this can be changed
diff --git a/builds/dos/dos-def.mk b/builds/dos/dos-def.mk
index 70391bc..c68bd74 100644
--- a/builds/dos/dos-def.mk
+++ b/builds/dos/dos-def.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,
@@ -23,20 +23,6 @@ PLATFORM  := dos
 #
 E := .exe
 
-# The directory where all object files are placed.
-#
-# This lets you build the library in your own directory with something like
-#
-#   set TOP_DIR=.../path/to/freetype2/top/dir...
-#   set OBJ_DIR=.../path/to/obj/dir
-#   make -f %TOP_DIR%/Makefile setup [options]
-#   make -f %TOP_DIR%/Makefile
-#
-ifndef OBJ_DIR
-  OBJ_DIR := $(TOP_DIR)/objs
-endif
-
-
 # The directory where all library files are placed.
 #
 # By default, this is the same as $(OBJ_DIR); however, this can be changed
diff --git a/builds/freetype.mk b/builds/freetype.mk
index a87f7fe..2f9b540 100644
--- a/builds/freetype.mk
+++ b/builds/freetype.mk
@@ -21,7 +21,7 @@
 # environment, or on the command line) are used:
 #
 #   BUILD_DIR      The architecture dependent directory,
-#                  e.g. `$(TOP_DIR)/builds/unix'.
+#                  e.g. `$(TOP_DIR)/builds/unix'.  Added to INCLUDES also.
 #
 #   OBJ_DIR        The directory in which object files are created.
 #
@@ -30,7 +30,9 @@
 #   DOC_DIR        The directory in which the API reference is created.
 #
 #   INCLUDES       A list of directories to be included additionally.
-#                  Usually empty.
+#
+#   DEVEL_DIR      Development directory which is added to the INCLUDES
+#                  variable before the standard include directories.
 #
 #   CFLAGS         Compilation flags.  This overrides the default settings
 #                  in the platform-specific configuration files.
@@ -42,9 +44,9 @@
 #                  file for `src/base/ftdebug.c'.  [For a normal build, this
 #                  file does nothing.]
 #
-#   FT_MODULE_LIST The file which contains the list of modules for the
-#                  current build.  Usually, this is automatically created by
-#                  `modules.mk'.
+#   FTMODULE_H     The file which contains the list of module classes for
+#                  the current build.  Usually, this is automatically
+#                  created by `modules.mk'.
 #
 #   BASE_OBJ_S
 #   BASE_OBJ_M     A list of base objects (for single object and multiple
@@ -115,15 +117,17 @@ PROJECT_LIBRARY := $(LIB_DIR)/$(LIBRARY).$A
 # include paths
 #
 # IMPORTANT NOTE: The architecture-dependent directory must ALWAYS be placed
-#                 in front of the include list.  Porters are then able to
+#                 before the standard include list.  Porters are then able to
 #                 put their own version of some of the FreeType components
 #                 in the `freetype/builds/<system>' directory, as these
 #                 files will override the default sources.
 #
-INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) $(BUILD_DIR) \
+INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \
+                                      $(DEVEL_DIR) \
+                                      $(BUILD_DIR) \
                                       $(TOP_DIR)/include)
 
-INCLUDE_FLAGS = $(INCLUDES:%=$I%)
+INCLUDE_FLAGS := $(INCLUDES:%=$I%)
 
 
 # C flags used for the compilation of an object file.  This must include at
@@ -137,19 +141,30 @@ INCLUDE_FLAGS = $(INCLUDES:%=$I%)
 # FreeType.  This is required to let our sources include the internal
 # headers (something forbidden by clients).
 #
-FT_CFLAGS  = $(CPPFLAGS) $(INCLUDE_FLAGS) $(CFLAGS) $DFT2_BUILD_LIBRARY
+# Finally, we define FT_CONFIG_MODULES_H so that the compiler uses the
+# generated version of `ftmodule.h' in $(OBJ_DIR).  If there is an
+# `ftoption.h' files in $(OBJ_DIR), define FT_CONFIG_OPTIONS_H too.
+#
+ifneq ($(wildcard $(OBJ_DIR)/ftoption.h),)
+  FTOPTION_H    := $(OBJ_DIR)/ftoption.h
+  FTOPTION_FLAG := $DFT_CONFIG_OPTIONS_H="<ftoption.h>"
+endif
+
+FT_CFLAGS  = $(CPPFLAGS) \
+             $(INCLUDE_FLAGS) \
+             $(CFLAGS) \
+             $DFT2_BUILD_LIBRARY \
+             $DFT_CONFIG_MODULES_H="<ftmodule.h>" \
+             $(FTOPTION_FLAG)
 FT_CC      = $(CC) $(FT_CFLAGS)
 FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS)
 
 
-# Include the `modules' rules file.
-#
-include $(TOP_DIR)/builds/modules.mk
-
-# Includes the 'exports' rules file.
+# Include the `exports' rules file.
 #
 include $(TOP_DIR)/builds/exports.mk
 
+
 # Initialize the list of objects.
 #
 OBJECTS_LIST :=
@@ -166,7 +181,9 @@ PUBLIC_H   := $(wildcard $(PUBLIC_DIR)/*.h)
 BASE_H     := $(wildcard $(INTERNAL_DIR)/*.h) \
               $(wildcard $(SERVICES_DIR)/*.h)
 CONFIG_H   := $(wildcard $(CONFIG_DIR)/*.h) \
-              $(wildcard $(BUILD_DIR)/freetype/config/*.h)
+              $(wildcard $(BUILD_DIR)/freetype/config/*.h) \
+              $(FTMODULE_H) \
+              $(FTOPTION_H)
 CACHE_H    := $(wildcard $(CACHE_DIR)/*.h)
 DEVEL_H    := $(wildcard $(TOP_DIR)/devel/*.h)
 
@@ -176,10 +193,10 @@ FREETYPE_H := $(PUBLIC_H) $(BASE_H) $(CONFIG_H) $(CACHE_H) $(DEVEL_H)
 # ftsystem component
 #
 ifndef FTSYS_SRC
-  FTSYS_SRC = $(BASE_DIR)/ftsystem.c
+  FTSYS_SRC := $(BASE_DIR)/ftsystem.c
 endif
 
-FTSYS_OBJ = $(OBJ_DIR)/ftsystem.$O
+FTSYS_OBJ := $(OBJ_DIR)/ftsystem.$O
 
 OBJECTS_LIST += $(FTSYS_OBJ)
 
@@ -190,10 +207,10 @@ $(FTSYS_OBJ): $(FTSYS_SRC) $(FREETYPE_H)
 # ftdebug component
 #
 ifndef FTDEBUG_SRC
-  FTDEBUG_SRC = $(BASE_DIR)/ftdebug.c
+  FTDEBUG_SRC := $(BASE_DIR)/ftdebug.c
 endif
 
-FTDEBUG_OBJ = $(OBJ_DIR)/ftdebug.$O
+FTDEBUG_OBJ := $(OBJ_DIR)/ftdebug.$O
 
 OBJECTS_LIST += $(FTDEBUG_OBJ)
 
@@ -203,7 +220,8 @@ $(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(FREETYPE_H)
 
 # Include all rule files from FreeType components.
 #
-include $(wildcard $(SRC_DIR)/*/rules.mk)
+include $(SRC_DIR)/base/rules.mk
+include $(patsubst %,$(SRC_DIR)/%/rules.mk,$(MODULES))
 
 
 # ftinit component
@@ -222,17 +240,14 @@ FTINIT_OBJ := $(OBJ_DIR)/ftinit.$O
 
 OBJECTS_LIST += $(FTINIT_OBJ)
 
-$(FTINIT_OBJ): $(FTINIT_SRC) $(FREETYPE_H) $(FT_MODULE_LIST)
+$(FTINIT_OBJ): $(FTINIT_SRC) $(FREETYPE_H)
 	$(FT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
 
 
-# All FreeType library objects
-#
-#   By default, we include the base layer extensions.  These could be
-#   omitted on builds which do not want them.
+# All FreeType library objects.
 #
-OBJ_M = $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M)
-OBJ_S = $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S)
+OBJ_M := $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M)
+OBJ_S := $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S)
 
 
 # The target `multi' on the Make command line indicates that we want to
@@ -298,13 +313,18 @@ distclean_project_dos: clean_project_dos
 	-$(DELETE) $(subst /,\,$(PROJECT_LIBRARY) $(DISTCLEAN) $(NO_OUTPUT))
 
 
-.PHONY: remove_config_mk
+.PHONY: remove_config_mk remove_ftmodule_h
 
 # Remove configuration file (used for distclean).
 #
 remove_config_mk:
 	-$(DELETE) $(subst /,$(SEP),$(CONFIG_MK) $(NO_OUTPUT))
 
+# Remove module list (used for distclean).
+#
+remove_ftmodule_h:
+	-$(DELETE) $(subst /,$(SEP),$(FTMODULE_H) $(NO_OUTPUT))
+
 
 .PHONY: clean distclean
 
@@ -314,7 +334,7 @@ remove_config_mk:
 # implementation.
 #
 clean: clean_project
-distclean: distclean_project remove_config_mk
+distclean: distclean_project remove_config_mk remove_ftmodule_h
 	-$(DELETE) $(subst /,$(SEP),$(DOC_DIR)/*.html $(NO_OUTPUT))
 
 
diff --git a/builds/modules.mk b/builds/modules.mk
index 5102dc0..5f1f9ee 100644
--- a/builds/modules.mk
+++ b/builds/modules.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,
@@ -20,43 +20,45 @@
 # This file is in charge of handling the generation of the modules list
 # file.
 
-.PHONY: make_module_list clean_module_list
 
-# MODULE_LIST, as its name suggests, indicates where the modules list
-# resides.  For now, it is in `include/freetype/config/ftmodule.h'.
+# Build the modules list.
 #
-ifndef MODULE_LIST
-  MODULE_LIST := $(TOP_DIR)/include/$(PROJECT)/config/ftmodule.h
-endif
-
-# To build the modules list, we invoke the `make_module_list' target.
-#
-# This rule is commented out by default since FreeType comes already with
-# an ftmodule.h file.
-#
-#$(MODULE_LIST): make_module_list
-
+$(FTMODULE_H): $(MODULES_CFG)
+	$(FTMODULE_H_INIT)
+	$(FTMODULE_H_CREATE)
+	$(FTMODULE_H_DONE)
 
 ifneq ($(findstring $(PLATFORM),dos win32 win16 os2),)
   OPEN_MODULE   := @echo$(space)
-  CLOSE_MODULE  :=  >> $(subst /,\,$(MODULE_LIST))
-  REMOVE_MODULE := @-$(DELETE) $(subst /,\,$(MODULE_LIST))
+  CLOSE_MODULE  :=  >> $(subst /,\,$(FTMODULE_H))
+  REMOVE_MODULE := @-$(DELETE) $(subst /,\,$(FTMODULE_H))
 else
   OPEN_MODULE   := @echo "
-  CLOSE_MODULE  := " >> $(MODULE_LIST)
-  REMOVE_MODULE := @-$(DELETE) $(MODULE_LIST)
+  CLOSE_MODULE  := " >> $(FTMODULE_H)
+  REMOVE_MODULE := @-$(DELETE) $(FTMODULE_H)
 endif
 
 
-# Before the modules list file can be generated, we must remove the file in
-# order to `clean' the list.
+define FTMODULE_H_INIT
+$(REMOVE_MODULE)
+@-echo Generating modules list in $(FTMODULE_H)...
+$(OPEN_MODULE)/* This is a generated file. */$(CLOSE_MODULE)
+endef
+
+# It is no mistake that the final closing parenthesis is on the
+# next line -- it produces proper newlines during the expansion
+# of `foreach'.
 #
-clean_module_list:
-	$(REMOVE_MODULE)
-	@-echo Regenerating modules list in $(MODULE_LIST)...
+define FTMODULE_H_CREATE
+$(foreach COMMAND,$(FTMODULE_H_COMMANDS),$($(COMMAND))
+)
+endef
+
+define FTMODULE_H_DONE
+$(OPEN_MODULE)/* EOF */$(CLOSE_MODULE)
+@echo done.
+endef
 
-make_module_list: clean_module_list
-	@echo done.
 
 # $(OPEN_DRIVER) & $(CLOSE_DRIVER) are used to specify a given font driver
 # in the `module.mk' rules file.
@@ -68,10 +70,10 @@ ECHO_DRIVER      := @echo "* module:$(space)
 ECHO_DRIVER_DESC := (
 ECHO_DRIVER_DONE := )"
 
-# Each `module.mk' in the `src' sub-dirs is used to add one rule to the
-# target `make_module_list'.
+# Each `module.mk' in the `src/*' subdirectories adds a variable with
+# commands to $(FTMODULE_H_COMMANDS).  Note that we can't use SRC_DIR here.
 #
-include $(wildcard $(TOP_DIR)/src/*/module.mk)
+-include $(patsubst %,$(TOP_DIR)/src/%/module.mk,$(MODULES))
 
 
 # EOF
diff --git a/builds/os2/os2-def.mk b/builds/os2/os2-def.mk
index 0e563ac..6ca739e 100644
--- a/builds/os2/os2-def.mk
+++ b/builds/os2/os2-def.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,
@@ -22,20 +22,6 @@ PLATFORM  := os2
 #
 E := .exe
 
-# The directory where all object files are placed.
-#
-# This lets you build the library in your own directory with something like
-#
-#   set TOP_DIR=.../path/to/freetype2/top/dir...
-#   set OBJ_DIR=.../path/to/obj/dir
-#   make -f %TOP_DIR%/Makefile setup [options]
-#   make -f %TOP_DIR%/Makefile
-#
-ifndef OBJ_DIR
-  OBJ_DIR := $(TOP_DIR)/objs
-endif
-
-
 # The directory where all library files are placed.
 #
 # By default, this is the same as $(OBJ_DIR); however, this can be changed
diff --git a/builds/os2/os2-dev.mk b/builds/os2/os2-dev.mk
index 96890fa..bd12215 100644
--- a/builds/os2/os2-dev.mk
+++ b/builds/os2/os2-dev.mk
@@ -5,7 +5,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,
@@ -19,9 +19,12 @@ ifndef TOP_DIR
   TOP_DIR := .
 endif
 
+DEVEL_DIR := $(TOP_DIR)/devel
+
+# include OS/2-specific definitions
 include $(TOP_DIR)/builds/os2/os2-def.mk
-BUILD_DIR := $(TOP_DIR)/devel
 
+# include gcc-specific definitions
 include $(TOP_DIR)/builds/compiler/gcc-dev.mk
 
 # include linking instructions
diff --git a/builds/toplevel.mk b/builds/toplevel.mk
index 6ee3818..4a6c9fc 100644
--- a/builds/toplevel.mk
+++ b/builds/toplevel.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2001, 2003 by
+# Copyright 1996-2000, 2001, 2003, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -36,6 +36,7 @@
 
 .PHONY: all setup distclean modules
 
+
 # The `space' variable is used to avoid trailing spaces in defining the
 # `T' variable later.
 #
@@ -43,6 +44,36 @@ empty :=
 space := $(empty) $(empty)
 
 
+# The main configuration file, defining the `XXX_MODULES' variables.  We
+# prefer a `modules.cfg' file in OBJ_DIR over TOP_DIR.
+#
+ifndef MODULES_CFG
+  MODULES_CFG := $(TOP_DIR)/modules.cfg
+  ifneq ($(wildcard $(OBJ_DIR)/modules.cfg),)
+    MODULES_CFG := $(OBJ_DIR)/modules.cfg
+  endif
+endif
+
+
+# FTMODULE_H, as its name suggests, indicates where the FreeType module
+# classes resides.
+#
+ifndef FTMODULE_H
+  FTMODULE_H := $(OBJ_DIR)/ftmodule.h
+endif
+
+
+include $(MODULES_CFG)
+
+
+# The list of modules we are using.
+#
+MODULES := $(FONT_MODULES)    \
+           $(HINTING_MODULES) \
+           $(RASTER_MODULES)  \
+           $(AUX_MODULES)
+
+
 ifndef CONFIG_MK
   CONFIG_MK := config.mk
 endif
@@ -71,33 +102,17 @@ endif
 #
 ifdef check_platform
 
-  # This is the first rule `make' sees.
-  #
-  all: setup
-
-  ifdef USE_MODULES
-    # If the module list $(MODULE_LIST) file is not present, generate it.
-    #
-    #modules: make_module_list setup
-  endif
+  all modules: setup
 
   include $(TOP_DIR)/builds/detect.mk
 
-  ifdef USE_MODULES
-    include $(TOP_DIR)/builds/modules.mk
-
-    ifeq ($(wildcard $(MODULE_LIST)),)
-      setup: make_module_list
-    endif
-  endif
-
   # This rule makes sense for Unix only to remove files created by a run
   # of the configure script which hasn't been successful (so that no
   # `config.mk' has been created).  It uses the built-in $(RM) command of
   # GNU make.  Similarly, `nul' is created if e.g. `make setup win32' has
   # been erroneously used.
   #
-  # note: This test is duplicated in "builds/toplevel.mk".
+  # Note: This test is duplicated in `builds/unix/detect.mk'.
   #
   is_unix := $(strip $(wildcard /sbin/init) \
                      $(wildcard /usr/sbin/init) \
@@ -126,14 +141,25 @@ else
   #
   all: single
 
-  ifdef USE_MODULES
-    modules: make_module_list
-  endif
-
   BUILD_PROJECT := yes
   include $(CONFIG_MK)
 
 endif # test check_platform
 
 
+# We always need the list of modules in ftmodule.h.
+#
+all setup: $(FTMODULE_H)
+
+
+# The `modules' target unconditionally rebuilds the module list.
+#
+modules:
+	$(FTMODULE_H_INIT)
+	$(FTMODULE_H_CREATE)
+	$(FTMODULE_H_DONE)
+
+include $(TOP_DIR)/builds/modules.mk
+
+
 # EOF
diff --git a/builds/unix/detect.mk b/builds/unix/detect.mk
index a0419dc..aafe352 100644
--- a/builds/unix/detect.mk
+++ b/builds/unix/detect.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2003, 2004 by
+# Copyright 1996-2000, 2002, 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,
@@ -66,22 +66,22 @@ ifeq ($(PLATFORM),unix)
       # platform).
       #
       CONFIG_FILE := unix.mk
-      setup: $(BUILD_DIR)/unix-def.mk
       unix: setup
+      must_configure := 1
       .PHONY: unix
     endif
   endif
 
-  setup: std_setup
+  have_Makefile := $(wildcard $(OBJ_DIR)/Makefile)
 
-  have_mk := $(strip $(wildcard $(OBJ_DIR)/Makefile))
-  ifneq ($(have_mk),)
-    # we are building FT2 not in the src tree
-    $(BUILD_DIR)/unix-def.mk: $(TOP_DIR)/builds/unix/unix-def.in
-	    $(TOP_DIR)/builds/unix/configure $(CFG)
-  else
-    $(BUILD_DIR)/unix-def.mk: $(TOP_DIR)/builds/unix/unix-def.in
-	    cd builds/unix; ./configure $(CFG)
+      setup: std_setup
+  ifdef must_configure
+    ifneq ($(have_Makefile),)
+      # we are building FT2 not in the src tree
+	      $(TOP_DIR)/builds/unix/configure $(CFG)
+    else
+	      cd builds/unix; ./configure $(CFG)
+    endif
   endif
 
 endif   # test PLATFORM unix
diff --git a/builds/unix/install.mk b/builds/unix/install.mk
index 54cfd74..668a806 100644
--- a/builds/unix/install.mk
+++ b/builds/unix/install.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2003 by
+# Copyright 1996-2000, 2002, 2003, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -24,17 +24,17 @@
 
 # Unix installation and deinstallation targets.
 #
-# note that we don't install internal headers since 2.2.0, and
-# we remove any 'internal' directory found in $(includedir)/freetype2/freetype
+# Note that we no longer install internal headers, and we remove any
+# `internal' subdirectory found in `$(includedir)/freetype2/freetype'.
 #
 install: $(PROJECT_LIBRARY)
-	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)                                 \
-                         $(DESTDIR)$(libdir)/pkgconfig                       \
-                         $(DESTDIR)$(includedir)/freetype2/freetype/config   \
-                         $(DESTDIR)$(includedir)/freetype2/freetype/cache    \
-                         $(DESTDIR)$(bindir)                                 \
+	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)                               \
+                         $(DESTDIR)$(libdir)/pkgconfig                     \
+                         $(DESTDIR)$(includedir)/freetype2/freetype/config \
+                         $(DESTDIR)$(includedir)/freetype2/freetype/cache  \
+                         $(DESTDIR)$(bindir)                               \
                          $(DESTDIR)$(datadir)/aclocal
-	$(LIBTOOL) --mode=install $(INSTALL) \
+	$(LIBTOOL) --mode=install $(INSTALL)                             \
                                   $(PROJECT_LIBRARY) $(DESTDIR)$(libdir)
 	-for P in $(PUBLIC_H) ; do                           \
           $(INSTALL_DATA)                                    \
@@ -52,8 +52,10 @@ install: $(PROJECT_LIBRARY)
 	-$(DELDIR) $(DESTDIR)$(includedir)/freetype2/freetype/internal
 	$(INSTALL_DATA) $(BUILD_DIR)/ft2unix.h \
           $(DESTDIR)$(includedir)/ft2build.h
-	$(INSTALL_DATA) $(OBJ_BUILD)/ftconfig.h \
+	$(INSTALL_DATA) $(OBJ_BUILD)/ftconfig.h                        \
           $(DESTDIR)$(includedir)/freetype2/freetype/config/ftconfig.h
+	$(INSTALL_DATA) $(OBJ_BUILD)/ftmodule.h                        \
+          $(DESTDIR)$(includedir)/freetype2/freetype/config/ftmodule.h
 	$(INSTALL_SCRIPT) -m 755 $(OBJ_BUILD)/freetype-config \
           $(DESTDIR)$(bindir)/freetype-config
 	$(INSTALL_SCRIPT) -m 644 $(BUILD_DIR)/freetype2.m4 \
diff --git a/builds/unix/unix-def.in b/builds/unix/unix-def.in
index c263e0e..801bdaa 100644
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2004 by
+# Copyright 1996-2000, 2002, 2004, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -13,9 +13,6 @@
 # fully.
 
 
-ifndef TOP_DIR
-  TOP_DIR := .
-endif
 TOP_DIR := $(shell cd $(TOP_DIR); pwd)
 
 DELETE    := @RMF@
@@ -61,20 +58,6 @@ datadir      := @datadir@
 version_info := @version_info@
 
 
-# The directory where all object files are placed.
-#
-# This lets you build the library in your own directory with something like
-#
-#   set TOP_DIR=.../path/to/freetype2/top/dir...
-#   set OBJ_DIR=.../path/to/obj/dir
-#   make -f $TOP_DIR/Makefile setup [options]
-#   make -f $TOP_DIR/Makefile
-#
-ifndef OBJ_DIR
-  OBJ_DIR := $(shell cd $(TOP_DIR)/objs; pwd)
-endif
-
-
 # The directory where all library files are placed.
 #
 # By default, this is the same as $(OBJ_DIR); however, this can be changed
diff --git a/builds/unix/unix-dev.mk b/builds/unix/unix-dev.mk
index 12c641a..76bae38 100644
--- a/builds/unix/unix-dev.mk
+++ b/builds/unix/unix-dev.mk
@@ -6,7 +6,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,
@@ -16,9 +16,9 @@
 # fully.
 
 
-include $(TOP_DIR)/builds/unix/unixddef.mk
-BUILD_DIR := $(TOP_DIR)/devel
+DEVEL_DIR := $(TOP_DIR)/devel
 
+include $(TOP_DIR)/builds/unix/unixddef.mk
 include $(TOP_DIR)/builds/compiler/gcc-dev.mk
 include $(TOP_DIR)/builds/link_std.mk
 
diff --git a/builds/unix/unix.mk b/builds/unix/unix.mk
index c1555ac..7f9d9a3 100644
--- a/builds/unix/unix.mk
+++ b/builds/unix/unix.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2004 by
+# Copyright 1996-2000, 2002, 2004, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -16,14 +16,14 @@
 BUILD_DIR := $(TOP_DIR)/builds/unix
 PLATFORM  := unix
 
-have_mk := $(strip $(wildcard $(BUILD_DIR)/unix-def.mk))
+have_mk := $(wildcard $(OBJ_DIR)/unix-def.mk)
 ifneq ($(have_mk),)
-  include $(BUILD_DIR)/unix-def.mk
-  include $(BUILD_DIR)/unix-cc.mk
-else
-  # we are building FT2 not in the src tree
+  # We are building FreeType 2 not in the src tree.
   include $(OBJ_DIR)/unix-def.mk
   include $(OBJ_DIR)/unix-cc.mk
+else
+  include $(BUILD_DIR)/unix-def.mk
+  include $(BUILD_DIR)/unix-cc.mk
 endif
 
 ifdef BUILD_PROJECT
@@ -48,14 +48,15 @@ ifdef BUILD_PROJECT
   #
   #   librarian library_file {list of object files}
   #
-  $(PROJECT_LIBRARY): $(OBJECTS_LIST)
-ifdef CLEAN_LIBRARY
-	  -$(CLEAN_LIBRARY) $(NO_OUTPUT)
-endif
-	  $(LINK_LIBRARY)
+    $(PROJECT_LIBRARY): $(OBJECTS_LIST)
+  ifdef CLEAN_LIBRARY
+	    -$(CLEAN_LIBRARY) $(NO_OUTPUT)
+  endif
+	    $(LINK_LIBRARY)
+
+  include $(TOP_DIR)/builds/unix/install.mk
 
 endif
 
-include $(TOP_DIR)/builds/unix/install.mk
 
 # EOF
diff --git a/builds/unix/unixddef.mk b/builds/unix/unixddef.mk
index 947673e..e26d61e 100644
--- a/builds/unix/unixddef.mk
+++ b/builds/unix/unixddef.mk
@@ -4,7 +4,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,
@@ -23,11 +23,7 @@ DELETE := rm -f
 SEP    := /
 
 # we use a special devel ftoption.h
-BUILD_DIR := $(TOP_DIR)/devel
-
-# do not set the platform to `unix', or libtool will trick you
-PLATFORM := unixdev
-
+DEVEL_DIR := $(TOP_DIR)/devel
 
 # The directory where all object files are placed.
 #
diff --git a/builds/win32/w32-bccd.mk b/builds/win32/w32-bccd.mk
index 2951999..51b15d9 100644
--- a/builds/win32/w32-bccd.mk
+++ b/builds/win32/w32-bccd.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,
@@ -13,8 +13,9 @@
 # fully.
 
 
+DEVEL_DIR := $(TOP_DIR)/devel
+
 include $(TOP_DIR)/builds/win32/win32-def.mk
-BUILD_DIR := $(TOP_DIR)/devel
 
 include $(TOP_DIR)/builds/compiler/bcc-dev.mk
 
diff --git a/builds/win32/w32-dev.mk b/builds/win32/w32-dev.mk
index 0b665de..bf3fe3a 100644
--- a/builds/win32/w32-dev.mk
+++ b/builds/win32/w32-dev.mk
@@ -5,7 +5,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,
@@ -23,8 +23,9 @@ ifndef TOP_DIR
   TOP_DIR := .
 endif
 
+DEVEL_DIR := $(TOP_DIR)/devel
+
 include $(TOP_DIR)/builds/win32/win32-def.mk
-BUILD_DIR := $(TOP_DIR)/devel
 
 include $(TOP_DIR)/builds/compiler/gcc-dev.mk
 
diff --git a/builds/win32/win32-def.mk b/builds/win32/win32-def.mk
index e402e74..87dc12a 100644
--- a/builds/win32/win32-def.mk
+++ b/builds/win32/win32-def.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,
@@ -22,19 +22,6 @@ PLATFORM  := win32
 #
 E := .exe
 
-# The directory where all object files are placed.
-#
-# This lets you build the library in your own directory with something like
-#
-#   set TOP_DIR=.../path/to/freetype2/top/dir...
-#   set OBJ_DIR=.../path/to/obj/dir
-#   make -f %TOP_DIR%/Makefile setup [options]
-#   make -f %TOP_DIR%/Makefile
-#
-ifndef OBJ_DIR
-  OBJ_DIR := $(TOP_DIR)/objs
-endif
-
 
 # The directory where all library files are placed.
 #
diff --git a/configure b/configure
index 3f9c7b3..4921a30 100644
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright 2002, 2003, 2004, 2005 by
+# Copyright 2002, 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,
@@ -30,7 +30,8 @@ if test -z "`$GNUMAKE -v 2>/dev/null | grep GNU`"; then
   fi
 fi
 
-# Uh, oh.  This is taken from autoconf.  They know what they are doing...
+# Get `dirname' functionality.  This is taken and adapted from autoconf's
+# m4sh.m4 (_AS_EXPR_PREPARE, AS_DIRNAME_EXPR, and AS_DIRNAME_SED).
 
 if expr a : '\(a\)' >/dev/null 2>&1; then
   ft_expr=expr
@@ -38,18 +39,30 @@ else
   ft_expr=false
 fi
 
-ft2_dir=`(dirname "$0") 2>/dev/null ||
-$ft_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$0" : 'X\(//\)[^/]' \| \
-         X"$0" : 'X\(//\)$' \| \
-         X"$0" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
+ft2_dir=`(dirname "$0") 2>/dev/null                         ||
+         $ft_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+                  X"$0" : 'X\(//\)[^/]' \| \
+                  X"$0" : 'X\(//\)$' \| \
+                  X"$0" : 'X\(/\)' \| \
+                  .     : '\(.\)' 2>/dev/null               ||
+         echo X"$0" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'`
 
 abs_curr_dir=`pwd`
 abs_ft2_dir=`cd "$ft2_dir" && pwd`
@@ -58,6 +71,9 @@ abs_ft2_dir=`cd "$ft2_dir" && pwd`
 
 if test "$abs_curr_dir" != "$abs_ft2_dir"; then
   mkdir reference
+  echo "Copying \`modules.cfg'"
+  cp $abs_ft2_dir/modules.cfg $abs_curr_dir
+  echo "Generating \`Makefile'"
   echo "TOP_DIR   := $abs_ft2_dir"               > Makefile
   echo "OBJ_DIR   := $abs_curr_dir"             >> Makefile
   echo "OBJ_BUILD := \$(OBJ_DIR)"               >> Makefile
diff --git a/docs/CHANGES b/docs/CHANGES
index fb55d89..4b35f44 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -15,6 +15,14 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
 
   II. IMPORTANT CHANGES
 
+    - FreeType's build  mechanism has been redesigned.   With GNU make
+      it  is  now  sufficient  in   most  cases  to  edit  two  files:
+      `modules.cfg',  to  select   the  library  components,  and  the
+      configuration  file  `include/freetype/config/ftoption.h' (which
+      can be copied to the objects directory).  Removing unused module
+      directories   to    prevent   its   compilation    and   editing
+      `include/freetype/config/ftmodule.h' is no longer necessary.
+
     - The  LIGHT  hinting algorithm  produces  more pleasant  results.
       Also, using the  FT_LOAD_TARGET_LIGHT flags within FT_Load_Glyph
       always forces auto-hinting, as a special exception.
diff --git a/docs/CUSTOMIZE b/docs/CUSTOMIZE
index e1b3c06..0fe3f47 100644
--- a/docs/CUSTOMIZE
+++ b/docs/CUSTOMIZE
@@ -1,56 +1,55 @@
 How to customize the compilation of the library
 ===============================================
 
-  FreeType  is  highly  customizable  to  fit various  needs,  and  this
-  document describes how it is possible to select options and components
-  at compilation time.
+  FreeType  is highly  customizable  to fit  various  needs, and  this
+  document  describes  how  it  is  possible  to  select  options  and
+  components at compilation time.
 
 
 I. Configuration macros
 
-  The file found in `include/freetype/config/ftoption.h' contains a list
-  of commented configuration macros that can be toggled by developers to
-  indicate which features should be active while building the library.
+  The  file found  in `include/freetype/config/ftoption.h'  contains a
+  list  of  commented configuration  macros  that  can  be toggled  by
+  developers  to  indicate  which  features  should  be  active  while
+  building the library.
   
-  These  options  range from  debug  level  to  availability of  certain
-  features, like native TrueType hinting through a bytecode interpreter.
+  These  options range  from debug  level to  availability  of certain
+  features,   like  native   TrueType  hinting   through   a  bytecode
+  interpreter.
   
-  We invite you to read this  file for more information.  You can change
-  the file's content to suit your  needs, or override it with one of the
-  techniques described below.
+  We  invite you  to read  this file  for more  information.   You can
+  change the  file's content to suit  your needs, or  override it with
+  one of the techniques described below.
 
   
 II. Modules list
 
-  The file found in `include/freetype/config/ftmodule.h' contains a list
-  of  names  corresponding  to  the  modules  and  font  drivers  to  be
-  statically compiled in the FreeType library during the build.
+  If you  use GNU make  please edit the top-level  file `modules.cfg'.
+  It contains a  list of available FreeType modules  and extensions to
+  be compiled.  Change it to suit your own preferences.  Be aware that
+  certain modules  depend on  others, as described  in the  file.  GNU
+  make  uses `modules.cfg'  to  generate `ftmodule.h'  (in the  object
+  directory).
 
-  You can change it to suit your own preferences.  Be aware that certain
-  modules depend  on others, as  described by the file  `modules.txt' in
-  this directory.
-
-  You can modify  the file's content to suit your  needs, or override it
-  at compile time with one of the methods described below.
-
-  Note that  you also  have to  rename the various  `*.mk' files  in the
-  module directories  which you  want to exclude  so that  the extension
-  isn't `.mk'  -- GNU make uses  a simple globbing  mechanism to include
-  all those files.
+  If  you don't  use  GNU make  you  have to  manually  edit the  file
+  `include/freetype/config/ftmodule.h'  (which is  *not* used  with if
+  compiled with GNU make) to  add or remove the drivers and components
+  you want  to compile into  the library.  See `INSTALL.ANY'  for more
+  information.
 
 
 III. System interface
 
-  FreeType's default interface to the  system (i.e., the parts that deal
-  with   memory   management   and    i/o   streams)   is   located   in
+  FreeType's  default interface to  the system  (i.e., the  parts that
+  deal  with  memory  management   and  i/o  streams)  is  located  in
   `src/base/ftsystem.c'.
   
-  The  current implementation uses  standard C  library calls  to manage
-  memory and to read font files.  It is however possible to write custom
-  implementations to suit specific systems.
+  The current  implementation uses standard C library  calls to manage
+  memory  and to read  font files.   It is  however possible  to write
+  custom implementations to suit specific systems.
 
-  To  tell  the GNU  Make-based  build system  to  use  a custom  system
-  interface, you  have to define  the environment variable  FTSYS_SRC to
+  To  tell the  GNU Make-based  build system  to use  a  custom system
+  interface, you have to  define the environment variable FTSYS_SRC to
   point to the relevant implementation:
   
     on Unix:
@@ -69,21 +68,31 @@ III. System interface
      
 IV. Overriding default configuration and module headers
 
-  It  is  possible to  override  the  default  configuration and  module
-  headers without changing the original files.  There are two ways to do
-  that:
+  It  is possible  to override  the default  configuration  and module
+  headers without  changing the original files.  There  are three ways
+  to do that:
+
+
+  1. With GNU make
+
+    [This is actually a combination of method 2 and 3.]
+
+    Just put your custom  `ftoption.h' file into the objects directory
+    (normally  `<topdir>/objs'),  which  GNU  make  prefers  over  the
+    standard location.   No action is needed  for `ftmodule.h' because
+    it is generated automatically in the objects directory.
 
 
-  1. Using the C include path
+  2. Using the C include path
   
-    Use the C include path to ensure that your own versions of the files
-    are used at compile time when the lines
+    Use the  C include path  to ensure that  your own versions  of the
+    files are used at compile time when the lines
     
       #include FT_CONFIG_OPTIONS_H
       #include FT_CONFIG_MODULES_H
 
-    are       compiled.       Their      default       values      being
-    <freetype/config/ftoption.h>  and  <freetype/config/ftmodule.h>, you
+    are      compiled.       Their      default      values      being
+    <freetype/config/ftoption.h> and <freetype/config/ftmodule.h>, you
     can do something like:
 
       custom/
@@ -96,14 +105,14 @@ IV. Overriding default configuration and module headers
         freetype/
           ...
 
-    then change the  C include path to always give  the path to `custom'
+    then change the C include path to always give the path to `custom'
     before the FreeType 2 `include'.
 
 
-  2. Redefining FT_CONFIG_OPTIONS_H and FT_CONFIG_MODULES_H
+  3. Redefining FT_CONFIG_OPTIONS_H and FT_CONFIG_MODULES_H
   
-    Another way to  do the same thing is to redefine  the macros used to
-    name  the  configuration headers.   To  do  so,  you need  a  custom
+    Another way to do the same thing is to redefine the macros used to
+    name  the configuration  headers.  To  do  so, you  need a  custom
     `ft2build.h' whose content can be as simple as:
    
       #ifndef __FT2_BUILD_MY_PLATFORM_H__
@@ -123,19 +132,19 @@ IV. Overriding default configuration and module headers
         my-ftoption.h        => custom options header
         my-ftmodule.h        => custom modules list header
 
-    and  change the C  include path  to ensure  that `custom'  is always
+    and change  the C include path  to ensure that  `custom' is always
     placed before the FT2 `include' during compilation.
 
-------------------------------------------------------------------------
+----------------------------------------------------------------------
 
-Copyright 2003, 2005 by
+Copyright 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,  and  distributed under  the  terms  of  the FreeType  project
-license, LICENSE.TXT.  By continuing  to use, modify, or distribute this
-file  you indicate that  you have  read the  license and  understand and
-accept it fully.
+This  file is  part of  the FreeType  project, and  may only  be used,
+modified,  and distributed  under the  terms of  the  FreeType project
+license,  LICENSE.TXT.  By  continuing to  use, modify,  or distribute
+this file you  indicate that you have read  the license and understand
+and accept it fully.
 
 
 --- end of CUSTOMIZE ---
diff --git a/docs/INSTALL b/docs/INSTALL
index d53cafa..98ca4c4 100644
--- a/docs/INSTALL
+++ b/docs/INSTALL
@@ -1,6 +1,6 @@
 
-There are several ways to  build the FreeType library, depending on your
-system  and  the level  of  customization you  need.   Here  is a  short
+There are  several ways  to build the  FreeType library,  depending on
+your system and the level of  customization you need.  Here is a short
 overview of the documentation available:
 
 
@@ -9,15 +9,16 @@ I. Normal installation and upgrades
 
   1. Native TrueType Hinting
 
-    Native TrueType  hinting is disabled  by default[1].  If  you really
+    Native TrueType hinting is  disabled by default[1].  If you really
     need it, read the file `TRUETYPE' for information.
 
 
   2. Unix Systems (as well as Cygwin or MSys on Windows)
 
-    Please  read *both*  `UPGRADE.UNX' and  `INSTALL.UNX' to  install or
-    upgrade FreeType 2 on a Unix system.  Note that you *need* GNU Make,
-    since other make tools won't work (this includes BSD Make).
+    Please read  *both* `UPGRADE.UNX' and `INSTALL.UNX'  to install or
+    upgrade FreeType  2 on  a Unix system.   Note that you  *need* GNU
+    Make for automatic compilation,  since other make tools won't work
+    (this includes BSD Make).
 
 
   3. On VMS with the `mms' build tool
@@ -27,61 +28,62 @@ I. Normal installation and upgrades
 
   4. Other systems using GNU Make
   
-    On non-Unix platforms, it is possible to build the library using GNU
-    Make utility.   Note that *NO  OTHER MAKE TOOL WILL  WORK*[2]!  This
-    methods  supports  several compilers  on  Windows,  OS/2, and  BeOS,
-    including MinGW, Visual C++, Borland C++, and more.
+    On non-Unix platforms,  it is possible to build  the library using
+    GNU Make  utility.  Note that  *NO OTHER MAKE TOOL  WILL WORK*[2]!
+    This  methods supports  several  compilers on  Windows, OS/2,  and
+    BeOS, including MinGW, Visual C++, Borland C++, and more.
 
     Instructions are provided in the file `INSTALL.GNU'.
 
 
   5. With an IDE Project File (e.g., for Visual Studio or CodeWarrior)
   
-    We provide  a small  number of `project  files' for various  IDEs to
-    automatically build the library as  well.  Note that these files are
-    not   supported  and  only   sporadically  maintained   by  FreeType
+    We provide a  small number of `project files'  for various IDEs to
+    automatically build  the library as  well.  Note that  these files
+    are  not supported  and only  sporadically maintained  by FreeType
     developers, so don't expect them to work in each release.
     
-    To find  them, have a look  at the content  of the `builds/<system>'
+    To find them, have a  look at the content of the `builds/<system>'
     directory, where <system> stands for your OS or environment.
 
 
   6. From you own IDE, or own Makefiles
   
-    If you want to create your own project file, follow the instructions
-    given in the `INSTALL.ANY' document of this directory.
+    If  you  want  to  create   your  own  project  file,  follow  the
+    instructions   given  in  the   `INSTALL.ANY'  document   of  this
+    directory.
 
 
 II. Custom builds of the library
 ================================
 
-  Customizing the  compilation of  FreeType is easy,  and allows  you to
-  select only  the components of the  font engine that  you really need.
+  Customizing the compilation  of FreeType is easy, and  allows you to
+  select only the components of  the font engine that you really need.
   For more details read the file `CUSTOMIZE'.
 
 
-------------------------------------------------------------------------
+----------------------------------------------------------------------
 
 [1] More details on:  http://www.freetype.org/patents.html
 
-[2] make++, a  make tool written in Perl, has  sufficient support of GNU
+[2] make++, a make tool written in Perl, has sufficient support of GNU
     make extensions to build FreeType.  See
 
       http://makepp.sourceforge.net
 
-    for more information;  you need version 1.19 or  newer, and you must
+    for more information; you need version 1.19 or newer, and you must
     pass option `--norc-substitution'.
 
-------------------------------------------------------------------------
+----------------------------------------------------------------------
 
-Copyright 2000, 2001, 2002, 2003, 2004, 2005 by
+Copyright 2000, 2001, 2002, 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,  and  distributed under  the  terms  of  the FreeType  project
-license, LICENSE.TXT.  By continuing  to use, modify, or distribute this
-file  you indicate that  you have  read the  license and  understand and
-accept it fully.
+This  file is  part of  the FreeType  project, and  may only  be used,
+modified,  and distributed  under the  terms of  the  FreeType project
+license,  LICENSE.TXT.  By  continuing to  use, modify,  or distribute
+this file you  indicate that you have read  the license and understand
+and accept it fully.
 
 
 --- end of INSTALL ---
diff --git a/docs/INSTALL.ANY b/docs/INSTALL.ANY
index 09d0d10..fd882cd 100644
--- a/docs/INSTALL.ANY
+++ b/docs/INSTALL.ANY
@@ -1,29 +1,29 @@
 Instructions on how to build FreeType with your own build tool
 ==============================================================
 
-See the file `CUSTOMIZE' to  learn how to customize FreeType to specific
-environments.
+See  the  file `CUSTOMIZE'  to  learn  how  to customize  FreeType  to
+specific environments.
 
 
 I. Standard procedure
 ---------------------
 
-  * DISABLE  PRE-COMPILED HEADERS!   This is  very important  for Visual
+  * DISABLE PRE-COMPILED  HEADERS!  This is very  important for Visual
     C++, because FreeType uses lines like:
     
       #include FT_FREETYPE_H
     
-    which are not correctly supported by this compiler while being ISO C
-    compliant!
+    which are not correctly supported by this compiler while being ISO
+    C compliant!
 
-  * You need to add  the directories `freetype2/include' to your include
-    path when compiling the library.
+  * You  need  to  add  the directories  `freetype2/include'  to  your
+    include path when compiling the library.
 
-  * FreeType 2 is made of several components; each of them is located in
-    a     subdirectory     of     `freetype2/src'.      For     example,
+  * FreeType 2 is made of  several components; each of them is located
+    in    a   subdirectory    of   `freetype2/src'.     For   example,
     `freetype2/src/truetype/' contains the TrueType font driver.
 
-  * DO NOT COMPILE ALL C FILES!  Rather, compile the following ones:
+  * DO NOT COMPILE ALL C FILES!  Rather, compile the following ones.
 
     -- base components (required)
 
@@ -63,7 +63,8 @@ I. Standard procedure
       src/type42/type42.c     -- Type 42 font driver
       src/winfonts/winfnt.c   -- Windows FONT / FNT font driver
 
-    -- rasterizers (optional; at least one is needed for vector formats)
+    -- rasterizers (optional; at least one is needed for
+       vector formats)
 
       src/raster/raster.c     -- monochrome rasterizer
       src/smooth/smooth.c     -- anti-aliasing rasterizer
@@ -90,17 +91,19 @@ I. Standard procedure
       `type42.c'   needs `truetype.c'
 
 
-  Read the file `CUSTOMIZE' in case you want to compile only a subset of
-  the drivers, renderers, and optional modules.
+  Read the file `CUSTOMIZE' in case  you want to compile only a subset
+  of  the  drivers,  renderers,   and  optional  modules;  a  detailed
+  description of the various base  extension is given in the top-level
+  file `modules.cfg'.
 
-  You are done.   In case of problems, see the  archives of the FreeType
+  You are done.  In case of problems, see the archives of the FreeType
   development mailing list.
 
 
 II. Support for flat-directory compilation
 ------------------------------------------
 
-  It  is possible  to put  all  FreeType 2  source files  into a  single
+  It is  possible to  put all  FreeType 2 source  files into  a single
   directory, with the *exception* of the `include' hierarchy.
 
   1. Copy all files in current directory
@@ -118,19 +121,19 @@ II. Support for flat-directory compilation
       cc -c -Ifreetype2/include ftbase.c
       etc.
 
-    You don't need to define  the FT_FLAT_COMPILATION macro (as this was
-    required in previous releases of FreeType 2).
+    You don't  need to define  the FT_FLAT_COMPILATION macro  (as this
+    was required in previous releases of FreeType 2).
 
-------------------------------------------------------------------------
+----------------------------------------------------------------------
 
 Copyright 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,  and  distributed under  the  terms  of  the FreeType  project
-license, LICENSE.TXT.  By continuing  to use, modify, or distribute this
-file  you indicate that  you have  read the  license and  understand and
-accept it fully.
+This  file is  part of  the FreeType  project, and  may only  be used,
+modified,  and distributed  under the  terms of  the  FreeType project
+license,  LICENSE.TXT.  By  continuing to  use, modify,  or distribute
+this file you  indicate that you have read  the license and understand
+and accept it fully.
 
 
 --- end of INSTALL.ANY ---
diff --git a/docs/INSTALL.GNU b/docs/INSTALL.GNU
index 096b4b5..3859eee 100644
--- a/docs/INSTALL.GNU
+++ b/docs/INSTALL.GNU
@@ -1,34 +1,34 @@
-This document contains instructions how to build the FreeType library on
-non-Unix  systems with  the help  of  GNU Make.   Note that  if you  are
-running Cygwin or MSys in Windows, you should follow the instructions in
-the file INSTALL.UNX instead.
+This document contains instructions  how to build the FreeType library
+on non-Unix systems  with the help of GNU Make.  Note  that if you are
+running Cygwin or MSys in  Windows, you should follow the instructions
+in the file INSTALL.UNX instead.
 
 
-  FreeType 2 includes  a powerful and flexible build  system that allows
-  you to  easily compile  it on  a great variety  of platforms  from the
-  command line.  To do so, just follow these simple instructions:
+  FreeType 2 includes a powerful and flexible build system that allows
+  you to  easily compile it on  a great variety of  platforms from the
+  command line.  To do so, just follow these simple instructions.
 
   1. Install GNU Make
   -------------------
 
-    Because GNU Make is the only Make tool supported to compile FreeType
-    2, you should install it on your machine.
+    Because  GNU Make  is  the  only Make  tool  supported to  compile
+    FreeType 2, you should install it on your machine.
 
-    The FreeType 2  build system relies on many  features special to GNU
+    The FreeType 2 build system relies on many features special to GNU
     Make.
 
-    NEARLY ALL  OTHER MAKE TOOLS  FAIL, INCLUDING `BSD MAKE',  SO REALLY
+    NEARLY ALL OTHER MAKE TOOLS  FAIL, INCLUDING `BSD MAKE', SO REALLY
     INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM!
 
-    Note  that make++,  a make  tool  written in  Perl, supports  enough
+    Note that  make++, a  make tool written  in Perl,  supports enough
     features of GNU make to compile FreeType.  See
     
       http://makepp.sourceforge.net
 
-    for more information;  you need version 1.19 or  newer, and you must
+    for more information; you need version 1.19 or newer, and you must
     pass option `--norc-substitution'.
 
-    Make sure that  you are invoking GNU Make from  the command line, by
+    Make sure that you are invoking GNU Make from the command line, by
     typing something like:
 
       make -v
@@ -41,10 +41,10 @@ the file INSTALL.UNX instead.
   2. Invoke `make'
   ----------------
 
-    Go to the root directory of  FreeType 2, then simply invoke GNU Make
-    from  the  command line.   This  will  launch  the FreeType  2  host
-    platform  detection  routines.  A  summary  will  be displayed,  for
-    example, on Win32:
+    Go to  the root  directory of FreeType  2, then simply  invoke GNU
+    Make from the command line.   This will launch the FreeType 2 host
+    platform  detection routines.   A summary  will be  displayed, for
+    example, on Win32.
 
 
       ==============================================================
@@ -54,8 +54,8 @@ the file INSTALL.UNX instead.
 
         platform                     win32
         compiler                     gcc
-        configuration directory      ./builds/win32
-        configuration rules          ./builds/win32/w32-gcc.mk
+        configuration directory      .\builds\win32
+        configuration rules          .\builds\win32\w32-gcc.mk
 
       If this does not correspond to your system or settings please
       remove the file 'config.mk' from this directory then read the
@@ -67,33 +67,33 @@ the file INSTALL.UNX instead.
       =============================================================
 
 
-    If the  detected settings correspond to your  platform and compiler,
-    skip to step  5.  Note that if your platform  is completely alien to
+    If the detected settings correspond to your platform and compiler,
+    skip to step 5.  Note that if your platform is completely alien to
     the build system, the detected platform will be `ansi'.
 
 
   3. Configure the build system for a different compiler
   ------------------------------------------------------
 
-    If the build  system correctly detected your platform,  but you want
-    to use  a different compiler than  the one specified  in the summary
-    (for most  platforms, gcc is  the defaut compiler), invoke  GNU Make
+    If the build system correctly detected your platform, but you want
+    to use a different compiler  than the one specified in the summary
+    (for most platforms, gcc is  the defaut compiler), invoke GNU Make
     with
 
       make setup <compiler>
 
     Examples:
 
-      to use Visual C++ on Win32, type:  "make setup visualc"
-      to use Borland C++ on Win32, type  "make setup bcc32"
-      to use Watcom C++ on Win32, type   "make setup watcom"
-      to use Intel C++ on Win32, type    "make setup intelc"
-      to use LCC-Win32 on Win32, type:   "make setup lcc"
-      to use Watcom C++ on OS/2, type    "make setup watcom"
-      to use VisualAge C++ on OS/2, type "make setup visualage"
+      to use Visual C++ on Win32, type:  `make setup visualc'
+      to use Borland C++ on Win32, type  `make setup bcc32'
+      to use Watcom C++ on Win32, type   `make setup watcom'
+      to use Intel C++ on Win32, type    `make setup intelc'
+      to use LCC-Win32 on Win32, type:   `make setup lcc'
+      to use Watcom C++ on OS/2, type    `make setup watcom'
+      to use VisualAge C++ on OS/2, type `make setup visualage'
 
-    The  <compiler> name  to  use is  platform-dependent.   The list  of
-    available  compilers  for  your  system  is available  in  the  file
+    The  <compiler> name to  use is  platform-dependent.  The  list of
+    available  compilers for  your  system is  available  in the  file
     `builds/<system>/detect.mk'.
 
     If you  are satisfied  by the new  configuration summary,  skip to
@@ -103,53 +103,57 @@ the file INSTALL.UNX instead.
   4. Configure the build system for an unknown platform/compiler
   --------------------------------------------------------------
 
-    The auto-detection/setup phase of the  build system copies a file to
-    the current directory under the name `config.mk'.
+    The auto-detection/setup  phase of the build system  copies a file
+    to the current directory under the name `config.mk'.
 
-    For    example,    on     OS/2+gcc,    it    would    simply    copy
+    For    example,    on    OS/2+gcc,    it   would    simply    copy
     `builds/os2/os2-gcc.mk' to `./config.mk'.
 
-    If  for some  reason your  platform isn't  correctly  detected, copy
-    manually the  configuration sub-makefile to `./config.mk'  and go to
+    If for  some reason your  platform isn't correctly  detected, copy
+    manually the configuration sub-makefile to `./config.mk' and go to
     step 5.
 
-    Note that this file is a sub-Makefile used to specify Make variables
-    for compiler and linker invocation during the build.  You can easily
-    create  your own  version  from one  of  the existing  configuration
-    files,  then  copy  it  to  the current  directory  under  the  name
-    `./config.mk'.
+    Note  that  this file  is  a  sub-Makefile  used to  specify  Make
+    variables  for compiler  and linker  invocation during  the build.
+    You can  easily create your own  version from one  of the existing
+    configuration files,  then copy it to the  current directory under
+    the name `./config.mk'.
 
 
   5. Build the library
   --------------------
 
-    The  auto-detection/setup phase  should have  copied a  file  in the
-    current  directory,   called  `./config.mk'.   This   file  contains
-    definitions of  various Make variables  used to invoke  the compiler
-    and linker during the build.
+    The auto-detection/setup  phase should have  copied a file  in the
+    current  directory,  called  `./config.mk'.   This  file  contains
+    definitions of various Make  variables used to invoke the compiler
+    and linker during the build.  [It has also generated a file called
+    `ftmodule.h'   in  the  objects   directory  (which   is  normally
+    `<toplevel>/objs/');  please read  the  file `docs/CUSTOMIZE'  for
+    customization of FreeType.]
 
-    To launch the build, simply  invoke GNU Make again: The top Makefile
-    will detect the configuration file and run the build with it.
+    To  launch  the build,  simply  invoke  GNU  Make again:  The  top
+    Makefile will detect the configuration file and run the build with
+    it.
 
 
   Final note
   
-    The  build system  builds a  statically linked  library of  the font
-    engine in the `objs' directory.   It does _not_ support the build of
-    DLLs on Windows and OS/2.  If you need these, you have to either use
-    an  IDE-specific  project  file,   or  follow  the  instructions  in
-    `INSTALL.ANY' to create your own Makefiles.
+    The build  system builds a  statically linked library of  the font
+    engine in the  `objs' directory.  It does _not_  support the build
+    of  DLLs on  Windows and  OS/2.  If  you need  these, you  have to
+    either   use  an   IDE-specific  project   file,  or   follow  the
+    instructions in `INSTALL.ANY' to create your own Makefiles.
 
-------------------------------------------------------------------------
+----------------------------------------------------------------------
 
-Copyright 2003, 2004, 2005 by
+Copyright 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,  and  distributed under  the  terms  of  the FreeType  project
-license, LICENSE.TXT.  By continuing  to use, modify, or distribute this
-file  you indicate that  you have  read the  license and  understand and
-accept it fully.
+This  file is  part of  the FreeType  project, and  may only  be used,
+modified,  and distributed  under the  terms of  the  FreeType project
+license,  LICENSE.TXT.  By  continuing to  use, modify,  or distribute
+this file you  indicate that you have read  the license and understand
+and accept it fully.
 
 
 --- end of INSTALL.GNU ---
diff --git a/docs/INSTALL.UNX b/docs/INSTALL.UNX
index f6deea8..13cb896 100644
--- a/docs/INSTALL.UNX
+++ b/docs/INSTALL.UNX
@@ -1,62 +1,62 @@
-This document contains instructions on how to build the FreeType library
-on Unix systems.  This also works  for emulations like Cygwin or MSys on
-Win32:
+This  document contains  instructions  on how  to  build the  FreeType
+library on Unix  systems.  This also works for  emulations like Cygwin
+or MSys on Win32:
 
 
   1. Ensure that you are using GNU Make
   -------------------------------------
 
-    The FreeType  build system _exclusively_  works with GNU  Make.  You
-    will not be able to  compile the library with the instructions below
-    using any other alternative (including BSD Make).
+    The FreeType build system  _exclusively_ works with GNU Make.  You
+    will  not be  able to  compile the  library with  the instructions
+    below using any other alternative (including BSD Make).
 
-    [Well, this is not  really correct.  Recently, a perl implementation
-    of make called `makepp' has appeared which can also build FreeType 2
-    successfully on Unix platforms.  See
+    [Well,  this  is not  really  correct.  A  few  years  ago a  perl
+    implementation of make called `makepp' has appeared which can also
+    build FreeType 2 successfully on Unix platforms.  See
 
       http://makepp.sourceforge.net
 
-    for more details; you need version  1.19 or newer, and you must pass
-    option `--norc-substitution'.]
+    for more  details; you  need version 1.19  or newer, and  you must
+    pass option `--norc-substitution'.]
 
-    Trying to compile the library  with a different Make tool will print
-    a message like:
+    Trying  to compile  the library  with a  different Make  tool will
+    print a message like:
 
       Sorry, GNU make is required to build FreeType2.
 
-    and the build process will be aborted.  If this happens, install GNU
-    Make on  your system,  and use the  GNUMAKE environment  variable to
-    name it.
+    and the build  process will be aborted.  If  this happens, install
+    GNU Make on your system,  and use the GNUMAKE environment variable
+    to name it, if necessary.
 
 
   2. Build and install the library
   --------------------------------
 
-    The  following should  work on  all  Unix systems  where the  `make'
+    The following  should work  on all Unix  systems where  the `make'
     command invokes GNU Make:
 
       ./configure [options]
       make
       make install           (as root)
 
-    The default  installation path is  `/usr/local'.  It can  be changed
+    The default installation path  is `/usr/local'.  It can be changed
     with the `--prefix=<path>' option.  Example:
 
       ./configure --prefix=/usr
 
-    When using a  different command to invoke GNU  Make, use the GNUMAKE
-    variable.  For  example, if  `gmake' is the  command to use  on your
+    When using a different command to invoke GNU Make, use the GNUMAKE
+    variable.  For example,  if `gmake' is the command  to use on your
     system, do something like:
 
        GNUMAKE=gmake ./configure [options]
        gmake
        gmake install            (as root)
 
-    If this still doesn't work, there must be a problem with your system
-    (e.g., you are using a very old version of GNU Make).
+    If  this still doesn't  work, there  must be  a problem  with your
+    system (e.g., you are using a very old version of GNU Make).
 
-    It  is  possible  to  compile  FreeType in  a  different  directory.
-    Assuming the  FreeType source  files in directory  `/src/freetype' a
+    It  is possible  to  compile FreeType  in  a different  directory.
+    Assuming the FreeType source  files in directory `/src/freetype' a
     compilation in directory `foo' works as follows:
 
       cd foo
@@ -64,16 +64,16 @@ Win32:
       make
       make install
 
-------------------------------------------------------------------------
+----------------------------------------------------------------------
 
-Copyright 2003, 2004, 2005 by
+Copyright 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,  and  distributed under  the  terms  of  the FreeType  project
-license, LICENSE.TXT.  By continuing  to use, modify, or distribute this
-file  you indicate that  you have  read the  license and  understand and
-accept it fully.
+This  file is  part of  the FreeType  project, and  may only  be used,
+modified,  and distributed  under the  terms of  the  FreeType project
+license,  LICENSE.TXT.  By  continuing to  use, modify,  or distribute
+this file you  indicate that you have read  the license and understand
+and accept it fully.
 
 
 --- end of INSTALL.UNX ---
diff --git a/docs/modules.txt b/docs/modules.txt
deleted file mode 100644
index e1a8cfd..0000000
--- a/docs/modules.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-This file shows the interdependencies of various FreeType modules.
-
-Note that the use of `psnames' can be controlled in ftconfig.h
-(FT_CONFIG_OPTION_POSTSCRIPT_NAMES).
-
-  module       dependency
- ---------------------------------------
-  cff          sfnt, pshinter, psnames
-  cid          psaux, pshinter, psnames
-  truetype     sfnt
-  type1        psaux, pshinter, psnames
-  type42       truetype
-  psaux        psnames
-  sfnt         psnames
-
-------------------------------------------------------------------------
-
-Copyright 2001, 2002 by
-David Turner, Robert Wilhelm, and Werner Lemberg.
-
-This  file  is  part  of the  FreeType  project, and may  only be  used,
-modified,  and  distributed  under  the  terms of  the FreeType  project
-license, LICENSE.TXT.   By continuing to use, modify, or distribute this
-file you  indicate that  you have  read the  license and understand  and
-accept it fully.
-
-
---- end of modules.txt ---
diff --git a/include/freetype/config/ftmodule.h b/include/freetype/config/ftmodule.h
index f9694b8..d92b0ee 100644
--- a/include/freetype/config/ftmodule.h
+++ b/include/freetype/config/ftmodule.h
@@ -1,3 +1,15 @@
+/*
+ *  This file registers the FreeType modules compiled into the library.
+ *
+ *  If you use GNU make, this file IS NOT USED!  Instead, it is created in
+ *  the objects directory (normally `<topdir>/objs/') based on information
+ *  from `<topdir>/modules.cfg'.
+ *
+ *  Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
+ *  FreeType without GNU make.
+ *
+ */
+
 FT_USE_MODULE(autofit_module_class)
 FT_USE_MODULE(tt_driver_class)
 FT_USE_MODULE(t1_driver_class)
@@ -16,3 +28,5 @@ FT_USE_MODULE(ft_smooth_renderer_class)
 FT_USE_MODULE(ft_smooth_lcd_renderer_class)
 FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
 FT_USE_MODULE(bdf_driver_class)
+
+/* EOF */
diff --git a/include/freetype/internal/ftmemory.h b/include/freetype/internal/ftmemory.h
index 8543642..40703d5 100644
--- a/include/freetype/internal/ftmemory.h
+++ b/include/freetype/internal/ftmemory.h
@@ -108,7 +108,6 @@ FT_BEGIN_HEADER
   FT_BASE( FT_Pointer )
   FT_QAlloc_Debug( FT_Memory    memory,
                    FT_Long      size,
-                   void*        P,
                    FT_Error    *p_error,
                    const char*  file_name,
                    FT_Long      line_no );
@@ -133,7 +132,7 @@ FT_BEGIN_HEADER
 
   FT_BASE( void )
   FT_Free_Debug( FT_Memory    memory,
-                 FT_Pointer   block,
+                 const void  *P,
                  const char*  file_name,
                  FT_Long      line_no );
 
diff --git a/modules.cfg b/modules.cfg
new file mode 100644
index 0000000..f251fd8
--- /dev/null
+++ b/modules.cfg
@@ -0,0 +1,227 @@
+# modules.cfg
+#
+# Copyright 2005 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+#
+#
+# In case you compile the FreeType library with GNU make or makepp, this
+# file controls which components are built into the library.  Otherwise,
+# please read this file for information on the various modules and its
+# dependencies, then follow the instructions in the file `docs/INSTALL.ANY'.
+#
+# To deactivate a module, simply comment out the corresponding line.  To
+# activate a module, remove the comment character.
+#
+# Note that many modules and components are further controlled with macros
+# in the file `include/freetype/config/ftoption.h'.
+
+
+####
+#### font modules -- at least one is required
+####
+####   The order given here (from top to down) is the order used for testing
+####   font formats in the compiled library.
+####
+
+# TrueType font driver.
+#
+# This driver needs the `sfnt' module.
+FONT_MODULES += truetype
+
+# PostScript Type 1 font driver.
+#
+# This driver needs the `psaux', `pshinter', and `psnames' modules.
+FONT_MODULES += type1
+
+# CFF/OpenType font driver.
+#
+# This driver needs the `sfnt', `pshinter', and `psnames' modules.
+FONT_MODULES += cff
+
+# Type 1 CID-keyed font driver.
+#
+# This driver needs the `psaux', `pshinter', and `psnames' modules.
+FONT_MODULES += cid
+
+# PFR/TrueDoc font driver.  See optional extension ftpfr.c below also.
+FONT_MODULES += pfr
+
+# PostScript Type 42 font driver.
+#
+# This driver needs the `truetype' module.
+FONT_MODULES += type42
+
+# Windows FONT/FNT font driver.  See optional extension ftwinfnt.c below
+# also.
+FONT_MODULES += winfonts
+
+# PCF font driver.
+FONT_MODULES += pcf
+
+# BDF font driver.  See optional extension ftbdf.c below also.
+FONT_MODULES += bdf
+
+# SFNT files support.  If used without `truetype' or `cff', it supports
+# bitmap-only fonts within an SFNT wrapper.
+#
+# This driver needs the `psnames' module.
+FONT_MODULES += sfnt
+
+
+####
+#### hinting modules
+####
+
+# FreeType's auto hinter.
+HINTING_MODULES += autofit
+
+# PostScript hinter.
+HINTING_MODULES += pshinter
+
+# The TrueType hinting engine doesn't have a module of its own but is
+# controlled in file include/freetype/config/ftoption.h
+# (TT_CONFIG_OPTION_BYTECODE_INTERPRETER and friends).
+
+
+####
+#### raster modules -- at least one is required for vector font formats
+####
+
+# Monochrome rasterizer.
+RASTER_MODULES += raster
+
+# Anti-aliasing rasterizer.
+RASTER_MODULES += smooth
+
+
+####
+#### auxiliary modules
+####
+
+# FreeType's cache sub-system (quite stable but still in beta -- this means
+# that its public API is subject to change if necessary).  See
+# include/freetype/ftcache.h.
+AUX_MODULES += cache
+
+# TrueType GX/AAT table validation.  Needs ftgxval.c below.
+# AUX_MODULES += gxvalid
+
+# Support for streams compressed with gzip (files with suffix .gz).
+#
+# See include/freetype/ftgzip.h for the API.
+AUX_MODULES += gzip
+
+# Support for streams compressed with LZW (files with suffix .Z).
+#
+# See include/freetype/ftlzw.h for the API.
+AUX_MODULES += lzw
+
+# OpenType table validation.  Needs ftotval.c below.
+#
+# AUX_MODULES += otvalid
+
+# Auxiliary PostScript driver component to share common code.
+#
+# This module depends on `psnames'.
+AUX_MODULES += psaux
+
+# Support for PostScript glyph names.
+#
+# This module can be controlled in ftconfig.h
+# (FT_CONFIG_OPTION_POSTSCRIPT_NAMES).
+AUX_MODULES += psnames
+
+
+####
+#### base module extensions
+####
+
+# Exact bounding box calculation.
+#
+# See include/freetype/ftbbox.h for the API.
+BASE_EXTENSIONS += ftbbox.c
+
+# Access BDF-specific strings.  Needs BDF font driver.
+#
+# See include/freetype/ftbdf.h for the API.
+BASE_EXTENSIONS += ftbdf.c
+
+# Utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp bitmaps into
+# 8bpp format, and for emboldening of bitmap glyphs..
+#
+# See include/freetype/ftbitmap.h for the API. 
+BASE_EXTENSIONS += ftbitmap.c
+
+# Convenience functions to handle glyphs.
+#
+# See include/freetype/ftglyph.h for the API.
+BASE_EXTENSIONS += ftglyph.c
+
+# Interface for gxvalid module (which is required).
+#
+# See include/freetype/ftgxval.h for the API.
+# BASE_EXTENSIONS += ftgxval.c
+
+# Multiple Master font interface.
+#
+# See include/freetype/ftmm.h for the API.
+BASE_EXTENSIONS += ftmm.c
+
+# Interface for otvalid module (which is required).
+#
+# See include/freetype/ftotval.h for the API.
+# BASE_EXTENSIONS += ftotval.c
+
+# Interface for accessing PFR-specific data.  Needs PFR font driver.
+#
+# See include/freetype/ftpfr.h for the API.
+BASE_EXTENSIONS += ftpfr.c
+
+# Path stroker.
+#
+# See include/freetype/ftstroke.h for the API.
+BASE_EXTENSIONS += ftstroke.c
+
+# Support for synthetic embolding and slanting of fonts.
+#
+# See include/freetype/ftsynth.h for the API.
+BASE_EXTENSIONS += ftsynth.c
+
+# Interface to access data specific to PostScript Type 1 and Type 2 (CFF)
+# fonts.
+#
+# See include/freetype/t1tables.h for the API.
+BASE_EXTENSIONS += fttype1.c
+
+# Interface for accessing data specific to Windows FNT files.  Needs winfnt
+# driver.
+#
+# See include/freetype/ftwinfnt.h for the API.
+BASE_EXTENSIONS += ftwinfnt.c
+
+# Support functions for X11.  Useful only for building the XFree86 font
+# server.
+#
+# See include/freetype/ftxf86.h for the API.
+# BASE_EXTENSIONS += ftxf86.c
+
+
+####
+#### The components `ftsystem.c' (for memory allocation and stream I/O
+#### management) and `ftdebug.c' (for emitting debug messages to the user)
+#### are controlled with the following variables.
+####
+####   ftsystem.c:  $(FTSYS_SRC)
+####   ftdebug.c:   $(FTDEBUG_SRC)
+####
+#### Please refer to docs/CUSTOMIZE for details.
+####
+
+
+# EOF
diff --git a/src/autofit/module.mk b/src/autofit/module.mk
index 37b64aa..4a386ce 100644
--- a/src/autofit/module.mk
+++ b/src/autofit/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_autofit_module
+FTMODULE_H_COMMANDS += AUTOFIT_MODULE
 
-make_module_list: add_autofit_module
-
-add_autofit_module:
-	$(OPEN_DRIVER)autofit_module_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)autofit   $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)
+define AUTOFIT_MODULE
+$(OPEN_DRIVER)autofit_module_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)autofit   $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c
index 4c1e68d..557a05c 100644
--- a/src/base/ftdbgmem.c
+++ b/src/base/ftdbgmem.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Memory debugger (body).                                              */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2005 by                              */
+/*  Copyright 2001, 2002, 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,       */
@@ -887,6 +887,115 @@
   }
 
 
+#ifdef FT_STRICT_ALIASING
+
+
+  FT_BASE_DEF( FT_Pointer )
+  FT_Alloc_Debug( FT_Memory    memory,
+                  FT_Long      size,
+                  FT_Error    *p_error,
+                  const char*  file_name,
+                  FT_Long      line_no )
+  {
+    FT_MemTable  table = (FT_MemTable)memory->user;
+
+
+    if ( table )
+    {
+      table->file_name = file_name;
+      table->line_no   = line_no;
+    }
+
+    return FT_Alloc( memory, size, p_error );
+  }
+
+
+  FT_BASE_DEF( FT_Pointer )
+  FT_Realloc_Debug( FT_Memory    memory,
+                    FT_Long      current,
+                    FT_Long      size,
+                    void*        block,
+                    FT_Error    *p_error,
+                    const char*  file_name,
+                    FT_Long      line_no )
+  {
+    FT_MemTable  table = (FT_MemTable)memory->user;
+
+
+    if ( table )
+    {
+      table->file_name = file_name;
+      table->line_no   = line_no;
+    }
+
+    return FT_Realloc( memory, current, size, block, p_error );
+  }
+
+
+  FT_BASE_DEF( FT_Pointer )
+  FT_QAlloc_Debug( FT_Memory    memory,
+                   FT_Long      size,
+                   FT_Error    *p_error,
+                   const char*  file_name,
+                   FT_Long      line_no )
+  {
+    FT_MemTable  table = (FT_MemTable)memory->user;
+
+
+    if ( table )
+    {
+      table->file_name = file_name;
+      table->line_no   = line_no;
+    }
+
+    return FT_QAlloc( memory, size, p_error );
+  }
+
+
+  FT_BASE_DEF( FT_Pointer )
+  FT_QRealloc_Debug( FT_Memory    memory,
+                     FT_Long      current,
+                     FT_Long      size,
+                     void*        block,
+                     FT_Error    *p_error,
+                     const char*  file_name,
+                     FT_Long      line_no )
+  {
+    FT_MemTable  table = (FT_MemTable)memory->user;
+
+
+    if ( table )
+    {
+      table->file_name = file_name;
+      table->line_no   = line_no;
+    }
+
+    return FT_QRealloc( memory, current, size, block, p_error );
+  }
+
+
+  FT_BASE_DEF( void )
+  FT_Free_Debug( FT_Memory    memory,
+                 const void  *P,
+                 const char*  file_name,
+                 FT_Long      line_no )
+  {
+    FT_MemTable  table = (FT_MemTable)memory->user;
+
+
+    if ( table )
+    {
+      table->file_name = file_name;
+      table->line_no   = line_no;
+    }
+
+    FT_Free( memory, (void *)P );
+  }
+
+
+#else /* !FT_STRICT_ALIASING */
+
+
   FT_BASE_DEF( FT_Error )
   FT_Alloc_Debug( FT_Memory    memory,
                   FT_Long      size,
@@ -988,6 +1097,8 @@
   }
 
 
+#endif /* !FT_STRICT_ALIASING */
+
   static int
   ft_mem_source_compare( const void*  p1,
                          const void*  p2 )
diff --git a/src/base/rules.mk b/src/base/rules.mk
index 32dadbd..bbc6cb7 100644
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2003, 2004, 2005 by
+# Copyright 1996-2000, 2002, 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,
@@ -46,23 +46,11 @@ BASE_SRC := $(BASE_DIR)/ftapi.c    \
 
 # Base layer `extensions' sources
 #
-# An extension is added to the library file (.a or .lib) as a separate
-# object.  It will then be linked to the final executable only if one of its
-# symbols is used by the application.
-#
-BASE_EXT_SRC := $(BASE_DIR)/ftbitmap.c \
-                $(BASE_DIR)/ftbbox.c   \
-                $(BASE_DIR)/ftbdf.c    \
-                $(BASE_DIR)/ftglyph.c  \
-                $(BASE_DIR)/ftgxval.c  \
-                $(BASE_DIR)/ftmm.c     \
-                $(BASE_DIR)/ftotval.c  \
-                $(BASE_DIR)/ftpfr.c    \
-                $(BASE_DIR)/ftstroke.c \
-                $(BASE_DIR)/ftsynth.c  \
-                $(BASE_DIR)/fttype1.c  \
-                $(BASE_DIR)/ftwinfnt.c \
-                $(BASE_DIR)/ftxf86.c
+# An extension is added to the library file as a separate object.  It is
+# then linked to the final executable only if one of its symbols is used by
+# the application.
+#
+BASE_EXT_SRC := $(patsubst %,$(BASE_DIR)/%,$(BASE_EXTENSIONS))
 
 # Default extensions objects
 #
diff --git a/src/bdf/module.mk b/src/bdf/module.mk
index 3d56d73..a978973 100644
--- a/src/bdf/module.mk
+++ b/src/bdf/module.mk
@@ -24,12 +24,11 @@
 # THE SOFTWARE.
 
 
-.PHONY: add_bdf_driver
+FTMODULE_H_COMMANDS += BDF_DRIVER
 
-make_module_list: add_bdf_driver
-
-add_bdf_driver:
-	$(OPEN_DRIVER)bdf_driver_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)bdf       $(ECHO_DRIVER_DESC)bdf bitmap fonts$(ECHO_DRIVER_DONE)
+define BDF_DRIVER
+$(OPEN_DRIVER)bdf_driver_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)bdf       $(ECHO_DRIVER_DESC)bdf bitmap fonts$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/cff/module.mk b/src/cff/module.mk
index 121a50b..0474e37 100644
--- a/src/cff/module.mk
+++ b/src/cff/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_cff_driver
+FTMODULE_H_COMMANDS += CFF_DRIVER
 
-make_module_list: add_cff_driver
-
-add_cff_driver:
-	$(OPEN_DRIVER)cff_driver_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)cff       $(ECHO_DRIVER_DESC)OpenType fonts with extension *.otf$(ECHO_DRIVER_DONE)
+define CFF_DRIVER
+$(OPEN_DRIVER)cff_driver_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)cff       $(ECHO_DRIVER_DESC)OpenType fonts with extension *.otf$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/cid/module.mk b/src/cid/module.mk
index 84a8140..41e5a68 100644
--- a/src/cid/module.mk
+++ b/src/cid/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_type1cid_driver
+FTMODULE_H_COMMANDS += TYPE1CID_DRIVER
 
-make_module_list: add_type1cid_driver
-
-add_type1cid_driver:
-	$(OPEN_DRIVER)t1cid_driver_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)cid       $(ECHO_DRIVER_DESC)Postscript CID-keyed fonts, no known extension$(ECHO_DRIVER_DONE)
+define TYPE1CID_DRIVER
+$(OPEN_DRIVER)t1cid_driver_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)cid       $(ECHO_DRIVER_DESC)Postscript CID-keyed fonts, no known extension$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/gxvalid/module.mk b/src/gxvalid/module.mk
index 41b33a7..3e1d7d9 100644
--- a/src/gxvalid/module.mk
+++ b/src/gxvalid/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_gxvalid_module
+FTMODULE_H_COMMANDS += GXVALID_MODULE
 
-make_module_list: add_gxvalid_module
-
-add_gxvalid_module:
-	$(OPEN_DRIVER)gxvalid_module_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)gxvalid     $(ECHO_DRIVER_DESC)TrueTypeGX/AAT validation module$(ECHO_DRIVER_DONE)
+define GXVALID_MODULE
+$(OPEN_DRIVER)gxvalid_module_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)gxvalid     $(ECHO_DRIVER_DESC)TrueTypeGX/AAT validation module$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/otvalid/module.mk b/src/otvalid/module.mk
index 966fece..4ef4387 100644
--- a/src/otvalid/module.mk
+++ b/src/otvalid/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_otvalid_module
+FTMODULE_H_COMMANDS += OTVALID_MODULE
 
-make_module_list: add_otvalid_module
-
-add_otvalid_module:
-	$(OPEN_DRIVER)otvalid_module_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)otvalid     $(ECHO_DRIVER_DESC)OpenType validation module$(ECHO_DRIVER_DONE)
+define OTVALID_MODULE
+$(OPEN_DRIVER)otvalid_module_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)otvalid     $(ECHO_DRIVER_DESC)OpenType validation module$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/pcf/module.mk b/src/pcf/module.mk
index e2da8d4..5bc7ce3 100644
--- a/src/pcf/module.mk
+++ b/src/pcf/module.mk
@@ -24,12 +24,11 @@
 # THE SOFTWARE.
 
 
-.PHONY: add_pcf_driver
+FTMODULE_H_COMMANDS += PCF_DRIVER
 
-make_module_list: add_pcf_driver
-
-add_pcf_driver:
-	$(OPEN_DRIVER)pcf_driver_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)pcf       $(ECHO_DRIVER_DESC)pcf bitmap fonts$(ECHO_DRIVER_DONE)
+define PCF_DRIVER
+$(OPEN_DRIVER)pcf_driver_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)pcf       $(ECHO_DRIVER_DESC)pcf bitmap fonts$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/pfr/module.mk b/src/pfr/module.mk
index d93b631..53ab34a 100644
--- a/src/pfr/module.mk
+++ b/src/pfr/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_pfr_driver
+FTMODULE_H_COMMANDS += PFR_DRIVER
 
-make_module_list: add_pfr_driver
-
-add_pfr_driver:
-	$(OPEN_DRIVER)pfr_driver_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)pfr       $(ECHO_DRIVER_DESC)PFR/TrueDoc font files with extension *.pfr$(ECHO_DRIVER_DONE)
+define PFR_DRIVER
+$(OPEN_DRIVER)pfr_driver_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)pfr       $(ECHO_DRIVER_DESC)PFR/TrueDoc font files with extension *.pfr$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/psaux/module.mk b/src/psaux/module.mk
index 9abd525..5431522 100644
--- a/src/psaux/module.mk
+++ b/src/psaux/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_psaux_module
+FTMODULE_H_COMMANDS += PSAUX_MODULE
 
-make_module_list: add_psaux_module
-
-add_psaux_module:
-	$(OPEN_DRIVER)psaux_module_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)psaux     $(ECHO_DRIVER_DESC)Postscript Type 1 & Type 2 helper module$(ECHO_DRIVER_DONE)
+define PSAUX_MODULE
+$(OPEN_DRIVER)psaux_module_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)psaux     $(ECHO_DRIVER_DESC)Postscript Type 1 & Type 2 helper module$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/pshinter/module.mk b/src/pshinter/module.mk
index 42ed7b7..cd171d0 100644
--- a/src/pshinter/module.mk
+++ b/src/pshinter/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_pshinter_module
+FTMODULE_H_COMMANDS += PSHINTER_MODULE
 
-make_module_list: add_pshinter_module
-
-add_pshinter_module:
-	$(OPEN_DRIVER)pshinter_module_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)pshinter  $(ECHO_DRIVER_DESC)Postscript hinter module$(ECHO_DRIVER_DONE)
+define PSHINTER_MODULE
+$(OPEN_DRIVER)pshinter_module_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)pshinter  $(ECHO_DRIVER_DESC)Postscript hinter module$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/psnames/module.mk b/src/psnames/module.mk
index 255a0e0..a93063b 100644
--- a/src/psnames/module.mk
+++ b/src/psnames/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_psnames_module
+FTMODULE_H_COMMANDS += PSNAMES_MODULE
 
-make_module_list: add_psnames_module
-
-add_psnames_module:
-	$(OPEN_DRIVER)psnames_module_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)psnames   $(ECHO_DRIVER_DESC)Postscript & Unicode Glyph name handling$(ECHO_DRIVER_DONE)
+define PSNAMES_MODULE
+$(OPEN_DRIVER)psnames_module_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)psnames   $(ECHO_DRIVER_DESC)Postscript & Unicode Glyph name handling$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/raster/module.mk b/src/raster/module.mk
index 2f5682f..59c737b 100644
--- a/src/raster/module.mk
+++ b/src/raster/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_raster_module
+FTMODULE_H_COMMANDS += RASTER_MODULE
 
-make_module_list: add_raster_module
-
-add_raster_module:
-	$(OPEN_DRIVER)ft_raster1_renderer_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)raster    $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE)
+define RASTER_MODULE
+$(OPEN_DRIVER)ft_raster1_renderer_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)raster    $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/sfnt/module.mk b/src/sfnt/module.mk
index 00a2d77..d339138 100644
--- a/src/sfnt/module.mk
+++ b/src/sfnt/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_sfnt_module
+FTMODULE_H_COMMANDS += SFNT_MODULE
 
-make_module_list: add_sfnt_module
-
-add_sfnt_module:
-	$(OPEN_DRIVER)sfnt_module_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)sfnt      $(ECHO_DRIVER_DESC)helper module for TrueType & OpenType formats$(ECHO_DRIVER_DONE)
+define SFNT_MODULE
+$(OPEN_DRIVER)sfnt_module_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)sfnt      $(ECHO_DRIVER_DESC)helper module for TrueType & OpenType formats$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/smooth/module.mk b/src/smooth/module.mk
index bc2f7ff..05ad4ba 100644
--- a/src/smooth/module.mk
+++ b/src/smooth/module.mk
@@ -13,16 +13,15 @@
 # fully.
 
 
-.PHONY: add_smooth_renderer
+FTMODULE_H_COMMANDS += SMOOTH_RENDERER
 
-make_module_list: add_smooth_renderer
-
-add_smooth_renderer:
-	$(OPEN_DRIVER)ft_smooth_renderer_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)smooth    $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer$(ECHO_DRIVER_DONE)
-	$(OPEN_DRIVER)ft_smooth_lcd_renderer_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)smooth    $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for LCDs$(ECHO_DRIVER_DONE)
-	$(OPEN_DRIVER)ft_smooth_lcdv_renderer_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)smooth    $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for vertical LCDs$(ECHO_DRIVER_DONE)
+define SMOOTH_RENDERER
+$(OPEN_DRIVER)ft_smooth_renderer_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)smooth    $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer$(ECHO_DRIVER_DONE)
+$(OPEN_DRIVER)ft_smooth_lcd_renderer_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)smooth    $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for LCDs$(ECHO_DRIVER_DONE)
+$(OPEN_DRIVER)ft_smooth_lcdv_renderer_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)smooth    $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for vertical LCDs$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/truetype/module.mk b/src/truetype/module.mk
index 2f2d853..3b05afc 100644
--- a/src/truetype/module.mk
+++ b/src/truetype/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_truetype_driver
+FTMODULE_H_COMMANDS += TRUETYPE_DRIVER
 
-make_module_list: add_truetype_driver
-
-add_truetype_driver:
-	$(OPEN_DRIVER)tt_driver_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)truetype  $(ECHO_DRIVER_DESC)Windows/Mac font files with extension *.ttf or *.ttc$(ECHO_DRIVER_DONE)
+define TRUETYPE_DRIVER
+$(OPEN_DRIVER)tt_driver_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)truetype  $(ECHO_DRIVER_DESC)Windows/Mac font files with extension *.ttf or *.ttc$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/type1/module.mk b/src/type1/module.mk
index cbcd8c7..baf98c0 100644
--- a/src/type1/module.mk
+++ b/src/type1/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_type1_driver
+FTMODULE_H_COMMANDS += TYPE1_DRIVER
 
-make_module_list: add_type1_driver
-
-add_type1_driver:
-	$(OPEN_DRIVER)t1_driver_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)type1     $(ECHO_DRIVER_DESC)Postscript font files with extension *.pfa or *.pfb$(ECHO_DRIVER_DONE)
+define TYPE1_DRIVER
+$(OPEN_DRIVER)t1_driver_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)type1     $(ECHO_DRIVER_DESC)Postscript font files with extension *.pfa or *.pfb$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/type42/module.mk b/src/type42/module.mk
index 35c7010..8bd40a5 100644
--- a/src/type42/module.mk
+++ b/src/type42/module.mk
@@ -13,12 +13,11 @@
 # fully.
 
 
-.PHONY: add_type42_driver
+FTMODULE_H_COMMANDS += TYPE42_DRIVER
 
-make_module_list: add_type42_driver
-
-add_type42_driver:
-	$(OPEN_DRIVER)t42_driver_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)type42    $(ECHO_DRIVER_DESC)Type 42 font files with no known extension$(ECHO_DRIVER_DONE)
+define TYPE42_DRIVER
+$(OPEN_DRIVER)t42_driver_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)type42    $(ECHO_DRIVER_DESC)Type 42 font files with no known extension$(ECHO_DRIVER_DONE)
+endef
 
 # EOF
diff --git a/src/winfonts/module.mk b/src/winfonts/module.mk
index fec9354..0ace3ae 100644
--- a/src/winfonts/module.mk
+++ b/src/winfonts/module.mk
@@ -13,11 +13,11 @@
 # fully.
 
 
-.PHONY: add_windows_driver
+FTMODULE_H_COMMANDS += WINDOWS_DRIVER
 
-make_module_list: add_windows_driver
-
-add_windows_driver:
-	$(OPEN_DRIVER)winfnt_driver_class$(CLOSE_DRIVER)
-	$(ECHO_DRIVER)winfnt    $(ECHO_DRIVER_DESC)Windows bitmap fonts with extension *.fnt or *.fon$(ECHO_DRIVER_DONE)
+define WINDOWS_DRIVER
+$(OPEN_DRIVER)winfnt_driver_class$(CLOSE_DRIVER)
+$(ECHO_DRIVER)winfnt    $(ECHO_DRIVER_DESC)Windows bitmap fonts with extension *.fnt or *.fon$(ECHO_DRIVER_DONE)
+endef
 
+# EOF