summaryrefslogtreecommitdiff
path: root/scripts/mk-configure.7.in
blob: ab6c9dadf414d67d1120a13dd4b91a4b97f31ac1 (plain)
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
.\"	$NetBSD$
.\"
.\" This file contains parts of NetBSD's bsd.README file
.\"
.\" Copyright (c) 2009-2014 by Aleksey Cheusov (vle@gmx.net)
.\" Absolutely no warranty.
.\"
.\" ------------------------------------------------------------------
.de VS \" Verbatim Start
.sp
.ft CW
.nf
.ne \\$1
..
.de VE \" Verbatim End
.ft R
.fi
.sp
..
.\" ------------------------------------------------------------------
.TH MK-CONFIGURE 7 "Aug 21, 2014" "" ""
.SH NAME
mk-configure \- lightweight replacement for GNU autotools
.SH DESCRIPTION
.B mk-configure
is a collection of include files for bmake (portable version of
NetBSD make) and a number of executables. It is intended to simplify
crossplatform development and software building.
.P
There are only a few top-level makefiles:
.BR mkc.init.mk ", " mkc.mk ", " mkc.configure.mk ", " mkc.minitest.mk .
Everything else
.RB ( mkc_imp.*.mk " files)"
is included implicitely. Do not use
.B mkc_imp.*.mk
files directly! If you do, I cannot guarantee backward compatibility.
.B mkc.configure.mk
is included automatically by
.BR mkc.mk ,
but can be included explicitely.
.B mkc.minitest.mk
provides a trivial support for regression tests and should be included explicitely.
Usually mk-c makefiles consist of variables assignments
and inclusion of
.B mkc.mk
in the and.
One can also use
.BR mkc.prog.mk ", " mkc.lib.mk ", " mkc.files.mk ", " mkc.subdir.mk " and " mkc.subprj.mk
instead of
.BR mkc.mk .
The latter activates
.B mkc.lib.mk
if variable LIB is set,
.B mkc.prog.mk
if variables PROG or PROGS are set,
.B mkc.subprj.mk
if variable SUBPRJ is set,
.B mkc.subdir.mk
if variable SUBDIR is set,
and
.B mkc.files.mk
otherwise.
.B 
.P
To get system-wide configuration parameters, mkc.init.mk loads
"${MAKECONF}" file if it exists.
Otherwise, it loads
@sysconfdir@/mk-c.conf if it exists.
If neither ${MAKECONF} nor @sysconfdir@/mk-c.conf exist,
it tries to load @sysconfdir@/mk.conf file.
If "${SRCTOP}/Makefile.common" file exists it is also included
by all subprojects.
Unless SRCTOP variable is set, "../Makefile.inc"
is also included if exists.
These files may define any of the variables described
below. Below in square brackets the default value for variables are specified.
In triangle brackets -- typical way of use, where
.I I
means "Initialized by mk-configure",
.I Iu
means "Initialized by mk-configure but may be overriden by user",
.I Im
means "Initialized by mk-configure but may be set in Makefile",
.I U
means "Usually set by user",
.I M
means "May be set or changed in project's Makefile" and
.I Mu
means "May be set in project's Makefile but may be initialized or overriden by user".
.SS "Targets"
Mk-configure provides the following targets:
.IP all
build everything.
.IP clean
clean temporary files and directories with a help of
${CLEANFILES_CMD} and ${CLEANDIRS_CMD} commands.
.IP cleandir
remove all of the files removed by the target clean, as
well as cache files created by
.BR mkc.configure.mk .
.IP distclean
synonym for target "cleandir".
.IP installdirs
create target directories.
.IP install
install programs, libraries, files, include files, manual pages etc.
to the target directories with a help of ${INSTALL} program.
.IP uninstall
remove installed files with a help of ${UNINSTALL} command.
.IP errorcheck
check for MKC_ERR_MSG variable and fails if it set printing
an error message
.IP depend
create .depend file containing list of dependencies (see mkdep(1)).
.IP filelist
output a list of destination files of the project, one per line, e.g.
.VS
  /usr/local/bin/hello
  /usr/local/man/man1/hello.1
.VE
.IP "obj"
if MKOBJDIR is "yes", creates object directories (${.OBJDIR}) according
to MAKEOBJDIR and MAKEOBJPREFIX variables. Current umask is used for
this.
.VE
.IP mkgen
.RB See " mkc_imp.foreign_autotools.mk" .
.IP "bin_tar, bin_targz, bin_tarbz2, bin_zip, bin_deb"
build software, install it to a temporary directory (using DESTDIR)
and create .tar/.tar.gz/.tar.bz2/.zip/.deb archive
containing all installed files.
The target
.I bin_deb
expects debian control files in DEBIAN subdirectory, see examples/hello_files
for the sample.
.P
.B NOTE:
Commands associated with targets
.IR all ", " install ", " clean ", " cleandir ", " depend ", " test ", " installdirs ", " uninstall ", " errorcheck " and " filelist
in Makefile override the standard behaviour.
.P
.B NOTE:
All targets in this list have 
.IR pre\_* ", " do\_* " and " post\_*
counterparts. See ALLTARGETS for details.
.SS "mkc.init.mk"
This file is included by
.BR mkc.mk " and " mkc.configure.mk
automatically but can be used by users directly.
.B mkc.init.mk
uses the following variables.
.IP AR
Create, modify, and extract from archives.
.RI < Iu >
.RI [ ar ]
.IP ARFLAGS
Options to ${AR}.
.RI < Iu >
.RI [ rl ]
.IP AS
Assembler.
.RI < Iu >
.RI [ as ]
.IP AFLAGS
Options to ${CC} when compiling or linking .s or .S
assembly source files.  []
.\" .IP ADDR2LINE
.\" Path to addr2line.  [addr2line]
.IP CC
C compiler.
.RI < Iu >
.RI [ cc ]
.IP CC_PREFIX
Prefix command for ${CC}, for example, distcc or ccache.
.RI < Iu >
.RI [ "" ]
.IP CFLAGS
Additional flags to the compiler when creating C objects.
.RI < "IM" >
.IP CFLAGS_<project>
Similar to CFLAGS but for project ${PROJECTNAME}.
.RI < "U" >
.IP CLEANFILES_CMD
Command for removing files used by targets "clean" and "cleandir".
.RI < Iu >
.RI [ "${RM} -f" ]
.IP CLEANDIRS_CMD
Command for removing directories used by targets "clean" and "cleandir".
.RI < Iu >
.RI [ "${RM} -rf" ]
.IP COPTS
Additional flags to the compiler when creating C objects.
.RI < "U" >
.IP COPTS_<project>
Similar to COPTS but for project ${PROJECTNAME}.
.RI < "U" >
.IP CXX
C++ compiler.
.RI < Iu >
.RI [ c++ ]
.IP CXX_PREFIX
Prefix command for ${CXX}, for example, distcc or ccache.
.RI < Iu >
.RI [ "" ]
.IP CXXFLAGS
Additional flags to the compiler when creating C++ objects.
.RI < "Iu" >
.RI [ ${CFLAGS} ]
.IP CXXFLAGS_<project>
Similar to CXXFLAGS but for project ${PROJECTNAME}.
.RI < "U" >
.IP CPP
C Pre-Processor.
.RI < Iu >
.RI [ cpp ]
.IP CPPFLAGS
Additional flags to the C pre-processor.
.RI < "Iu" >
.IP CPPFLAGS_<project>
Similar to CPPFLAGS but for project ${PROJECTNAME}.
.RI < "U" >
.IP CPPFLAGS0
The same as CPPFLAGS but CPPFLAGS0 are passed to the compiler before CPPFLAGS.
Normally, CPPFLAGS0 should be modified in makefiles and should not
be set from environment by user.
.IP FC
Fortran compiler.
.RI < Iu >
.RI [ f77 ]
.IP FFLAGS
Options to {$FC}.
.RI < Iu >
.RI [ -O ]
.IP FFLAGS_<project>
Similar to FFLAGS but for project
.IR ${PROJECTNAME} .
.RI < "U" >
.IP INSTALL
install(1) command.
.RI < Iu >
.RI [ install " or " mkc_install ]
.IP LEX
Lexical analyzer.
.RI < Iu >
.RI [ lex ]
.IP LFLAGS
Options to ${LEX}.
.RI < Iu >
.RI [ "" ]
.IP LN
ln(1) tool.
.RI < Iu >
.RI [ ln ]
.IP LN_S
Tool equivalent to ln -s.
.RI < Iu >
.RI [ "${LN} -s" ]
.IP LPREFIX
Symbol prefix for ${LEX} (see -P option in lex(1)).
.RI < Iu >
.RI [ yy ]
.RI < Iu >
.RI [ yy ]
.IP LEXLIB
Object file for lex.
.RI < Iu >
.RI [ -ll ]
.IP LD
Linker.
.RI < Iu >
.RI [ ld ]
.IP LORDER
List dependencies for object files.
.RI < Iu >
.RI [ lorder ]
.IP MAKE
bmake(1).
.RI [ bmake " or " make " on NetBSD]"
.IP MAKEDEPEND
makedepend(1) tool.
.RI < Iu >
.IP MKDIR
mkdir(1) tool.
.RI < Iu >
.RI [ mkdir ]
.IP MKDEP
mkdep(1) tool.
.RI < Iu >
.IP NM
List symbols from object files.
.RI < Iu >
.RI [ nm ]
.IP PC
Pascal compiler.
.RI < Iu >
.RI [ pc ]
.IP PFLAGS
Options to ${PC}.
.RI < Iu >
.RI [ "" ]
.\" .IP OBJC
.\" Objective C compiler.  [${CC}]
.\" .IP OBJCFLAGS
.\" Options to ${OBJC}.  [${CFLAGS}]
.IP OBJCOPY
Copy and translate object files.
.RI < Iu >
.RI [ objcopy ]
.IP OBJDUMP
Display information from object files.
.RI < Iu >
.RI [ objdump ]
.IP RANLIB
Generate index to archive.
.RI < Iu >
.RI [ ranlib ]
.IP RM
rm(1) tool.
.RI < Iu >
.RI [ rm ]
.IP SIZE
List section sizes and total size.
.RI < Iu >
.RI [ size ]
.IP SRC_PATHADD
List of directories added to
.IR .PATH .
.RI < Im >
.RI [ "" ]
.IP STRIP
Discard symbols from object files.
.RI < Iu >
.RI [ strip ]
.IP STRIPFLAG
The flag passed to the install program to cause the binary
to be stripped.
.RI < Iu >
.IP TSORT
Topological sort of a directed graph.
.RI < Iu >
.RI [ "tsort -q" ]
.IP UNINSTALL
Command for removing files used by target "uninstall".
.RI < Iu >
.RI [ "${RM} -f" ]
.IP YACC
LALR(1) parser generator.
.RI < Iu >
.RI [ yacc ]
.IP TAR
tar archiver.
.RI < Iu >
.RI [ tar ]
.IP GZIP
gzip copression tool.
.RI < Iu >
.RI [ gzip ]
.IP BZIP2
bzip2 copression tool.
.RI < Iu >
.RI [ bzip2 ]
.IP ZIP
zip copression tool.
.RI < Iu >
.RI [ zip ]
.IP YFLAGS
Options to ${YACC}.
.RI < Iu >
.RI [ "" ]
.IP YHEADER
If defined, add "-d" to YFLAGS, and add dependencies
from <file>.y to <file>.h and <file>.c, and add
<foo>.h to CLEANFILES.
.IP YPREFIX
If defined, add "-p ${YPREFIX}" to YFLAGS.
.IP WARNERR
If "yes", force warnings to be reported as errors.
At the moment this is supported for GCC, Intel C/C++ and Sun's C/C++ compilers.
.RI < "Iu" >
.RI [ yes " if WARNS=4, " no " otherwise ]"
.IP WARNS
Crank up warning options; the distinct levels are (the higher the
more strict):
.VS
    WARNS=0
    WARNS=1
    WARNS=2
    WARNS=3
    WARNS=4
.VE
At the moment WARNS is supported for GCC and HP-UX C/C++ only.
WARNS=0 means disabling all warnings if such feature is provided by compiler
and mk-configure.
.RI < Mu >
.RI [ 0 ]
.IP PREFIX
Target directory.
.RI < "U" >
.RI [ /usr/local ]
.IP BINDIR
Target directory for utilities.
.RI < "Iu Mu" >
.RI [ ${PREFIX}/bin ]
.IP SBINDIR
Target directory for administration utilities.
.RI < "Iu" >
.RI [ ${PREFIX}/sbin ]
.IP LIBDIR
Target directory for libraries.
.RI < "Iu" >
.RI [ ${PREFIX}/lib ]
.IP LIBEXECDIR
Target directory for system utilities.
.RI < "Iu" >
.RI [ ${PREFIX}/libexec ]
.IP DATADIR
Target directory for architecture-independent text files.
.RI < "Iu" >
.RI [ ${PREFIX}/share ]
.IP SHAREDSTATEDIR
Target directory for modifiable architecture-independent data files.
.RI < "Iu" >
.RI [ ${PREFIX}/com ]
.IP VARDIR
Target directory for modifiable single-machine data files.
.RI < "Iu" >
.RI [ ${PREFIX}/var ]
.IP INCSDIR
Target directory for header files.
.RI < "Iu" >
.RI [ ${PREFIX}/include ]
.IP SYSCONFDIR
Target directory for configuration files.
.RI < "Iu" >
.RI [ ${PREFIX}/etc ]
.IP INFODIR
Target directory for .info files.
.RI < "Iu" >
.RI [ ${PREFIX}/info ]
.IP DESTDIR
Installation prefix.
.RI < "U" >
.RI [ "" ]
.IP MKC_ERR_MSG
If set, keep an error message.
.RI < "I M" >
.RI [ "" ]
.IP MKINSTALL
If not "yes", build everything but do not install. This option is useful
for e.g. internal libraries.
.RI < "Mu" >
.RI [ yes ]
.IP MKINSTALLDIRS
If "yes", install target directories (target
.IR installdirs )
before installing files (target 
.IR install ).
.RI < "Iu" >
.RI [ yes ]
.IP MKOBJDIR
If "yes", the target "obj" creates object directories, if "auto",
object directories are created automatically. Otherwise object
directories are not created.
.RI < "Iu" >
.RI [ auto ]
.IP BMAKE_REQD
Minimal required version of
.BR bmake .
If it is older,
.B mkcmake
exits with error.
.RI < "Im" >
.IP MKC_REQD
Minimal required version of
.BR mk-configure .
If required version is not found,
the target
.I errorcheck
fails.
.RI < "M" >
.IP MKC_VERSION
Version of
.IR mk-configure .
This variable is always set to non-empty value when mkc.*.mk include files are used,
so you can use it to initialize mk-c variables in mk.conf. For example:
.VS
@sysconfdir@/mk.conf:
   ...
   .ifdef MKC_VERSION
   COPTS?=      -O2 -Werror
   SHRTOUT=    yes
   .endif # MKC_VERSION
.VE
.RI < "I" >
.IP PROJECTNAME
The name of a project. By default it is set to ${PROG}, ${LIB} or ${.CURDIR:T}.
For a top-level project using either mkc.subdir.mk or mkc.subprj.mk
it makes sense to set this variable explicitely in project's Makefile.
This variable is initialized before including mk.conf, so you can use it
to change build options, e.g. during development process.
.VS
@sysconfdir@/mk.conf:
   ...
   .ifdef MKC_VERSION
   ...
   .if ${PROJECTNAME} == "foo"
   SHRTOUT=    yes
   PROG.gcc=   /usr/bin/gcc
   CC_TYPE=    gcc
   COPTS=      -O0 -g
   .endif
   .endif # MKC_VERSION
.VE
.RI < "Im" >
.IP CC_TYPE
C compiler type. This variable is set by
.B mk-configure
and can be overriden by user. It can get the following values:
.VS
Value     Description
----------------------
gcc       GNU C/C++ compiler
pcc       Portable C compiler
icc       Intel C/C++ compiler
msc       Microsoft C/C++ compiler
hpc       HP-UX C/C++ compiler
sunpro    SUNWspro C/C++ compiler
ibmc      IBM C/C++ compiler (Visual Age for C/C++?)
bcc       Borland C/C++ compiler
watcom    Watcom C/C++ compiler
como      COMO C/C++ compiler
decc      DEC C
mipspro   MIPSpro C compiler
.VE
.RI < "Iu" >
.IP CXX_TYPE
C++ compiler type. This variable is set by
.B mk-configure
and can be overriden by user. It can get the same values as CC_TYPE variable.
.RI < "Iu" >
.IP LD_TYPE
Linker type. This variable is set by
.B mk-configure
and can be overriden by user. It can get the following values:
.VS
Value        Description
----------------------
aixld        AIX linker
darwinld     Darwin linker (MacOS-X)
gnuld        GNU linker
hpld         HP-UX linker
interixld    Interix linker
scold        SCO linker
sunld        SunOS linker
osf1ld       OSF1 linker (Tru64)
irixld       IRIX linker
.VE
.RI < "Iu" >
.IP SHRTOUT
If not "no", output messages about compiling, linking and creating libraries
are shortened and formatted.
.RI < "Iu" >
.RI [ no ]
.IP "CFLAGS.warns.<cctype>.<warn-level>, CXXFLAGS.warns.<cxxtype>.<warn-level>"
These variables are set by mk-configure and enable warning messages
for C or C++ compilers according to their types (CC_TYPE and CXX_TYPE)
and warning level (WARNS).
.RI < "Iu" >
.IP "CFLAGS.dflt.<cctype>, CXXFLAGS.dflt.<cxxtype>"
Additional flags passed to
C or C++ compilers according to their types (CC_TYPE and CXX_TYPE).
.RI < "Iu" >
.IP "CFLAGS.pic, CXXFLAGS.pic"
Options for C and C++ compilers for generating position independent
code.  On some platforms it makes sense to override these variables
(initialized by mk-configure) for better performance, for example,
one may use -fpic instead of -fPIC with GNU C/C++ compilers.
See SHLIB_MAJOR, MKPIE etc. variables for more information.
.RI < "Iu" >
.IP "CFLAGS.pie, CXXFLAGS.pie"
Options for C and C++ compilers for generating position independent
executables.  On some platforms it makes sense to override these variables
(initialized by mk-configure) for better performance, for example,
one may use -fpic instead of -fPIC with GNU C/C++ compilers.
See MKPIE variable for more information.
.RI < "Iu" >
.IP "CFLAGS.ssp, CXXFLAGS.ssp"
Options for C and C++ compilers for generating stack protection code.
See USE_SSP variable for more information.
.RI < "Iu" >
.IP USE_SSP
If "yes", enables stack protection code, which detects stack overflows
and aborts the program. This enhances security but imposes some
performance penalty.
.RI < "U" >
.RI [ no ]
.IP SRCTOP
Top-level project's directory which
defaults to ${.CURDIR} if ${.MAKE.LEVEL} is 0.
If set, "../Makefile.inc"
is not included. Also, the following command
.br
   mkcmake -C subproject target
.br
will be translated to
.br
   cd ${SRCTOP}; mkcmake target-subproject
.RI < Iu >
.IP OBJTOP
Top-level object directory which
defaults to ${.OBJDIR} if ${.MAKE.LEVEL} is 0.
.RI < I >
.SS "mkc.files.mk"
The include file
.B mkc.files.mk
handles the FILES variable and is included
from
.BR mkc.lib.mk " and " mkc.prog.mk .
List of supported variables:
.IP FILES
The list of files to install.
.\" .IP CONFIGFILES Similar semantics to FILES, except that the files
.\"  are installed by the `configinstall' target,
.\"  not the `install' target.
.\"  The FILES* variables documented below also apply.
.RI < "M" >
.IP FILESDIR
The location to install the files.
.RI < "Mu" >
.RI [ ${PREFIX}/bin ]
.IP FILESDIR_<fn>
The location to install the specific file <fn>.
.RI < "Mu" >
.IP FILESOWN
File owner. If
.B bmake
is run with root privileges, it defaults to
.I ${BINOWN}
or to
.I "`id -u`"
otherwise.
.RI < "Mu" >
.IP FILESOWN_<fn>
File owner of the specific file <fn>.
.RI < "Mu" >
.IP FILESGRP
File group. If
.B bmake
is run with root privileges, it defaults to
.RI < "Mu" >
.I ${BINGRP}
or to
.I "`id -g`"
otherwise.
.RI < "Mu" >
.IP FILESGRP_<fn>
File group of the specific file <fn>.
.RI < "Mu" >
.IP FILESMODE
File mode.
.RI < "Mu" >
.RI [ ${NONBINMODE} ]
.IP FILESMODE_<fn>
File mode of the specific file <fn>.
.RI < "Mu" >
.IP FILESNAME
Optional name to install each file as.
.RI < "Mu" >
.IP FILESNAME_<fn>
Optional name to install <fn> as.
.RI < "Mu" >
.IP CLEANFILES
Additional files to remove for the
.IR clean ", " cleandir " and " distclean
targets.
.RI < "I M" >
.IP DISTCLEANFILES
Additional files to remove for the
.IR cleandir " and " distclean
targets.
.RI < "I M" >
.IP CLEANDIRS
Additional directories to remove (recursively) for the
.IR clean ", " cleandir " and " distclean
targets.
.RI < "I M" >
.IP DISTCLEANDIRS
Additional directories to remove (recursively) for the
.IR cleandir " and " distclean
targets.
.RI < "I M" >
.\" .IP FILESBUILD_<fn> A value different from "no" will add the file
 \" to the list of
.\" targets to be built by `realall'.  Users of that variable
.\" should provide a target to build the file.
.\" .IP BUILDSYMLINKS List of two word items:
.\" lnsrc lntgt
.\" For each lnsrc item, create a symlink named lntgt.
.\" The lntgt symlinks are removed by the cleandir target.
.\" .IP UUDECODE_FILES List of files which are stored as <file>.uue in
 \" the source
.\" tree. Each one will be decoded with ${TOOL_UUDECODE}.
.\" The source files have a `.uue' suffix, the generated files do 
.\" not.
.\" .IP UUDECODE_FILES_RENAME_<fn>
.\" Rename the output from the decode to the provided name.
.\" *NOTE: These files are simply decoded, with no install or other
.\" rule applying implicitly except being added to the clean
.\" target.
.SS "mkc.prog.mk"
The include file
.B mkc.prog.mk
handles building program from one or
more source files, along with their manual pages.  It has a limited
number of suffixes.
List of supported variables:
.IP PROG
The name of the program to build.
.IP PROGS
The names of the programs to build.  If neither PROG nor PROGS
is not supplied, nothing is built.
.\" .IP PROG_CXX
.\" If defined, the name of the program to build.  Also
.\" causes mkc.prog.mk to link the program with the C++
.\" compiler rather than the C compiler.  PROG_CXX overrides
.\" the value of PROG if PROG is also set.
.RI < "M" >
.IP PROGNAME
The name that the above program will be installed as, if
different from ${PROG}.
.RI < "M" >
.IP SRCS
List of source files to build the program.  If SRCS is not
 defined, it's assumed to be ${PROG}.c.
.RI < "M" >
.IP SRCS.<prog>
List of source files to build the program
.I prog
listed in
.IR PROGS .
If SRCS.<prog> is not defined, it's assumed to be prog.c.
.RI < "M" >
.IP LDADD
Additional objects.  Usually used for libraries.
For example, to link with the compatibility and utility
libraries, use:
.VS
    LDADD+=  -lutil -lcompat
.VE
.RI < "U" >
.IP LDADD_<project>
Similar to LDADD but for project ${PROJECTNAME}.
.IP LDADD0
The same as LDADD but LDFLAGS0 and LDADD0 are passed to the linker before LDFLAGS and LDADD.
.RI < "M" >
.IP LDFLAGS
Additional linker flags. Often used for specifying library directories.
.VS
    LDFLAGS+=  -L/opt/company/software/lib
.VE
.RI < "Mu I" >
.IP LDFLAGS_<project>
Similar to LDFLAGS but for project ${PROJECTNAME}.
.IP LDFLAGS0
The same as LDFLAGS but LDFLAGS0 and LDADD0 are passed to the linker before LDFLAGS and LDADD.
Normally, LDFLAGS0 and LDADD0 should be modified in makefiles and should not
be set from environment by user.
.RI < "M" >
.IP "BINDIR, BINMODE, BINOWN and BINGRP"
See
.IR "Common variables " and " mkc.files.mk"
sections.
.IP MKSHARE
If "no", act as "MKHTML=no MKINFO=no MKCATPAGES=no MKMAN=no".
I.e, don't build catman pages, man pages, info
documentation,...
.RI < "Iu" >
.RI [ yes ]
.IP MKPIE
If "yes", create Position Independent Executable (PIE), otherwise
create a regular executable.
.RI < "Mu" >
.RI [ no ]
.IP USE_RELRO
If "yes", enables a technique to harden the data sections of an ELF
binary/process.  For security reasons it makes sense to set it to YES, it
may slow down application startup, though.
.RI < "Iu" >
.RI [ no ]
.IP EXPORT_DYNAMIC
If "yes", add all symbols to the dynamic symbol table, that is make
all symbols visible from dynamic objects at run time (e.g. dlopen-ed
objects), otherwise only symbols referenced by some object file will
be exported.
.RI < "M" >
.RI [ no ]
.IP DPINCDIRS
See LIBDEPS in section
.BR mk.subprj.mk .
.IP DPLIBDIRS
See LIBDEPS in section
.BR mk.subprj.mk .
.IP DPLDADD
See LIBDEPS in section
.BR mk.subprj.mk .
.PP
.B mkc.prog.mk
includes
.B mkc.files.mk
and therefore supports all variables supported by it.
.SS "mkc.lib.mk"
The include file
.B mkc.lib.mk
has support for building a static and dynanic library or DLL.
.B mkc.lib.mk
uses the following variables:
.IP LIB
The name of the library to build.
.RI < "M" >
.IP LIBDIR
See
.IR "Common variables " and " mkc.files.mk"
sections.
.IP SHLIB_MAJOR
Major shared library number. If unset, shared library is not built.
.RI < "M" >
.IP SHLIB_MINOR
Minor shared library number.
.RI < "M" >
.RI [ 0 ]
.IP SHLIB_TEENY
Minor shared library number.
.RI < "M" >
.RI [ "" ]
.IP LIBOWN
Library owner. If
.B bmake
is run by an unprivileged user, it defaults to
.IR "`id -u`" .
.RI < "Iu" >
.IP LIBGRP
Library group. If
.B bmake
is run by an unprivileged user, it defaults to
.IR "`id -g`" .
.RI < "Iu" >
.IP LIBMODE
Library mode.
.RI < "Iu" >
.RI [ ${NONBINMODE} ]
.IP SHLIBMODE
Shared library mode.
.RI < "Iu" >
.IP "LDADD LDADD_<project>"
Additional objects. See
.B mkc.prog.mk
.IP "LDFLAGS LDFLAGS_<project>"
Additional linker flags. See
.B mkc.prog.mk
.IP MAN
The manual pages to be installed (use a .1 - .9 suffix).
.RI < "M" >
.IP SRCS
List of source files to build the library.  Suffix types
 .s, .c, and .f are supported.  Note, .s files are preferred
 to .c files of the same name.
.RI < "M" >
.\" (This is not the default for
.\"  versions of make.)
.\" LIBDPLIBS	A list of the tuples:
.\" 			libname  path-to-srcdir-of-libname
.\" 		For each tuple;
.\" 		     *	LIBDO.libname contains the .OBJDIR of the library
.\" 			`libname', and if it is not set it is determined
.\" 			from the srcdir and added to MAKEOVERRIDES (the
.\" 			latter is to allow for build time optimization).
.\" 		     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
.\" 		     *	DPADD gets  ${LIBDO.libname}/liblibname.so  or
.\" 				    ${LIBDO.libname}/liblibname.a   added.
.\" 		This variable may be used for individual libraries, as
.\" 		well as in parent directories to cache common libraries 
.\" 		as a build-time optimization.
.\" 
.\" The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
.\" if it exists, as well as the include file <bsd.man.mk>.
.\" 
.\" It has rules for building profiled objects; profiled libraries are
.\" built by default.
.IP MKSHLIB
If not "no", build and install shared library provided that SHLIB_MAJOR is defined.
.RI < "IMu" >
.RI [ yes ]
(for MACHINE_ARCHs that support it)
.IP MKSTATICLIB
If not "no", build and install static library.
.RI < "IMu" >
.RI [ yes ]
.IP MKPICLIB
If not "no", build and install *_pic.a library.
.RI < "IMu" >
.RI [ no ]
.IP MKPROFILELIB
If "no", don't build or install the profiling (*_p.a) libraries.
.RI < "Iu" >
.RI [ no ]
.IP MKDLL
If "yes", build and install the dynamically loaded library (<lib>.so)
instead of shared library. If "only", do not make static library.
.RI < "M" >
.RI [ no ]
.IP EXPORT_SYMBOLS
Only symbols listed in a specified file (one symbol per line) are
exported. This variable has no effect on some platforms.  By default
all symbols are exported.
.RI < "M" >
[]
.IP DPINCDIRS
See LIBDEPS in section
.BR mk.subprj.mk .
.IP DPLIBDIRS
See LIBDEPS in section
.BR mk.subprj.mk .
.IP DPLDADD
See LIBDEPS in section
.BR mk.subprj.mk .
.\" .IP "COPTS.lib<lib> OBJCCOPTS.lib<lib> LDADD.lib<lib> CPPFLAGS.lib<lib> CXXFLAGS.lib<lib>"
.\" These provide a way to specify additions to the associated
.\" variables in a way that applies only to a particular
.\" library.  <lib> corresponds to a LIB variable.
.\" For example, if COPTS.libfoobar is
.\" set to "-g", "-g" will be added to COPTS only when compiling
.\" the "libfoobar" library.
.PP
Libraries are ranlib'd when made.
.B mkc.lib.mk
includes
.B mkc.files.mk
and therefore supports all variables supported by it.
.SS "mkc.subprj.mk"
The include file
.B mkc.subprj.mk
handles subprojects (subdirectories)
organized as a dependency graph.
It provides all targets provided by
.BR mkc.prog.mk .
Variable SUBPRJ contains a list of pairs
.I depdir:dir
which mean that subproject
.I dir
depends on
.IR depdir.
.B mkcmake all
command will build all subprojects listed in SUBPRJ in a correct
order (starting with subprojects having no dependencies and so on).
There is also a target which allows the command
.I "bmake <subdir>"
where
<subdir>
is any directory listed in
the variable SUBPRJ.
The following targets are also provided:
<target>-<subdir>
where
<target>
is either of the following:
all, clean, cleandir, depend, installdirs, install, uninstall and filelist.
Also provided are: targets
nodeps-<target>-<subdir> and subdir-<target>-<subdir>.
Difference between
<target>-<subdir>
and
nodeps-<target>-<subdir>
is that 
.B "mkcmake <target>-<subdir>"
runs the specified
<target>
for
<subdir>
and all its dependencies while 
.B "mkcmake nodeps-<target>-<subdir>"
-- only for
<subdir>. A target subdir-<target>-<subdir> is a synonym for nodeps-<target>-<subdir>
See
.I examples/hello_dictd
subdirectory for the sample of use.
.P
.B mkc.subprj.mk
provides the following variables:
.IP SUBPRJ
List of subprojects (subdirectories) and dependencies. If the
subdirectory doesn't exist the subproject becomes "virtual" and may be
used to group several subprojects into a new virtual one.
.RI < "M" >
.IP LIBDEPS
A list of library dependencies. Each token is a colon-separated pair.
Its first component is a library subproject (dependency), the second
one is the subproject for library or executable. The value of this
variable is automatically added to SUBPRJ. Library dependencies listed
in LIBDEPS automatically change CPPFLAGS0, LDFLAGS0 and LDADD0 of
approptiate subprojects.
.RI < "M" >
Suppose, we have <library:program> pair in LIBDEPS, also suppose that variable
.B library
is set to "library" subdirectory and variable
.B program
is set to "program" subdirectory.
${SRCDIR_library}/linkme.mk file is automatically included from
${SRCDIR_program}/Makefile if it exists. In this file
.RI "DPLDADD [" "${library:T:S/^lib//}" "],"
.RI "DPLIBDIRS [" "${OBJDIR_${library:S,/,_,g}}" "] and"
.RI "DPINCDIRS [" "${SRCDIR_${library:S,/,_,g}} ${OBJDIR_${library:S,/,_,g}}" "],"
may be set to non-default values. These three variables then changes
LDADD0, LDFLAGS0 and CPPFLAGS0 respectively in subproject "program".
The dependency graph specified by variable LIBDEPS is available to all
subproject via environment.
.IP STATICLIBS
A list of subprojects (basenames) with static libraries. If dependency is
mentioned in this variable, the suffix _pic is automatically added
for PIE-executables or shared libraries that depend on this library.
This variable is automatically passed to subprojects via environment.
.RI < Mu >
.RI [ "" ]
.IP INTERNALLIBS
A list of subprojects (basenames) with internal libraries.
These libraries are static and not installed by target "install".
.RI < M >
.RI [ "" ]
.IP COMPATLIB
Subproject's basename for compatibility library.
If this variable is set, MKC_SOURCE_FUNCLIBS and FEATURES
do not change SRCS for subprojects other than ${COMPATLIB}.
.RI < M >
.RI [ "" ]
.IP SUBPRJ_DFLT
List of projects built and installed by default.
The default is all projects listed in SUBPRJ.
.RI < "IMu" >
.IP EXPORT_VARNAMES
List of variables to export before running make for subdirectories.
.RI < "Mu" >
.RI [ MKC_CACHEDIR ] 
.IP NOEXPORT_VARNAMES
List of variables excluded from EXPORT_VARNAMES.
.RI < "Mu" >
.RI [ "" ]
.IP NODEPS
This variable specifies a list of patterns that describes edges from dependency
graph in
.IR targdep-prjdep : targ-prj
or
.IR targ-prj : targ
formats to be excluded from dependency graph.
.RI < "M" >
.RI []
.IP NOSUBDIR
If for some reason you want to exclude some subdirectories from build,
list them in this variable.
.RI < "U" >
.RI [ "" ]
.IP OBJDIR_<dir>
Value of ${.OBJDIR} inside 
.I dir
subdirectory. Slash symbols inside <dir> are replaced with underlines.
In addition, OBJDIR_<dir:T> variable is set to ${OBJDIR_<dir>}
if ${SHORTPRJNAME} is "yes".
.IP SRCDIR_<dir>
Value of ${.CURDIR} inside 
.I dir
subdirectory. Slash symbols inside <dir> are replaced with underlines.
In addition, SRCDIR_<dir:T> variable is set to ${SRCDIR_<dir>}
if ${SHORTPRJNAME} is "yes".
.IP TARGETS
A list of recursive targets. "Recursive" means that the target will be called
for all subproject recursively (See 
.BR mkc.subprj.mk " and " mkc.subdir.mk ).
.RI < "Im" >
.RI [ all ", " install ", " installdirs ", " uninstall ", " clean ", "
.IR cleandir ", " depends ", " test ", " errorcheck ", " filelist ", " obj ]
By setting this variable in the Makefile one can add new targets for special
purposes, for example, static code analysis, partial builds etc.
.IP ALLTARGETS
A list of targets for which pre\_*, do_* and post\_* counterparts exist, for example,
pre\_all, do\_all and post\_all. pre\_* target runs before do\_* target which in turn
runs before post\_*. Unless action is provided for do\_* targets
they implement the standard behaviour of
.BR mk-configure .
No action is provided for targets pre\_* and post\_*, so they are
for user's extensions. The standard behaviour for ${ALLTARGETS}
may also be extended by adding new prerequisites
to targets do\_*.
.IP SHORTPRJNAME
If "yes", special targets with last component of the subprojects are provided.
.RI < "Im" >
.RI [ yes ]
.IP MKRELOBJDIR
If "yes", object directories
.RI ${OBJTOP}/ dir
are used. Unlike MAKEOBJDIRPREFIX object directories do not contain
top-level ${.CURDIR} in paths.
.RI < "Iu" >
.RI [ no ]
.IP SUBPRJSRCTOP
This variables contains ${.CURDIR} directory and is passed to subprojects.
.RI < "I" >
.RI [ ${.CURDIR} ]
.P
.B mkc.subprj.mk
provides the following targets:
.IP "<subdir> and <subdir:T>"
<subdir> is a subdirectory listed in SUBDIR or SUBPRJ.
This target is equivalent to all-<subdir>.
<subdir:T> means the last component of the directory
and is created if ${SHORTPRJNAME} is "yes".
.IP <target>-<subdir>
Runs the specified <target> for the specified <subdir>.
The target <target>-<subdir:T> is provided
if ${SHORTPRJNAME} is "yes".
.IP "subdir-<target>-<subdir> and nodeps-<target>-<subdir>"
Runs the specified <target> for the specified <subdir> without dependencies.
Targets subdir-<target>-<subdir:T>
and nodeps-<target>-<subdir:T> are provided
if ${SHORTPRJNAME} is "yes".
.IP print_deps
Outputs the dependency graph on targets in tsort(1) format
taking NODEPS and NOSUBDIR variables into account.
.SS "mkc.subdir.mk"
The include file
.B mkc.subdir.mk
contains the default targets for building
subdirectories.
It provides the same targets as
.BR mkc.prog.mk .
For all of
the directories listed in the variable SUBDIR, the specified directory 
will be visited and the target made.  There is also a default target which
allows the command
.I "bmake <subdir>"
where
.I "<subdir>"
 is any directory listed in
the variable SUBDIR.
As a special case, the use of a token .WAIT
as an entry in SUBDIR acts
as a synchronization barrier when multiple make jobs are run; subdirs
before the .WAIT
must complete before any subdirs after .WAIT are
started.  See
.B bmake(1)
for some caveats on use of .WAIT and other
special sources. SUBDIR variable is provided as well as all variables provided
by mkc.subprj.mk except SUBPRJ.
.IP SUBDIR
List of subdirectories
.RI < "M" >
.B mkc.subprj.mk
.SS "mkc.configure.mk"
.B mkc.configure.mk
is an auxiliary include file for checking platform's features
like headers, function or variable declarations, function implementation
in a particular libraries, data types sizes etc.
This include file is included by
.BR mkc.prog.mk " and " mkc.lib.mk
automatically
but in some cases it makes sense to include it explicitly.
.B mkc.configure.mk
supports the following variables.
.IP MKCHECKS
If "no", none of the checks are performed. It is set to "yes" unless target
is "clean", "cleandir or distclean".
.IP MKC_CHECK_HEADERS
List of headers to be checked.
As a result of the check bmake's variable
.B HAVE_HEADER.<header>
is set to
either 0 or 1.
.br
<header>: tr|./|__|g
.br
Also -DHAVE_HEADER_<HEADER>=(0 or 1)
is added to CFLAGS unless MKC_NOAUTO is set to 1.
.br
<HEADER>: tr|a-z./|A-Z__|g
.VS
 Ex:  MKC_CHECK_HEADERS += sys/time.h fcntl.h execinfo.h
 Res: HAVE_HEADER.sys_time_h = 1
      HAVE_HEADER.fcntl_h    = 1
      HAVE_HEADER.execinfo_h = 1
      CFLAGS += -DHAVE_HEADER_SYS_TIME_H=1 -DHAVE_HEADER_FCNTL=1
.VE
.IP MKC_REQUIRE_HEADERS
The same as MKC_CHECK_HEADERS, but absense of header is
treated as a fatal error (See
.B errorcheck
target.
.IP MKC_CHECK_FUNCLIBS
List of <function>:<library> pairs to be checked,
<library> part is optional. If <library> is present,
presense of <function> in libc is also checked automatically.

As a result of the check bmake's variable
HAVE_FUNCLIB.<function>.<library> (or HAVE_FUNCLIB.<function>)
is set to either 0 or 1.

By default, if <function> is found in <library> but not in libc,
"-l<library>" is automatically added to LDADD unless
<function>:<library> is listed in MKC_NOAUTO_FUNCLIBS or
MKC_NOAUTO_FUNCLIBS is equal to 1 or
MKC_NOAUTO is set to 1
.VS
 Ex:  MKC_CHECK_FUNCLIBS  += strlcat fgetln getline getopt_long
      MKC_CHECK_FUNCLIBS  += crypt:crypt dlopen:dl nanosleep:rt
      MKC_CHECK_FUNCLIBS  += ftime:compat gettimeofday
      MKC_NOAUTO_FUNCLIBS += ftime:compat
 Res: HAVE_FUNCLIB.strlcat      = 1
      HAVE_FUNCLIB.fgetln       = 1
      HAVE_FUNCLIB.getline      = 0
      HAVE_FUNCLIB.getopt_long  = 1
      HAVE_FUNCLIB.crypt        = 0
      HAVE_FUNCLIB.crypt.crypt  = 1
      HAVE_FUNCLIB.dlopen       = 1
      HAVE_FUNCLIB.dlopen.dl    = 0
      HAVE_FUNCLIB.nanosleep    = 1
      HAVE_FUNCLIB.nanosleep.rt = 1
      HAVE_FUNCLIB.ftime        = 0
      HAVE_FUNCLIB.ftime.compat = 1
      HAVE_FUNCLIB.gettimeofday = 1
      LDADD += -lcrypt
.VE
.IP MKC_REQUIRE_FUNCLIBS
The same as MKC_CHECK_FUNCLIBS, but absense of funclib is
treated as a fatal error (See
.B errorcheck
target.
.IP MKC_SOURCE_FUNCLIBS
The same as MKC_CHECK_FUNCLIBS, but if <function> is absent
both in the specified <library> and in libc, function.c is
added to SRCS unless MKC_NOAUTO=1.
.VS
 Ex:  MKC_SOURCE_FUNCLIBS+= getline
 Res: SRCS+= getline.c
      HAVE_FUNCLIB.getline= 0
.VE
.IP "MKC_SOURCE_DIR, MKC_SOURCE_DIR.<source>"
Directory with sources for MKC_SOURCE_FUNCLIBS. If MKC_SOURCE_DIR.<source> is unset,
MKC_SOURCE_DIR is used that defaults to ${.CURDIR}.
.VS
 Ex:  MKC_SOURCE_FUNCLIBS += getline
      MKC_SOURCE_DIR.getline.c = ${.CURDIR}/../missing
 Res: SRCS+= ${.CURDIR}/../missing/getline.c
      HAVE_FUNCLIB.getline= 0
.VE
.IP MKC_CHECK_DEFINES
List of define:header to check. <header> part is optional.

As a result of the check bmake's variable
HAVE_DEFINE.<define>.<header> (or HAVE_DEFINE.<define>)
is set to either 0 or 1.
.br
<header>: tr|./|__|g
.br
Also -DHAVE_DEFINE_<DEFINE>_<HEADER>=1
or   -DHAVE_DEFINE_<DEFINE>=1
is added to CFLAGS if the specified define was detected
unless MKC_NOAUTO is set to 1.
.br
<HEADER>: tr|a-z./|A-Z__|g
.br
<DEFINE>: tr|a-z|A-Z|g
.VS
 Ex:  MKC_CHECK_DEFINES += RTLD_LAZY:dlfcn.h __GNUC__ _MSC_VER_
 Res: HAVE_DEFINE.RTLD_LAZY.dlfcn_h = 1
      HAVE_DEFINE.__GNUC__          = 1
      HAVE_DEFINE._MSC_VER_         = 0
      CFLAGS += -DHAVE_DEFINE_RTLD_LAZY_DLFCN_H=1 \\
                -DHAVE_DEFINE___GNUC__=1
.VE
.IP MKC_REQUIRE_DEFINES
The same as MKC_CHECK_DEFINES, but absense of the define is
treated as a fatal error (See
.B errorcheck
target.
.IP MKC_CHECK_TYPES
List of type:header to check. <header> part is optional.

As a result of the check bmake's variable
HAVE_TYPE.<type>.<header> (or HAVE_TYPE.<type>)
is set to either 0 or 1.
.br
<header>: tr|./|__|g

Also -DHAVE_TYPE_<TYPE>_<HEADER>=1 (or   -DHAVE_TYPE_<TYPE>=1)
is added to CFLAGS if the specified type was detected
unless MKC_NOAUTO is set to 1.
.br
<HEADER>: tr|a-z./|A-Z__|g
.br
<TYPE>:   tr|a-z|A-Z|g
.VS
 Ex:  MKC_CHECK_TYPES += size_t:string.h
 Res: HAVE_TYPE.size_t.string_h = 1
      CFLAGS += -DHAVE_TYPE_SIZE_T_STRING_H=1
.VE
.IP MKC_REQUIRE_TYPES
The same as MKC_CHECK_TYPES, but absense of the type declaration is
treated as a fatal error (See
.B errorcheck
target.
.IP MKC_CHECK_VARS
List of variable:header to check. <header> part is optional.
       
As a result of the check bmake's variable
HAVE_DEFINE.<variable>.<header> (or HAVE_DEFINE.<variable>)
is set to either 0 or 1
.br
<header>: tr|./|__|g
.br
Also -DHAVE_DEFINE_<VARIABLE>_<HEADER>=1
(or -DHAVE_DEFINE_<VARIABLE>=1)
is added to CFLAGS if the specified variable was detected
unless MKC_NOAUTO is set to 1.
.br
<HEADER>: tr|a-z./|A-Z__|g
.VS
 Ex:  MKC_CHECK_VARS += sys_errlist:errno.h
 Res: HAVE_VAR.sys_errlist.errno_h = 1
      CFLAGS += -DHAVE_VAR_SYS_ERRLIST_ERRNO_H
.VE
.IP MKC_REQUIRE_VARS
The same as MKC_CHECK_VARS, but absense of the variable declaration is
treated as a fatal error (See
.B errorcheck
target.
.IP MKC_CHECK_MEMBERS
List of <type>.<member>:<header> to check.
<header> part is optional.

As a result of the check bmake's variable
HAVE_MEMBER.<type>_<member>.<header>
(or HAVE_MEMBER.<type>_<member>)
is set to either 0 or 1 depending on the result.
.br
<header>: tr|./|__|g
.br
Also -DHAVE_MEMBER_<TYPE>_<MEMBER>_<HEADER>=1
(or   -DHAVE_MEMBER_<TYPE>_<MEMBER>=1)
is added to CFLAGS if the specified member was found in
appropriate type
unless MKC_NOAUTO is set to 1.
.br
<HEADER>: tr|a-z./|A-Z__|g
.br
<TYPE>:   tr|a-z./|A-Z__|g
.br
<MEMBER>: tr|a-z./|A-Z__|g
.VS
   Ex:  MKC_CHECK_VARS += struct-ifreq.ifr_ifrn.ifrn_name:net/if.h
        MKC_CHECK_VARS += struct-tm.tm_isdst:time.h
   Res: HAVE_MEMBER.struct_ifreq_ifr_ifrn_ifrn_name.net_if_h=1
        HAVE_MEMBER.struct_tm_tm_isdst.time_h=1
        CFLAGS += -DHAVE_MEMBER_STRUCT_IFREQ_IFR_IFRN_IFRN_NAME_NET_IF_H=1
        CFLAGS += -DHAVE_MEMBER_STRUCT_TM_TM_ISDST_TIME_H=1
.VE
.IP MKC_REQUIRE_MEMBERS
The same as MKC_CHECK_MEMBERS, but absense of the member is
treated as a fatal error (See
.B errorcheck
target.
.IP MKC_CHECK_FUNCS<N>
List of <func>:<header> to be check. <header> part is optional.
Here <N> means the number of arguments.
As a result of the check bmake's variable
HAVE_FUNC<N>.<func>.<header> (or HAVE_FUNC<N>.<func>)
is set to either 0 or 1.
.br
<header>: tr|./|__|g
.br
Also -DHAVE_FUNC<N>_<FUNC>_<HEADER>=(0 or 1)
(or   -DHAVE_FUNC<N>_<FUNC>=(0 or 1))
is added to CFLAGS if the specified function was detected
unless MKC_NOAUTO is set to 1.
.br
<HEADER>: tr|a-z./|A-Z__|g
.VS
 Ex:  MKC_CHECK_FUNCS2 += fgetln:stdio.h
      MKC_CHECK_FUNCS6 += pselect:sys/select.h
 Res: HAVE_FUNC2.fgetln.stdio_h = 1
      HAVE_FUNC6.pselect.sys.select_h = 1
      CFLAGS += -DHAVE_FUNC2_FGETLN_STDIO_H=1 \\
             += -DHAVE_FUNC6_PSELECT_SYS_SELECT_H=1
.VE
.IP MKC_REQUIRE_FUNCS<N>
The same as MKC_CHECK_FUNCS<N>, but absense of the function declaration is
treated as a fatal error (See
.B errorcheck
target.
.IP MKC_CHECK_CUSTOM
A list of custom checks (list of names).
MKC_CUSTOM_FN.<custom_check_name> is a
"C", "C++" or "Fortran" source filename or an executable program
for your custom check,
e.g., filename.c, filename.cc, subdir/filename.cxx, filename.C,
filename.cpp, mychecks/filename.f or subdir/executable_script.
.B mk-configure
tries to compile or run the specified file and sets
CUSTOM.<custom_check_name> variable to 1, 0 or other value.
If MKC_CUSTOM_FN.<custom_check_name> is unset, it
defaults to custom_check_name.c

Also -DCUSTOM_<CUSTOM_CHECK_NAME>=1
is added to CFLAGS if the specified check succeeded
unless MKC_NOAUTO is set to 1.
.br
<CUSTOM_CHECK_NAME>: tr|a-z|A-Z|g
.VS
 Ex.  MKC_CHECK_CUSTOM+=               nested_funcs
      MKC_CUSTOM_FN.nested_funcs=      nested_funcs.c
      MKC_CUSTOM_FN.script_check=      checks/script_check
 Res. CUSTOM.nested_funcs=        1
      CUSTOM.script_check=        0
      CFLAGS+= -DCUSTOM_NESTED_FUNCS=1
.VE
Note that script for the check should be an executable file.
.IP MKC_REQUIRE_CUSTOM
The same as MKC_CHECK_CUSTOM, but failure is
treated as a fatal error (See
.B errorcheck
target. 0 and empty value of CUSTOM.xxx means failure.
.IP MKC_CUSTOM_DIR
Directory with custom checks source files.
See MKC_CHECK_CUSTOM. It defaults to ${.CURDIR}.
.IP MKC_CHECK_BUILTINS
.B mk-configure
provides a number of built-in custom checks, that is, source files
to compile or scripts to run in order to check for something.
Checks listed in MKC_CHECK_BUILTINS will be run.
.RS
Avalable values:
.TP
.BR prog_flex ", " prog_bison ", " prog_gawk ", " prog_gm4 ", " prog_gmake
Find flex, bison, GNU awk, GNU m4 or GNU make respectively
by analysing program's help and/or
version messages. If found, BUILTIN.prog_<progname> is set to the path,
otherwise it is set to empty string. Note that
.I gawk
may be found as
.IR awk ,
.I bison
as
.IR yacc ,
.I gm4
as
.IR m4 ,
.I flex
as
.IR lex " and"
.I gmake
as
.IR make .
.TP
.BR prog_mkdep ", " prog_nbmkdep
Find traditional BSD mkdep(1) or recent NetBSD version of it respectively.
.TP
.B endianness
BUILTIN.endianness variable is set to either
.IR little ", " big " or " unknown
depending on a hardware.
.RE
.IP MKC_CHECK_PROGS
List of <progname>s to check.
As a result of the check bmake's variable
HAVE_PROG.<progname> is set to either 1 (true) or 0 (false).
Also PROG.<progname> is set to a full path of a program
or to an empty string.
.VS
 Ex:  MKC_CHECK_PROGS += lua ruby gawk runawk
 Res: HAVE_PROG.lua             = 1
      PROG.lua                  = /usr/pkg/bin/lua
      HAVE_PROG.ruby            = 0
      HAVE_PROG.gawk            = 1
      PROG.gawk                 = /usr/bin/gawk
      HAVE_PROG.runawk          = 1
      PROG.runawk               = /usr/pkg/bin/runawk
.VE
If MKC_PROG.id.<progname> is set to, e.g, <prog_id>,
then HAVE_PROG.<prog_id> and PROG.<prog_id> are set.
MKC_PROG.id.<progname> also changes cache file names.
.IP MKC_REQUIRE_PROGS
The same as MKC_CHECK_PROGS, but absense of program is
treated as a fatal error (See
.B errorcheck
target).
.IP MKC_CHECK_SIZEOF
List of <type>:<header> to check. <header> part is optional.

As a result of the check bmake's variable
SIZEOF.<type>.<header> (or SIZEOF.<type>)
is set to the data type size or string "failed".
.br
<type>: tr|*-|P_|g
.br
<header>: tr|/.|__|g
.br
Also -DSIZEOF_<TYPE>_<HEADER>=<failed|1|2|...>
(or -DSIZEOF_<TYPE>=<failed|1|2|...>)
is added to CFLAGS
if sizeof() check was successful
unless MKC_NOAUTO is set to 1
.br
<TYPE>: tr|a-z*-|A-ZP_|g
.br
<HEADER>: tr|a-z/.|A-Z__|g
.br
.VS
 Ex:  MKC_CHECK_SIZEOF += void*
      MKC_CHECK_SIZEOF += long-long off_t:sys/types.h
 Res: SIZEOF.voidP             = 4
      SIZEOF.long_long         = 4
      SIZEOF.off_t.sys_types_h = 8
      CFLAGS += -DSIZEOF_VOIDP=4 \\
                -DSIZEOF_LONG_LONG=4 \\
                -DSIZEOF_OFF_T_SYS_TYPES_H=8
.VE
.IP MKC_CHECK_PROTOTYPES
A list of checks (list of names) for C function prototypes.
MKC_PROTOTYPE_FUNC.<name> is a C function prototype.
MKC_PROTOTYPE_HEADERS.<name> is a list of headers to #include.
mk-configure verifies that the specified prototype is correct and if
so, HAVE_PROTOTYPE.<name> bmake variable is set to 1 and
-DHAVE_PROTOTYPE_<NAME>=1 is added to CFLAGS unless MKC_NOAUTO is set to 1.
Otherwise, HAVE_PROTOTYPE.<name> variable is set to 0.
.VS
Ex.
  MKC_CHECK_PROTOTYPES = posix_iconv const_iconv
  MKC_PROTOTYPE_FUNC.posix_iconv = \ 
    size_t iconv(iconv_t,char**,size_t*,char**,size_t*)
  MKC_PROTOTYPE_FUNC.const_iconv = \ 
    size_t iconv(iconv_t,const char**,size_t*,char**,size_t*)
  MKC_PROTOTYPE_HEADERS.posix_iconv = iconv.h
  MKC_PROTOTYPE_HEADERS.const_iconv = iconv.h
Res.
 HAVE_PROTOTYPE.posix_iconv=0
 HAVE_PROTOTYPE.const_iconv=1
 CFLAGS += -DHAVE_PROTOTYPE_CONST_ICONV=1
.VE
.IP MKC_REQUIRE_PROTOTYPES
The same as MKC_CHECK_PROTOTYPES, but incorrect prototype is
treated as a fatal error (See
.B errorcheck
target.
.IP MKC_NOAUTO_FUNCLIBS
See MKC_CHECK_FUNCLIBS
.IP MKC_NOAUTO
See MKC_CHECK_{HEADERS,FUNCLIBS,FUNCS,VARS,DEFINES,SIZEOF}.
.IP MKC_COMMON_HEADERS
List of header files always #include'd to the test .c file
in MKC_CHECK_{DEFINES,VARS,FUNCS<N>,SIZEOF} checks.
The default value is an empty list.
.VS
  Ex: MKC_COMMON_HEADERS += unistd.h stdlib stdio.h string.h
      MKC_CHECK_SIZEOF   += offs_t size_t ssize_t
.VE
.IP MKC_COMMON_DEFINES
List of defines always passed to compiler
in MKC_CHECK_{DEFINES,VARS,FUNCS<N>,SIZEOF} checks.
.VS
   Ex: MKC_COMMON_DEFINES += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 # Linux
       MKC_COMMON_DEFINES += -D_ALL_SOURCE # Interix
.VE
.IP MKC_COMMON_DEFINES.<OPSYS>
The same as MKC_COMMON_DEFINES but only for OPSYS (uname -s).
.VS
   Ex: MKC_COMMON_DEFINES.Linux   += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
       MKC_COMMON_DEFINES.Interix += -D_ALL_SOURCE
.VE
.IP MKC_CACHEDIR
Directory where intermediate and cache files are created.
It defaults to ${.OBJDIR}.
By default MKC_CACHEDIR variable is exported for subprojects.
As a result cache files
for subprojects are created in the top-level directory.
If cache directory doesn't exist, it is created automatically.
.IP MKC_SHOW_CACHED
Setting it to 0 will hide
.VS
   Checking ... (cached) ...
.VE
messages, that is, messages about fetching results from cache files.
.IP MKC_DELETE_TMPFILES
If set to 1, temporary files are removed.
.IP MKC_NOCACHE
All results are cached unless MKC_NOCACHE variable is set
non-empty value
.IP MKC_FEATURES
This is a list of "features" required by project. In general, a feature
is something that has problems with portability. This may be a
function name or header missing on some platforms, for example.
What developer
needs to do is to add FEATURENAME to MKC_FEATURES variable and add
#include <mkc_FEATURENAME.h> where it is needed. Internally, system
requiremets are checked in the automatically included
mkc_imp.f_FEATURENAME.mk
file and all required actions (includes, define checks etc.)
are made in mkc_FEATURENAME.h header file.
Currently the following features are provided:
.RS
.TP
.B strlcat
This feature corresponds to strlcat(3) function available on almost
all systems except glibc-based Linux-es. mkc_imp.f_strlcat.mk checks
whether strlcat declaration is available in string.h and
implementation is available in libc. If not, strlcat.c provided by
mk-configure is added to SRCS and declaration is provided in
mkc_strlcat.h header.
.TP
.B strlcpy
Similar to strlcat.
.TP
.B getline
This feature corresponds to getline(3) function which is a part of POSIX2008
unavailable on some
systems. mkc_imp.f_getline.mk checks
whether getline declaration is available in stdio.h and
implementation is available in libc. If not, getline.c provided by
mk-configure is added to SRCS and declaration is provided in
mkc_getline.h header.
.TP
.B progname
This feature provides getprogname(3) and setprogname(3) functions
available in *BSD.
.TP
.B fgetln
This feature provides fgetln(3) BSD-ism.
.TP
.B err
This feature provides err(3), errx(3), verr(3) and verrx(3) BSD-isms.
.TP
.B warn
This feature provides warn(3), warnx(3), vwarn(3) and vwarnx(3) BSD-isms.
.TP
.B libm
This feature checks whether libm is available and if yes, adds -lm to
LDADD.  Most UNIX-like systems have libm but Haiku, for example, does
not. mkc_imp.f_libm.mk checks whether libm library is available and if yes,
-lm is added to LDADD.
.TP
.B libdl
This feature checks whether libdl library is available and dlopen(3)
is declared in dlfcn.h.  If yes, -ldl is added to LDADD. mkc_libdl.h
provides declarations for dlopen(3), dlsym(3), dlclose(3) etc.
.TP
.B "RB SPLAY"
BSD systems provide sys/tree.h header where RB_* and SPLAY_* macroses
are defined for red-black tree and splay. These features check whether
sys/tree.h and appropriate macroses are available. If yes, mkc_RB.h
and mkc_SPLAY.h include system-wide sys/tree.h, otherwise NetBSD
version of sys/tree.h provided by mk-configure is included.
.TP
.B "SLIST SIMPLEQ STAILQ LIST TAILQ CIRCLEQ"
BSD systems provide sys/queue.h header where SLIST_* etc. macroses are
defined for lists and queues. These features check whether sys/queue.h
and appropriate macroses are available. If yes, mkc_SLIST.h and others
include system-wide sys/queue.h, otherwise NetBSD version of
sys/queue.h provided by mk-configure is included.
.RE
.SS mkc_imp.scripts.mk
is internal include file which is included from
.BR mkc.prog.mk ", " mkc.lib.mk " and " mkc.files.mk .
Do not use it directly!
It provides installing and uninstalling the scripts.
The following variables are provided:
.IP SCRIPTS
A list of interpreter scripts (written in shell, awk, lua etc).
These are installed like programs.
.RI < "M" >
.IP SCRIPTSNAME
The name that the above program will be installed as, if
different from ${SCRIPTS}.
.RI < "Mu" >
.IP SCRIPTSNAME_<script>
Optional name to install <script> as. If <script> has a form
<subdir>/<filename>, SCRIPTSNAME_<subdir>_<filename> is used.
.RI < "Mu" >
.IP SCRIPTSDIR
Target directory for scripts.
.RI < "Iu" >
.RI [ ${BINDIR} ]
.IP SCRIPTSDIR_<script>
Optional directory to install <script> to. If <script> has a form
<subdir>/<filename>, SCRIPTSDIR_<subdir>_<filename> is used.
.RI < "Mu" >
.IP SCRIPTSOWN
Script files owner.
.RI < "Iu" >
.RI [ ${BINOWN} ]
.IP SCRIPTSGRP
Script file group.
.RI < "Iu" >
.RI [ ${BINGRP} ]
.IP SCRIPTSMODE
Script file mode.
.RI < "Iu" >
.RI [ ${BINMODE} ]
.SS "mkc_imp.lua.mk"
.B mkc_imp.lua.mk
is internal include file which is included from
.BR mkc.prog.mk " and " mkc.lib.mk .
Do not use it directly.
It provides support for Lua programming language, i.e. building and installing
Lua- and/or C-based modules.
The following variables are provided:
.IP LUA_MODULES
List of Lua modules to build and install.
Dot in the module name separates a dirname from basename. That is,
actual .lua file names are made of LUA_MODULES with dots replaced with undeline symbol.
At installation time dots are replaced with slash. For example, if
LUA_MODULES=socket.foo, then socket_foo.lua will be installed to
${LUA_LMODDIR}/socket/foo.lua
.RI < "M" >
.\" .IP LUA_SRCS.<mod>
.\" Sources for each module
.\" .RI [ ${mod:S/./_/g}.lua ]
.\" .RI < M >
.IP LUA_LMODULES
Deprecated. Filenames of Lua modules. Use
.I LUA_MODULES
instead.
.RI < "M" >
.IP LUA_CMODULE
Compiled Lua module written in, e.g., C or C++.
Dot in the module name separates a dirname from basename. That is,
actual .c file names are made of LUA_MODULES with dots replaced with undeline symbol.
At installation time dots are replaced with slash. For example, if
LUA_CMODULES=socket.foo, then socket_foo.c will be used for compiling a module and
will be installed to ${LUA_CMODDIR}/socket/foo.so.
.RI < "M" >
.IP SRCS
List of source files to build the LUA_CMODULE. 
SRCS defaults to 
.IR ${LUA_CMODULE:S|.|_|g}.c .
.RI < "M" >
.IP LUA_LMODDIR
Directory for Lua modules written in Lua. It is assigned
with a help of
.I "pkg-config --variable=INSTALL_LMOD lua"
command and can be overriden by user.
.RI < "Iu" >
.IP LUA_CMODDIR
Directory for compiled Lua modules written in, e.g., C or C++.
It is assigned with a help of
.I "pkg-config --variable=INSTALL_CMOD lua"
command and can be overriden by user.
.RI < "Iu" >
.SS "mkc_imp.intexts.mk"
.B mkc_imp.intexts.mk
is internal include file which is included from
.BR mkc.prog.mk ", " mkc.lib.mk " and " mkc.files.mk .
Do not use it directly.
It provides conversion of <fn>.in files to <fn> by
expanding the following @@ patterns:
.\" .TS
.\" tab(:), center, box;
.\" c | c
.\" l | l.
.\" Pattern:Result
.\" _
.\" @prefix@:${PREFIX}
.\" @bindir@:${BINDIR}
.\" @mandir@:${MANDIR}
.\" @sbindir@:${SBINDIR}
.\" @libdir@:${LIBDIR}
.\" @libexecdir@:${LIBEXECDIR}
.\" @datadir@:${DATADIR}
.\" @sysconfdir@:${SYSCONFDIR}
.\" @incsdir@:${INCSDIR}
.\" .TE
.ne 11
.VS
 Pattern       Result
----------------------
.RI @ "" "prefix@       ${PREFIX}"
.RI @ "" "bindir@       ${BINDIR}"
.RI @ "" "mandir@       ${MANDIR}"
.RI @ "" "sbindir@      ${SBINDIR}"
.RI @ "" "libdir@       ${LIBDIR}"
.RI @ "" "libexecdir@   ${LIBEXECDIR}"
.RI @ "" "datadir@      ${DATADIR}"
.RI @ "" "sysconfdir@   ${SYSCONFDIR}"
.RI @ "" "incsdir@      ${INCSDIR}"
.RI @ "" "vardir@       ${VARDIR}"
.RI @ "" "sharedstate@  ${SHAREDSTATEDIR}"
.VE
The following variables are provided:
.IP INFILES
List of files to generate.
.RI < "M" >
.IP INSCRIPTS
List of scripts to generate.
.RI < "M" >
.IP INTEXTS_REPLS
List of Pattern/Replacement pairs separated by space, e.g.
.VS
    INTEXTS_REPLS+=   version ${VERSION}
    INTEXTS_REPLS+=   author_email ${AUTHOR_EMAIL}
.VE
.RI < "M" >
.IP INTEXTS_SED
List of additional
.B sed(1)
expressions for expanding, e.g.
.VS
    INTEXTS_SED+=   -e 's,@version@,${VERSION},g'
.VE
.RI < "M" >
.SS "mkc_imp.info.mk"
.B mkc_imp.info.mk
is internal include file which is included from
.BR mkc.prog.mk ", " mkc.lib.mk " and " mkc.files.mk .
Do not use it directly!
This module provides creation of .info files from .txi, .texi and .texinfo sources
and provides the following variables:
.IP MKINFO
If "no", don't build or install Info documentation from
Texinfo source files.
.RI < "Iu" >
.RI [ yes ]
.IP TEXINFO
List of Texinfo source files.  Info documentation will
consist of single files with the extension replaced by .info.
.RI < "M" >
.IP INFOFLAGS
Flags to pass to makeinfo. []
.RI < "Iu" >
.SS "mkc_imp.man.mk"
.B mkc_imp.man.mk
is internal include file which is included from
.BR mkc.prog.mk ", " mkc.lib.mk " and " mkc.files.mk .
Do not use it directly!
This module provides installation of manual pages and creation of catpages
and HTML pages and provides the following variables:
.IP MANDIR
Target directory for man pages.
.RI < "Iu" >
.RI [ ${PREFIX}/man ]
.IP USETBL
If not "no", preprocess man pages using
.B tbl(1)
while generating cat pages.
.RI < "IM" >
.RI [ no ]
.IP MANZ
If not "no", compress manual pages at installation time.
.RI < "Iu" >
.RI [ no ]
.IP MAN
Manual pages (should end in .1 - .9).  If no MAN variable is
defined, "MAN=${PROG}.1" is assumed if it exists.
.RI < "M" >
.IP MKMAN
If "no", don't build or install the man pages,
and also acts as "MKCATPAGES=no MKHTML=no".
.RI < "Iu" >
.RI [ yes ]
.IP MKCATPAGES
If "no", don't build or install the catman pages.
.RI < "Iu" >
.RI [ no ]
.IP MKHTML
If "no", don't build or install the HTML man pages.
.RI < "Iu" >
.RI [ no ]
.IP HTMLDIR
Target directory for html pages generated from man pages.
.RI < "Iu" >
.RI [ ${MANDIR} ]
.IP MLINKS
List of manual page links (using a .1 - .9 suffix).  The
linked-to file must come first, the linked file second,
and there may be multiple pairs.  The files are hard-linked.
.RI < "M" >
.SS "mkc_imp.links.mk"
.B mkc_imp.links.mk
is internal include file which is included from
.BR mkc.prog.mk ", " mkc.lib.mk " and " mkc.files.mk .
Do not use it directly! This module provides creation of hard and symbolic
links and provides the following variables: 
.IP LINKS
The list of binary links; should be full pathnames, the
linked-to file coming first, followed by the linked
file.  The files are hard-linked.  For example, to link
${BINDIR}/gzip and ${BINDIR}/gunzip, use:
.VS
    LINKS=   ${DESTDIR}/bin/gzip ${DESTDIR}${BINDIR}/gunzip
.VE
.RI < "M" >
.IP SYMLINKS
The list of symbolic links; should be full pathnames.
Syntax is identical to LINKS. Note that DESTDIR is not
automatically included in the link.
.RI < "M" >
.SS "mkc_imp.inc.mk"
.B mkc_imp.inc.mk
is internal include file which is included from
.BR mkc.prog.mk ", " mkc.lib.mk " and " mkc.files.mk .
Do not use it directly!
This module provides installation of header files and provides
the following variables:
.IP INCSDIR
See 
.BR mkc.init.mk .
.IP INCS
The list of include files.
.RI < "M" >
.IP INCSNAME
Target name of the include file, if only one; same as
FILESNAME, but for include files.
.RI < "M" >
.IP INCSNAME_<file>
The name file <file> should be installed as, if not <file>,
same as FILESNAME_<file>, but for include files.
.RI < "Mu" >
.IP INCSSRCDIR
Source directory for include files. This variable have an influence on
CPPFLAGS (-I${INCSSRCDIR} is added) and on an installation of include files
(paths in ${INCS} are relative to ${INCSSRCDIR}).
.RI < "M" >
.RI [ . ]
.SS "mkc.minitest.mk"
.B mkc.minitest.mk
is an auxiliary include file that implement simple framework for unit
tests.  Idea: application provides the target test_output and
expect.out file that contains ideal output. "bmake test" runs "bmake
test_output" and compare generated output with expect.out.
.IP TEST_PREREQS
Prerequisites for target "test".
.RI < "Iu" >
.RI [ all ]
.SS "mkc_imp.pkg-config.mk"
.B mkc_imp.pkg-config.mk
is internal include file which is included from
.BR mkc.prog.mk " and " mkc.lib.mk .
Do not use it directly!
This module supports dependencies controlled by
.B pkg-config
program. As a result CPPFLAGS and LDADD variables are modified according
to "pkg-config --cflags ..." and "pkg-config --libs ...".
The following variables are provided:
.IP MKC_CHECK_PKGCONFIG
List of libraries to check, for example, glib-2.0>=2.1.
Spaces around <=, >=, =, < and > are not allowed.
As a result of the check bmake's variable
PKG_CONFIG.exists.<lib> is set to 1 for success or 0 for failure.
Unless MKC_NOAUTO is set to 1 -DHAVE_PKGCONFIG_<LIB>=1
is also added to CFLAGS if <lib> was found. <LIB> is tr/a-z+.-/A-ZP__/ of <lib>.
.RI < "M" >
.IP MKC_REQUIRE_PKGCONFIG
The same as MKC_REQUIRE_PKGCONFIG, but absense of library is
treated as a fatal error (See
.B errorcheck
target.
.RI < "M" >
.IP PKG_CONFIG_DEPS
Synonym for MKC_REQUIRE_PKGCONFIG. Deprecated.
.IP PKG_CONFIG.exists.<lib>
If "1", <lib> exists, "0" otherwise.
Inside <lib> <=, >=, =, < and > and replaced with
_le_, _ge_, _eq_, _lt_ and _gt_ respectively.
.RI < "Iu" >
.IP PKG_CONFIG_VARS.<lib>
List of variables to check for library <lib>.
.RI < "M" >
.IP PKG_CONFIG.var.<lib>.<var>
Variable value (pkg-config --variable=<var> <lib>).
.RI < "Iu" >
.IP PCNAME.<lib>
On some systems several versions of the same library may be installed
to differet directories (for example liblua for Lua 5.1 and 5.2).
In order to avoid conflicts between them pc name is changed
(for example, lua5.1 and lua5.2 instead of lua).
This variable is a map from library name to pc name.
.RI < "Iu" >
.RI [ ${lib} ]
.SS "mkc_imp.pod.mk"
.B mkc_imp.pod.mk
is internal include file which is included from
.BR mkc.prog.mk " and " mkc.lib.mk .
Do not use it directly!
It provides support for POD (Plain Old Documentation) markup language,
i.e. convertion of POD documents to MAN pages
(suffix rules: .pod.1, ... , .pod.9) and HTMLs
(.pod.html).
The following variables are provided:
.IP POD2MAN
Path to POD to MAN conversion utility
.RI < "Iu" >
.RI [ pod2man ].
.IP POD2MAN_FLAGS
Flags passed to ${POD2MAN}
.RI < "Iu" >
.RI [ "-r '' -n '${.TARGET:T:R}' -c ''" ].
.IP POD2HTML
Path to POD to HTML conversion utility
.RI < "Iu" >
.RI [ pod2html ].
.IP POD2HTML_FLAGS
Flags passed to ${POD2HTML}
.RI < "Iu" >
.RI [ "" ].
.SS "mkc_imp.dep.mk"
.B mkc_imp.dep.mk
is internal include file which is included from
.BR mkc.prog.mk " and " mkc.lib.mk .
Do not use it directly!  This include file contains the default
targets for building .depend files.  It creates .d files from entries
in SRCS and DPSRCS that are C, C++, or Objective C source files, and
builds .depend from the .d files.  All other files in SRCS and all of
DPSRCS will be used as dependencies for the .d files.
The following variables are provided:
.IP SRCS
The same as in
.B mkc.prog.mk
and
.BR mkc.lib.mk .
.IP DPSRCS
List of source files which are needed for generating
dependencies, but are not needed in ${SRCS}.
.IP MKDEP_CC
Compiler passed to mkdep(1).
.RI < "Iu" >
.RI [ "${CC}" ].
.SS "mkc_imp.foreign_autotools.mk"
This module is activated if variable FOREIGN is set to "autotools" and provides
support for building external projects using autotools.
It also provides a recursive target
.B mkgen
for generating "configure" script, "Makefile.in" file etc. using
.BR autoreconf(1) " utility."
The following variables are provided:
.IP FSRCDIR
Relative (to ${.CURDIR}) or absolute directory to autotools-based sources.
.IP AT_MAKE
Make(1)-like utility for the project.
.RI < "Imu" >
.RI [ "${MAKE}" ].
.IP AT_USE_AUTOMAKE
If "yes",
.B automake(1)
is used.
.RI < "M" >
.RI [ yes ].
.IP AT_CONFIGURE_ARGS
Extra arguments passed to "configure" script set in addition to
standard ones (--prefix, --bindir etc.).
.RI < "Mu" >
.RI [ "" ].
.IP AT_CONFIGURE_ENV
Environment variables for "configure" script set in addition to
standard ones (CC, CFLAGS etc.).
.RI < "Mu" >
.RI [ "" ].
.IP AT_AUTORECONF_ARGS
Arguments passed to
.BR autoreconf(1) .
.RI < "U" >
.RI [ "-sif" ].
.SH "CROSS COMPILATION"
The following variables are used for compiling software using cross-tools.
.IP MACHINE_GNU_PLATFORM
See TOOLCHAIN_PREFIX.
.IP OPSYS_TARGET
OPSYS for target OS.
.IP SYSROOT
Root directory for headers and libraries.
If set, the following variables
are set to ${TOOLCHAIN_DIR}/${TOOLCHAIN_PREFIX}<toolname>: AR, AS, CXX, CPP, CC,
INSTALL, LD, NM, OBJCOPY, OBJDUMP, RANLIB, SIZE and STRIP.
.RI < "U" >
.RI [ "" ].
.IP TOOLDIR
See TOOLCHAIN_DIR.
.IP TOOLCHAIN_DIR
Directory that contains cross-toolchain.
.RI < "U" >
.RI [ "${TOOLDIR}/bin" ].
.IP TOOLCHAIN_PREFIX
See SYSROOT.
.RI < "U" >
.RI [ "${MACHINE_GNU_PLATFORM}-" ].
.SH "ENVIRONMENT VARIABLES"
.IP MAKECONF
Path to mk.conf file .include-ed by mkc.*.mk files
.SH "FILES"
.IP @sysconfdir@/mk.conf
 .include-ed by mkc.init.mk if exists
.SH "BUGS"
Target
.IR errorcheck " (" configure ")"
doesn't support parallel builds. In order to build project in parallel,
run it like the following
.VS
   mkcmake errorcheck
   mkcmake -j4 all
.VE
.SH "SEE ALSO"
.BR mkc_check_header (1),
.BR mkc_check_prog (1),
.BR mkc_check_decl (1),
.BR mkc_check_funclib (1),
.BR mkc_check_sizeof (1),
.BR mkc_check_custom (1),
.BR bmake (1),
.BR mkdep (1),
.SH AUTHOR
Aleksey Cheusov <vle@gmx.net>