summaryrefslogtreecommitdiff
path: root/src/Makefile
blob: ae4801b55648de4a882a54942fc7ba6873fbaef4 (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
# Don't edit Makefile! Use ../conf-* for configuration.

SHELL=/bin/sh

default: \
it-analog it-base it-clients it-control it-dns \
it-forward it-log it-mbox it-pam it-pop it-queue \
it-user it-setup it-server it-srs it-dkim

auto-ccld.sh: \
../conf-cc ../conf-ld warn-auto.sh
	( cat warn-auto.sh; \
	echo CC=\'`head -1 ../conf-cc`\'; \
	echo LD=\'`head -1 ../conf-ld`\' \
	) > auto-ccld.sh

auto-gid: \
load auto-gid.o qlibs.lib
	./load auto-gid `cat qlibs.lib`

auto-gid.o: \
compile auto-gid.c 
	./compile auto-gid.c

auto-int: \
load auto-int.o qlibs.lib
	./load auto-int `cat qlibs.lib`

auto-int.o: \
compile auto-int.c 
	./compile auto-int.c

auto-int8: \
load auto-int8.o qlibs.lib
	./load auto-int8 `cat qlibs.lib`

auto-int8.o: \
compile auto-int8.c 
	./compile auto-int8.c

auto-str: \
load auto-str.o qlibs.lib
	./load auto-str `cat qlibs.lib`

auto-str.o: \
compile auto-str.c 
	./compile auto-str.c

auto-uid: \
load auto-uid.o qlibs.lib
	./load auto-uid `cat qlibs.lib`

auto-uid.o: \
compile auto-uid.c 
	./compile auto-uid.c

auto_break.c: \
auto-str ../conf-break
	./auto-str auto_break \
	"`head -1 ../conf-break`" > auto_break.c

auto_break.o: \
compile auto_break.c
	./compile auto_break.c

auto_patrn.c: \
auto-int8 ../conf-patrn
	./auto-int8 auto_patrn `head -1 ../conf-patrn` > auto_patrn.c

auto_patrn.o: \
compile auto_patrn.c
	./compile auto_patrn.c

auto_qmail.c: \
auto-str ../conf-home
	./auto-str auto_qmail `head -1 ../conf-home` > auto_qmail.c

auto_qmail.o: \
compile auto_qmail.c
	./compile auto_qmail.c

auto_spawn.c: \
auto-int ../conf-spawn
	./auto-int auto_spawn `head -1 ../conf-spawn` > auto_spawn.c

auto_spawn.o: \
compile auto_spawn.c
	./compile auto_spawn.c

auto_split.c: \
auto-int ../conf-split
	./auto-int auto_split `head -1 ../conf-split` > auto_split.c

auto_split.o: \
compile auto_split.c
	./compile auto_split.c

auto_uids.c: \
auto-uid auto-gid ../conf-users ../conf-groups
	( ./auto-uid auto_uida `head -1 ../conf-users` \
	&&./auto-uid auto_uidd `head -2 ../conf-users | tail -1` \
	&&./auto-uid auto_uidl `head -3 ../conf-users | tail -1` \
	&&./auto-uid auto_uido `head -4 ../conf-users | tail -1` \
	&&./auto-uid auto_uidp `head -5 ../conf-users | tail -1` \
	&&./auto-uid auto_uidq `head -6 ../conf-users | tail -1` \
	&&./auto-uid auto_uidr `head -7 ../conf-users | tail -1` \
	&&./auto-uid auto_uids `head -8 ../conf-users | tail -1` \
	&&./auto-gid auto_gidq `head -1 ../conf-groups` \
	&&./auto-gid auto_gidn `head -2 ../conf-groups | tail -1` \
	) > auto_uids.c.tmp && mv auto_uids.c.tmp auto_uids.c

auto_uids.o: \
compile auto_uids.c
	./compile auto_uids.c

auto_usera.c: \
auto-str ../conf-users
	./auto-str auto_usera `head -1 ../conf-users` > auto_usera.c

auto_usera.o: \
compile auto_usera.c
	./compile auto_usera.c

base64.o: \
compile base64.c 
	./compile base64.c

md5c.o : \
compile md5c.c 
	./compile md5c.c

hmac_md5.o : \
compile hmac_md5.c 
	./compile hmac_md5.c

bouncesaying: \
load bouncesaying.o qlibs.lib
	./load bouncesaying `cat qlibs.lib`

bouncesaying.o: \
compile bouncesaying.c 
	./compile bouncesaying.c

chkshsgr: \
load chkshsgr.o
	./load chkshsgr 

chkshsgr.o: \
compile chkshsgr.c 
	./compile chkshsgr.c

chkspawn: \
load chkspawn.o auto_spawn.o qlibs.lib
	./load chkspawn auto_spawn.o `cat qlibs.lib`

chkspawn.o: \
compile chkspawn.c 
	./compile chkspawn.c

clean: \
TARGETS
	rm -f `cat TARGETS`

columnt: \
load columnt.o qlibs.lib
	./load columnt `cat qlibs.lib`

columnt.o: \
compile columnt.c 
	./compile columnt.c 

commands.o: \
compile commands.c 
	./compile commands.c

compile: \
make-compile warn-auto.sh systype
	( cat warn-auto.sh; ./make-compile "`cat systype`" ) > \
	compile
	chmod 755 compile

condredirect: \
load condredirect.o qmail.o auto_qmail.o qlibs.lib
	./load condredirect qmail.o auto_qmail.o `cat qlibs.lib`

condredirect.o: \
compile condredirect.c 
	./compile condredirect.c

config: \
warn-auto.sh config.sh ../conf-home ../conf-break ../conf-split
	cat warn-auto.sh config.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	| sed s}BREAK}"`head -1 ../conf-break`"}g \
	| sed s}SPLIT}"`head -1 ../conf-split`"}g \
	> config
	chmod 755 config

config-fast: \
warn-auto.sh config-fast.sh ../conf-home ../conf-break ../conf-split
	cat warn-auto.sh config-fast.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	| sed s}BREAK}"`head -1 ../conf-break`"}g \
	| sed s}SPLIT}"`head -1 ../conf-split`"}g \
	> config-fast
	chmod 755 config-fast

constmap.o: \
compile constmap.c 
	./compile constmap.c

control.o: \
compile control.c 
	./compile control.c

date822fmt.o: \
compile date822fmt.c 
	./compile date822fmt.c

datemail: \
warn-auto.sh datemail.sh ../conf-home ../conf-break ../conf-split
	cat warn-auto.sh datemail.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	| sed s}BREAK}"`head -1 ../conf-break`"}g \
	| sed s}SPLIT}"`head -1 ../conf-split`"}g \
	> datemail
	chmod 755 datemail

datetime.a: \
makelib datetime.o datetime_un.o
	./makelib datetime.a datetime.o datetime_un.o

datetime.o: \
compile datetime.c 
	./compile datetime.c

datetime_un.o: \
compile datetime_un.c 
	./compile datetime_un.c

ddist: \
warn-auto.sh ddist.sh ../conf-home
	cat warn-auto.sh ddist.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> ddist
	chmod 755 ddist

deferrals: \
warn-auto.sh deferrals.sh ../conf-home
	cat warn-auto.sh deferrals.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> deferrals
	chmod 755 deferrals

direntry.h: \
compile trydrent.c direntry.h1 direntry.h2
	( ./compile trydrent.c >/dev/null 2>&1 \
	&& cat direntry.h2 || cat direntry.h1 ) > direntry.h
	rm -f trydrent.o

dkim.o: \
compile dkim.cpp
	./compile dkim.cpp

dkimbase.o: \
compile dkimbase.cpp
	./compile dkimbase.cpp

dkimsign.o: \
compile dkimsign.cpp
	./compile dkimsign.cpp

dkimverify.o: \
compile dkimverify.cpp
	./compile dkimverify.cpp

dns.lib: \
tryrsolv.c compile load
	( (./compile tryrsolv.c  && \
	./load tryrsolv -L`head -1 ../conf-qlibs` -ldnsresolv ) \
	&& echo "-L`head -1 ../conf-qlibs` -ldnsresolv" || exit 0 ) > dns.lib
	rm -f tryrsolv.o tryrsolv

dns.o: \
compile dns.c dns_tlsa.c 
	./compile dns.c dns_tlsa.c 

dnscname: \
load dnscname.o \
dns.lib socket.lib qlibs.lib dns.o ipalloc.o 
	./load dnscname dns.o ipalloc.o \
	`cat dns.lib` `cat socket.lib` `cat qlibs.lib`

dnscname.o: \
compile dnscname.c 
	./compile dnscname.c

dnsfq: \
load dnsfq.o \
dns.lib socket.lib qlibs.lib dns.o ipalloc.o 
	./load dnsfq dns.o ipalloc.o \
	`cat dns.lib` `cat socket.lib` `cat qlibs.lib`

dnsfq.o: \
compile dnsfq.c
	./compile dnsfq.c

dnsip: \
load dnsip.o dns.o ipalloc.o \
dns.lib socket.lib qlibs.lib
	./load dnsip dns.o ipalloc.o \
	`cat dns.lib` `cat socket.lib` `cat qlibs.lib`

dnsip.o: \
compile dnsip.c 
	./compile dnsip.c

dnsmxip: \
load dnsmxip.o ipalloc.o dns.o dns.lib socket.lib
	./load dnsmxip ipalloc.o dns.o \
	  `cat dns.lib` `cat socket.lib` `cat qlibs.lib`

dnsmxip.o: \
compile dnsmxip.c 
	./compile dnsmxip.c

dnsptr: \
load dnsptr.o dns.o ipalloc.o \
dns.lib socket.lib qlibs.lib
	./load dnsptr dns.o ipalloc.o \
	 `cat dns.lib` `cat socket.lib` `cat qlibs.lib`

dnsptr.o: \
compile dnsptr.c 
	./compile dnsptr.c

dnstlsa: \
load dnstlsa.o dns_tlsa.o ipalloc.o dns.o \
dns.lib socket.lib qlibs.lib
	./load dnstlsa dns_tlsa.o ipalloc.o dns.o \
	 `cat dns.lib` `cat socket.lib` `cat qlibs.lib`

dnstlsa.o: \
compile dnstlsa.c dns_tlsa.c 
	./compile dnstlsa.c dns_tlsa.c

dnstxt: \
load dnstxt.o ipalloc.o dns.o \
dns.lib socket.lib qlibs.lib
	./load dnstxt ipalloc.o dns.o \
	 `cat dns.lib` `cat socket.lib` `cat qlibs.lib`

dnstxt.o: \
compile dnstxt.c 
	./compile dnstxt.c

except: \
load except.o qlibs.lib
	./load except `cat qlibs.lib`

except.o: \
compile except.c 
	./compile except.c

failures: \
warn-auto.sh failures.sh ../conf-home
	cat warn-auto.sh failures.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> failures
	chmod 755 failures

fastforward: \
load fastforward.o qmail.o auto_qmail.o strset.o qlibs.lib
	./load fastforward qmail.o auto_qmail.o strset.o \
	`cat qlibs.lib`

fastforward.o: \
compile fastforward.c 
	./compile fastforward.c

fifo.o: \
compile fifo.c 
	./compile fifo.c

find-systype: \
find-systype.sh auto-ccld.sh
	cat auto-ccld.sh find-systype.sh > find-systype
	chmod 755 find-systype

fmtqfn.o: \
compile fmtqfn.c 
	./compile fmtqfn.c

forward: \
load forward.o qmail.o auto_qmail.o qlibs.lib
	./load forward qmail.o auto_qmail.o \
	`cat qlibs.lib` 

forward.o: \
compile forward.c 
	./compile forward.c

gfrom.o: \
compile gfrom.c 
	./compile gfrom.c

hasflock.h: \
tryflock.c compile load
	( ( ./compile tryflock.c && ./load tryflock ) >/dev/null \
	2>&1 \
	&& echo \#define HASFLOCK 1 || exit 0 ) > hasflock.h
	rm -f tryflock.o tryflock

hasmkffo.h: \
trymkffo.c compile load
	( ( ./compile trymkffo.c && ./load trymkffo ) >/dev/null \
	2>&1 \
	&& echo \#define HASMKFIFO 1 || exit 0 ) > hasmkffo.h
	rm -f trymkffo.o trymkffo

hasspnam.h: \
tryspnam.c compile load
	( ( ./compile tryspnam.c && ./load tryspnam ) >/dev/null \
	2>&1 \
	&& echo \#define HASGETSPNAM 1 || exit 0 ) > hasspnam.h
	rm -f tryspnam.o tryspnam

hasuserpw.h: \
tryuserpw.c s.lib compile load
	( ( ./compile tryuserpw.c \
	&& ./load tryuserpw `cat s.lib` ) >/dev/null 2>&1 \
	&& echo \#define HASGETUSERPW 1 || exit 0 ) > hasuserpw.h
	rm -f tryuserpw.o tryuserpw

hassalen.h: \
trysalen.c compile
	( ./compile trysalen.c >/dev/null 2>&1 \
	&& echo \#define HASSALEN 1 || exit 0 ) > hassalen.h

hassgact.h: \
trysgact.c compile load
	( ( ./compile trysgact.c && ./load trysgact ) >/dev/null \
	2>&1 \
	&& echo \#define HASSIGACTION 1 || exit 0 ) > hassgact.h
	rm -f trysgact.o trysgact

hassgprm.h: \
trysgprm.c compile load
	( ( ./compile trysgprm.c && ./load trysgprm ) >/dev/null \
	2>&1 \
	&& echo \#define HASSIGPROCMASK 1 || exit 0 ) > hassgprm.h
	rm -f trysgprm.o trysgprm

hasshsgr.h: \
chkshsgr warn-shsgr tryshsgr.c compile load
	./chkshsgr || ( cat warn-shsgr; exit 1 )
	( ( ./compile tryshsgr.c \
	&& ./load tryshsgr && ./tryshsgr ) >/dev/null 2>&1 \
	&& echo \#define HASSHORTSETGROUPS 1 || exit 0 ) > \
	hasshsgr.h
	rm -f tryshsgr.o tryshsgr

hasutmp.h: \
tryutmp.c compile
	( ./compile tryutmp.c >/dev/null 2>&1 \
	&& echo \#define HASUTMP 1 || exit 0 ) > hasutmp.h
	rm -f tryutmp.o

haswaitp.h: \
trywaitp.c compile load
	( ( ./compile trywaitp.c && ./load trywaitp ) >/dev/null \
	2>&1 \
	&& echo \#define HASWAITPID 1 || exit 0 ) > haswaitp.h
	rm -f trywaitp.o trywaitp

headerbody.o: \
compile headerbody.c 
	./compile headerbody.c

hfield.o: \
compile hfield.c 
	./compile hfield.c

hier.o: \
compile hier.c 
	./compile hier.c

hostname: \
load hostname.o dns.lib socket.lib
	./load hostname `cat dns.lib` `cat socket.lib` `cat qlibs.lib`

hostname.o: \
compile hostname.c 
	./compile hostname.c

idn2.lib: \
tryidn2.c compile load
	( (./compile tryidn2.c && \
	./load tryidn2 `head -1 ../conf-idn2` -lidn2 ) >/dev/null 2>&1 \
	&& echo "`head -1 ../conf-idn2` -lidn2" || exit 0 ) > idn2.lib
	rm -f tryind2.o tryidn2

install: \
load install.o hier.o auto_qmail.o auto_split.o auto_uids.o fifo.o qlibs.lib
	./load install hier.o auto_qmail.o auto_split.o auto_uids.o fifo.o \
	`cat qlibs.lib`

install.o: \
compile install.c 
	./compile install.c

instcheck: \
load instcheck.o hier.o auto_qmail.o auto_split.o auto_uids.o qlibs.lib
	./load instcheck hier.o auto_qmail.o auto_split.o auto_uids.o \
	`cat qlibs.lib`

instcheck.o: \
compile instcheck.c 
	./compile instcheck.c

ipalloc.o: \
compile ipalloc.c 
	./compile ipalloc.c

ipme.o: \
compile ipme.c hassalen.h
	./compile ipme.c

ipmeprint: \
load ipmeprint.o ipme.o ipalloc.o auto_qmail.o \
dns.lib socket.lib qlibs.lib
	./load ipmeprint ipme.o auto_qmail.o ipalloc.o \
	`cat qlibs.lib` `cat socket.lib` `cat dns.lib`

ipmeprint.o: \
compile ipmeprint.c 
	./compile ipmeprint.c

it-analog: \
columnt matchup \
ddist deferrals failures senders successes suids \
recipients rhosts rhosts rxdelay \
xqp xrecipient xsender \
zddist zdeferrals zfailures zrecipients zrhosts \
zrxdelay zsenders zsendmail zsuccesses zsuids zoverall

it-base: \
qmail-local qmail-rspawn qmail-lspawn qmail-send qmail-qmaint \
qmail-clean qmail-start qmail-queue qmail-inject qmail-todo

it-mbox: \
forward predate preline condredirect bouncesaying except \
datemail maildirmake maildir2mbox maildirwatch qbiff qreceipt

it-clients: \
mailsubj qmail-remote qmail-qmqpc sendmail

it-dkim: \
qmail-dkim qmail-dksign qmail-dkverify

it-dns: \
dnscname dnsptr dnsip dnsmxip dnsfq dnstlsa dnstxt \
hostname ipmeprint spfquery

it-pop: \
qmail-popup qmail-pop3d

it-forward: \
fastforward forward printforward setforward newaliases \
printmaillist setmaillist newinclude 

it-control: \
qmail-badmimetypes qmail-badloadertypes \
qmail-mfrules qmail-recipients qmail-showctl 

it-ldap: \
qmail-ldapam

it-log: \
splogger qmail-mrtg qmail-mrtg-queue tai64nfrac

it-pam: \
qmail-authuser qmail-smtpam qmail-vmailuser \
qmail-postgrey 

it-queue: \
qmail-qread qmail-qstat qmail-tcpto qmail-tcpok qmail-upq

it-server: \
qmail-qmtpd qmail-qmqpd qmail-smtpd 

it-setup: \
config config-fast install instcheck

it-srs: \
srsforward srsreverse

it-user: \
qmail-getpw qmail-newu qmail-pw2u qmail-newmrh 

ldap.lib: \
tryldap.c compile load
	( ( ./compile tryldap.c && \
	./load tryldap `head -2 ../conf-ldap | tail -1` ) >/dev/null 2>&1 \
	&& echo "`head -2 ../conf-ldap | tail -1` -lldap" || exit 0 ) > ldap.lib
#       rm -f tryldap.o tryldap

load: \
make-load warn-auto.sh systype
	( cat warn-auto.sh; ./make-load "`cat systype`" ) > load
	chmod 755 load

maildir.o: \
compile maildir.c 
	./compile maildir.c

maildir2mbox: \
load maildir2mbox.o maildir.o prioq.o now.o myctime.o gfrom.o \
datetime.a
	./load maildir2mbox maildir.o prioq.o now.o myctime.o \
	gfrom.o datetime.a `cat qlibs.lib`

maildir2mbox.o: \
compile maildir2mbox.c 
	./compile maildir2mbox.c

maildirmake: \
load maildirmake.o 
	./load maildirmake `cat qlibs.lib`

maildirmake.o: \
compile maildirmake.c 
	./compile maildirmake.c

maildirwatch: \
load maildirwatch.o hfield.o headerbody.o maildir.o prioq.o now.o
	./load maildirwatch hfield.o headerbody.o maildir.o \
	prioq.o now.o `cat qlibs.lib`

maildirwatch.o: \
compile maildirwatch.c 
	./compile maildirwatch.c

mailsubj: \
warn-auto.sh mailsubj.sh ../conf-home ../conf-break ../conf-split
	cat warn-auto.sh mailsubj.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	| sed s}BREAK}"`head -1 ../conf-break`"}g \
	| sed s}SPLIT}"`head -1 ../conf-split`"}g \
	> mailsubj
	chmod 755 mailsubj

make-compile: \
make-compile.sh auto-ccld.sh
	cat auto-ccld.sh make-compile.sh > make-compile
	chmod 755 make-compile

make-load: \
make-load.sh auto-ccld.sh
	cat auto-ccld.sh make-load.sh > make-load
	chmod 755 make-load

make-makelib: \
make-makelib.sh auto-ccld.sh
	cat auto-ccld.sh make-makelib.sh > make-makelib
	chmod 755 make-makelib

makelib: \
make-makelib warn-auto.sh systype
	( cat warn-auto.sh; ./make-makelib "`cat systype`" ) > \
	makelib
	chmod 755 makelib

matchup: \
load matchup.o qlibs.lib
	./load matchup `cat qlibs.lib`

matchup.o: \
compile matchup.c 
	./compile matchup.c

myctime.o: \
compile myctime.c 
	./compile myctime.c

mfrules.o: \
compile mfrules.c 
	./compile mfrules.c

newaliases: \
load newaliases.o auto_qmail.o token822.o control.o qlibs.lib
	./load newaliases auto_qmail.o token822.o control.o \
	`cat qlibs.lib`

newaliases.o: \
compile newaliases.c 
	./compile newaliases.c

newinclude: \
load newinclude.o auto_qmail.o token822.o control.o qlibs.lib 
	./load newinclude auto_qmail.o token822.o control.o \
	`cat qlibs.lib`

newinclude.o: \
compile newinclude.c 
	./compile newinclude.c

newfield.o: \
compile newfield.c 
	./compile newfield.c

now.o: \
compile now.c
	./compile now.c

predate: \
load predate.o datetime.a qlibs.lib
	./load predate datetime.a `cat qlibs.lib`

predate.o: \
compile predate.c
	./compile predate.c

preline: \
load preline.o qlibs.lib
	./load preline `cat qlibs.lib`

preline.o: \
compile preline.c 
	./compile preline.c

printforward: \
load printforward.o qlibs.lib
	./load printforward `cat qlibs.lib`

printforward.o: \
compile printforward.c
	./compile printforward.c

printmaillist: \
load printmaillist.o qlibs.lib
	./load printmaillist `cat qlibs.lib` 
        
printmaillist.o: \
compile printmaillist.c 
	./compile printmaillist.c

prioq.o: \
compile prioq.c 
	./compile prioq.c

qbiff: \
load qbiff.o headerbody.o hfield.o qlibs.lib
	./load qbiff headerbody.o hfield.o `cat qlibs.lib`

qbiff.o: \
compile hasutmp.h qbiff.c 
	./compile qbiff.c

qlibs.lib: \
tryqlibs.c compile load
	( (./compile tryqlibs.c && \
	./load tryqlibs -L`head -1 ../conf-qlibs` -lqlibs ) \
	&& echo "-L`head -1 ../conf-qlibs` -lqlibs" || exit 0 ) > qlibs.lib
	rm -f tryqlibs.o tryqlibs

qmail-authuser: \
load qmail-authuser.o auto_qmail.o control.o hmac_md5.o md5c.o \
constmap.o shadow.lib sha1.o sha256.o \
qlibs.lib shadow.lib crypt.lib s.lib
	./load qmail-authuser auto_qmail.o control.o \
	constmap.o hmac_md5.o md5c.o sha1.o sha256.o \
	`cat shadow.lib` `cat qlibs.lib` `cat crypt.lib` `cat s.lib`

qmail-authuser.o: \
compile qmail-authuser.c hasspnam.h hasuserpw.h
	./compile qmail-authuser.c 

qmail-clean: \
load qmail-clean.o fmtqfn.o now.o auto_qmail.o auto_split.o qlibs.lib
	./load qmail-clean fmtqfn.o now.o auto_qmail.o auto_split.o `cat qlibs.lib`

qmail-clean.o: \
compile qmail-clean.c 
	./compile qmail-clean.c

qmail-dkim: \
load qmail-dkim.o libqdkim.a dkim.o dkimbase.o dkimsign.o dkimverify.o  \
  qlibs.lib dns.lib ssl.lib
	./load qmail-dkim libqdkim.a \
  -lstdc++ `cat dns.lib` `cat qlibs.lib` `cat ssl.lib`

qmail-dkim.o: \
compile qmail-dkim.cpp dkim.cpp dkimbase.cpp dkimsign.cpp dkimverify.cpp
	./compile qmail-dkim.cpp 

qmail-dksign: \
load qmail-dksign.o control.o constmap.o fmtqfn.o rcpthosts.o qmail-dkim \
auto_qmail.o auto_split.o qlibs.lib
	./load qmail-dksign control.o constmap.o fmtqfn.o rcpthosts.o \
	auto_qmail.o auto_split.o `cat qlibs.lib`

qmail-dksign.o: \
compile qmail-dksign.c 
	./compile qmail-dksign.c

qmail-dkverify: \
load qmail-dkverify.o control.o fmtqfn.o qmail-dkim \
auto_qmail.o auto_split.o qmail.o qlibs.lib
	./load qmail-dkverify qmail.o control.o fmtqfn.o \
	auto_qmail.o auto_split.o `cat qlibs.lib`

qmail-dkverify.o: \
compile qmail-dkverify.c 
	./compile qmail-dkverify.c

qmail-getpw: \
load qmail-getpw.o auto_break.o auto_usera.o qlibs.lib
	./load qmail-getpw auto_break.o auto_usera.o `cat qlibs.lib`

qmail-getpw.o: \
compile qmail-getpw.c 
	./compile qmail-getpw.c

qmail-inject: \
load qmail-inject.o headerbody.o hfield.o newfield.o quote.o now.o \
control.o date822fmt.o qmail.o datetime.a token822.o auto_qmail.o qlibs.lib
	./load qmail-inject headerbody.o hfield.o newfield.o \
	constmap.o quote.o now.o control.o date822fmt.o qmail.o datetime.a \
	token822.o auto_qmail.o `cat qlibs.lib`

qmail-inject.o: \
compile qmail-inject.c 
	./compile qmail-inject.c

qmail-clean: \
load qmail-clean.o fmtqfn.o now.o auto_qmail.o auto_split.o qlibs.lib

qmail-ldapam: \
load qmail-ldapam.o auto_qmail.o control.o constmap.o \
qlibs.lib shadow.lib crypt.lib s.lib ldap.lib
	./load qmail-ldapam auto_qmail.o control.o constmap.o \
	`cat shadow.lib` `cat qlibs.lib` `cat crypt.lib` `cat s.lib` `cat ldap.lib`

qmail-ldapam.o: \
compile qmail-ldapam.c \
hasspnam.h hasuserpw.h
	./compile qmail-ldapam.c

qmail-local: \
load qmail-local.o auto_qmail.o auto_break.o auto_patrn.o \
qmail.o quote.o now.o gfrom.o myctime.o datetime.a socket.lib qlibs.lib
	./load qmail-local qmail.o quote.o now.o gfrom.o myctime.o \
	datetime.a auto_qmail.o auto_break.o auto_patrn.o \
	`cat socket.lib` `cat qlibs.lib`

qmail-local.o: \
compile qmail-local.c 
	./compile qmail-local.c 

qmail-lspawn: \
load qmail-lspawn.o spawn.o \
auto_qmail.o auto_uids.o auto_spawn.o qlibs.lib
	./load qmail-lspawn spawn.o \
	auto_qmail.o auto_uids.o auto_spawn.o `cat qlibs.lib`

qmail-lspawn.o: \
compile qmail-lspawn.c 
	./compile qmail-lspawn.c

qmail-badmimetypes: \
load qmail-badmimetypes.o auto_qmail.o qlibs.lib
	./load qmail-badmimetypes auto_qmail.o `cat qlibs.lib`

qmail-badmimetypes.o: \
compile qmail-badmimetypes.c 
	./compile qmail-badmimetypes.c

qmail-badloadertypes: \
load qmail-badloadertypes.o auto_qmail.o qlibs.lib
	./load qmail-badloadertypes auto_qmail.o `cat qlibs.lib`

qmail-badloadertypes.8: \
qmail-badloadertypes.9 ../conf-break ../conf-spawn
	cat qmail-badloadertypes.9 \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	| sed s}BREAK}"`head -1 ../conf-break`"}g \
	| sed s}SPAWN}"`head -1 ../conf-spawn`"}g \
	> qmail-badloadertypes.8

qmail-badloadertypes.o: \
compile qmail-badloadertypes.c 
	./compile qmail-badloadertypes.c

qmail-newmrh: \
load qmail-newmrh.o auto_qmail.o qlibs.lib
	./load qmail-newmrh auto_qmail.o `cat qlibs.lib`

qmail-newmrh.o: \
compile qmail-newmrh.c 
	./compile qmail-newmrh.c

qmail-recipients: \
load qmail-recipients.o auto_qmail.o qlibs.lib
	./load qmail-recipients auto_qmail.o `cat qlibs.lib`

qmail-recipients.o: \
compile qmail-recipients.c 
	./compile qmail-recipients.c

qmail-vmailuser: \
load qmail-vmailuser.o auto_qmail.o control.o constmap.o qlibs.lib
	./load qmail-vmailuser auto_qmail.o control.o constmap.o \
	 `cat qlibs.lib`

qmail-vmailuser.o: \
compile qmail-vmailuser.c 
	./compile qmail-vmailuser.c

qmail-smtpam: \
load qmail-smtpam.o control.o now.o dns.o constmap.o \
ipalloc.o ipme.o quote.o auto_qmail.o tcpto.o \
tls_timeoutio.o tls_errors.o tls_remote.o dns_tlsa.o \
ssl.lib dns.lib socket.lib qlibs.lib ucspissl.a
	./load qmail-smtpam constmap.o control.o dns_tlsa.o \
	tcpto.o now.o dns.o ipalloc.o ipme.o quote.o auto_qmail.o \
	tls_errors.o tls_remote.o tls_timeoutio.o ucspissl.a \
	`cat ssl.lib` `cat dns.lib` `cat socket.lib` `cat qlibs.lib` 

qmail-smtpam.o: \
compile qmail-smtpam.c 
	./compile qmail-smtpam.c

qmail-mfrules: \
load qmail-mfrules.o auto_qmail.o qlibs.lib
	./load qmail-mfrules auto_qmail.o `cat qlibs.lib`

qmail-mfrules.o: \
compile qmail-mfrules.c 
	./compile qmail-mfrules.c

qmail-mrtg: \
load qmail-mrtg.o now.o qlibs.lib 
	./load qmail-mrtg now.o `cat qlibs.lib`

qmail-mrtg.o: \
compile qmail-mfrules.c 
	./compile qmail-mrtg.c

qmail-mrtg-queue: \
warn-auto.sh qmail-mrtg-queue.sh ../conf-home
	cat warn-auto.sh qmail-mrtg-queue.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> qmail-mrtg-queue
	chmod 755 qmail-mrtg-queue

qmail-newu: \
load qmail-newu.o auto_qmail.o qlibs.lib
	./load qmail-newu auto_qmail.o `cat qlibs.lib`

qmail-newu.o: \
compile qmail-newu.c 
	./compile qmail-newu.c

qmail-pop3d: \
load qmail-pop3d.o commands.o maildir.o prioq.o now.o socket.lib qlibs.lib
	./load qmail-pop3d commands.o maildir.o prioq.o now.o  \
	 `cat socket.lib` `cat qlibs.lib`

qmail-pop3d.o: \
compile qmail-pop3d.c 
	./compile qmail-pop3d.c

qmail-popup: \
load qmail-popup.o commands.o now.o tls_start.o socket.lib qlibs.lib
	./load qmail-popup commands.o tls_start.o now.o  \
	`cat socket.lib` `cat qlibs.lib`

qmail-popup.o: \
compile qmail-popup.c
	./compile qmail-popup.c

qmail-postgrey: \
load qmail-postgrey.o socket.lib qlibs.lib
	./load qmail-postgrey \
	`cat socket.lib` `cat qlibs.lib`

qmail-postgrey.o: \
compile qmail-postgrey.c
	./compile qmail-postgrey.c

qmail-pw2u: \
load qmail-pw2u.o constmap.o control.o auto_usera.o auto_break.o auto_qmail.o qlibs.lib
	./load qmail-pw2u constmap.o control.o  \
	auto_usera.o auto_break.o auto_qmail.o `cat qlibs.lib`

qmail-pw2u.o: \
compile qmail-pw2u.c
	./compile qmail-pw2u.c

qmail-qmqpc: \
load qmail-qmqpc.o control.o auto_qmail.o socket.lib qlibs.lib
	./load qmail-qmqpc control.o auto_qmail.o `cat socket.lib` `cat qlibs.lib`

qmail-qmqpc.o: \
compile qmail-qmqpc.c
	./compile qmail-qmqpc.c

qmail-qmqpd: \
load qmail-qmqpd.o received.o now.o date822fmt.o qmail.o auto_qmail.o \
datetime.a qlibs.lib
	./load qmail-qmqpd received.o now.o date822fmt.o datetime.a qmail.o \
	auto_qmail.o `cat qlibs.lib`

qmail-qmqpd.o: \
compile qmail-qmqpd.c
	./compile qmail-qmqpd.c

qmail-qmtpd: \
load qmail-qmtpd.o rcpthosts.o control.o constmap.o received.o \
date822fmt.o now.o qmail.o datetime.a auto_qmail.o qlibs.lib
	./load qmail-qmtpd rcpthosts.o auto_qmail.o control.o constmap.o \
	received.o date822fmt.o now.o qmail.o datetime.a  `cat qlibs.lib`

qmail-qmtpd.o: \
compile qmail-qmtpd.c
	./compile qmail-qmtpd.c

qmail-qread: \
load qmail-qread.o fmtqfn.o readsubdir.o date822fmt.o datetime.a \
auto_qmail.o auto_split.o qlibs.lib
	./load qmail-qread fmtqfn.o readsubdir.o date822fmt.o \
	datetime.a auto_qmail.o auto_split.o `cat qlibs.lib`

qmail-qread.o: \
compile qmail-qread.c 
	./compile qmail-qread.c

qmail-qstat: \
warn-auto.sh qmail-qstat.sh ../conf-home ../conf-break ../conf-split
	cat warn-auto.sh qmail-qstat.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	| sed s}BREAK}"`head -1 ../conf-break`"}g \
	| sed s}SPLIT}"`head -1 ../conf-split`"}g \
	> qmail-qstat
	chmod 755 qmail-qstat

qmail-queue: \
load qmail-queue.o triggerpull.o fmtqfn.o now.o date822fmt.o \
datetime.a auto_qmail.o auto_split.o auto_uids.o qlibs.lib
	./load qmail-queue auto_qmail.o auto_split.o auto_uids.o \
	triggerpull.o fmtqfn.o now.o date822fmt.o datetime.a `cat qlibs.lib`

qmail-queue.o: \
compile qmail-queue.c
	./compile qmail-queue.c

qmail-qmaint: \
load qmail-qmaint.o auto_qmail.o auto_split.o auto_uids.o fifo.o \
fmtqfn.o readsubdir.o qlibs.lib
	./load qmail-qmaint auto_qmail.o auto_split.o auto_uids.o fifo.o \
	fmtqfn.o readsubdir.o `cat qlibs.lib`

qmail-qmaint.o: \
compile qmail-qmaint.c
	./compile qmail-qmaint.c

qmail-remote: \
load qmail-remote.o control.o tcpto.o now.o dns.o ipalloc.o ipme.o \
quote.o tls_timeoutio.o tls_errors.o tls_remote.o dns_tlsa.o \
base64.o constmap.o md5c.o hmac_md5.o auto_qmail.o \
ssl.lib dns.lib socket.lib qlibs.lib idn2.lib ucspissl.a
	./load qmail-remote control.o tcpto.o now.o \
	base64.o constmap.o md5c.o hmac_md5.o ipalloc.o ipme.o \
	quote.o dns.o ucspissl.a auto_qmail.o dns_tlsa.o \
	tls_errors.o tls_remote.o tls_timeoutio.o ucspissl.a \
	`cat ssl.lib` `cat dns.lib` `cat socket.lib` `cat qlibs.lib` `cat idn2.lib`

qmail-remote.o: \
compile qmail-remote.c
	./compile qmail-remote.c

qmail-rspawn: \
load qmail-rspawn.o spawn.o tcpto_clean.o now.o \
auto_qmail.o auto_uids.o auto_spawn.o qlibs.lib
	./load qmail-rspawn spawn.o tcpto_clean.o now.o \
	auto_qmail.o auto_uids.o auto_spawn.o `cat qlibs.lib`

qmail-rspawn.o: \
compile qmail-rspawn.c
	./compile qmail-rspawn.c

qmail-send: \
load qmail-send.o qsutil.o control.o constmap.o newfield.o prioq.o \
trigger.o fmtqfn.o quote.o now.o readsubdir.o qmail.o date822fmt.o \
datetime.a auto_qmail.o auto_split.o qlibs.lib
	./load qmail-send qsutil.o control.o constmap.o newfield.o \
	prioq.o trigger.o fmtqfn.o quote.o now.o readsubdir.o \
	qmail.o date822fmt.o datetime.a auto_qmail.o auto_split.o `cat qlibs.lib`

qmail-send.o: \
compile qmail-send.c 
	./compile qmail-send.c

qmail-showctl: \
load qmail-showctl.o auto_uids.o control.o auto_qmail.o auto_break.o \
auto_patrn.o auto_spawn.o auto_split.o qlibs.lib
	./load qmail-showctl auto_uids.o auto_qmail.o auto_break.o auto_patrn.o \
	auto_spawn.o auto_split.o control.o `cat qlibs.lib`

qmail-showctl.o: \
compile qmail-showctl.c 
	./compile qmail-showctl.c

qmail-smtpd: \
load qmail-smtpd.o auto_break.o rcpthosts.o commands.o \
ipme.o ipalloc.o constmap.o control.o received.o \
recipients.o mfrules.o tls_start.o smtpdlog.o dns.o \
date822fmt.o now.o qmail.o wildmat.o spf.o spfdnsip.o \
datetime.a auto_qmail.o base64.o socket.lib qlibs.lib
	./load qmail-smtpd rcpthosts.o recipients.o commands.o \
	mfrules.o tls_start.o auto_break.o smtpdlog.o ipme.o \
	ipalloc.o constmap.o control.o dns.o spf.o spfdnsip.o \
	date822fmt.o now.o qmail.o wildmat.o received.o \
	base64.o datetime.a auto_qmail.o \
	`cat dns.lib` `cat socket.lib` `cat qlibs.lib`

qmail-smtpd.o: \
compile qmail-smtpd.c 
	./compile qmail-smtpd.c

qmail-start: \
load qmail-start.o auto_uids.o qlibs.lib
	./load qmail-start auto_uids.o `cat qlibs.lib`

qmail-start.o: \
compile qmail-start.c 
	./compile qmail-start.c

qmail-tcpok: \
load qmail-tcpok.o auto_qmail.o qlibs.lib
	./load qmail-tcpok auto_qmail.o `cat qlibs.lib`

qmail-tcpok.o: \
compile qmail-tcpok.c 
	./compile qmail-tcpok.c

qmail-tcpto: \
load qmail-tcpto.o now.o auto_qmail.o qlibs.lib
	./load qmail-tcpto now.o auto_qmail.o `cat qlibs.lib`

qmail-tcpto.o: \
compile qmail-tcpto.c 
	./compile qmail-tcpto.c

qmail-todo: \
load qmail-todo.o control.o constmap.o trigger.o fmtqfn.o \
now.o qsutil.o readsubdir.o auto_qmail.o auto_split.o qlibs.lib
	./load qmail-todo control.o constmap.o trigger.o fmtqfn.o now.o \
	readsubdir.o qsutil.o auto_qmail.o auto_split.o `cat qlibs.lib`

qmail-todo.o: \
compile qmail-todo.c
	./compile qmail-todo.c

qmail-upq: \
warn-auto.sh qmail-upq.sh ../conf-home ../conf-break ../conf-split
	cat warn-auto.sh qmail-upq.sh \
	| sed s}QMAIL}"`head -1 ../conf-home`"}g \
	| sed s}BREAK}"`head -1 ../conf-break`"}g \
	| sed s}SPLIT}"`head -1 ../conf-split`"}g \
	> qmail-upq
	chmod 755 qmail-upq

qmail.o: \
compile qmail.c 
	./compile qmail.c

qreceipt: \
load qreceipt.o headerbody.o hfield.o quote.o token822.o qmail.o \
auto_qmail.o qlibs.lib
	./load qreceipt headerbody.o hfield.o quote.o token822.o \
	qmail.o auto_qmail.o `cat qlibs.lib`

qreceipt.o: \
compile qreceipt.c 
	./compile qreceipt.c

qsutil.o: \
compile qsutil.c 
	./compile qsutil.c

quote.o: \
compile quote.c 
	./compile quote.c

rcpthosts.o: \
compile rcpthosts.c 
	./compile rcpthosts.c

recipients.o: \
compile recipients.c 
	./compile recipients.c

recipients: \
warn-auto.sh recipients.sh ../conf-home
	cat warn-auto.sh recipients.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> recipients
	chmod 755 recipients

rhosts: \
warn-auto.sh rhosts.sh ../conf-home
	cat warn-auto.sh rhosts.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> rhosts
	chmod 755 rhosts

rxdelay: \
warn-auto.sh rxdelay.sh ../conf-home
	cat warn-auto.sh rxdelay.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> rxdelay
	chmod 755 rxdelay

senders: \
warn-auto.sh senders.sh ../conf-home
	cat warn-auto.sh senders.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> senders
	chmod 755 senders

smtpdlog.o: \
compile smtpdlog.c 
	./compile smtpdlog.c 

s.lib: \
tryslib.c compile load
	( ( ./compile tryslib.c && \
        ./load tryslib -ls ) >/dev/null 2>&1 \
	&& echo -ls || exit 0 ) > s.lib
	rm -f tryslib.o tryslib

shadow.lib: \
tryshadow.c compile load
	( ( ./compile tryshadow.c && \
	./load tryshadow -lshadow ) >/dev/null 2>&1 \
	&& echo -lshadow || exit 0 ) > shadow.lib
	rm -f tryshadow.o tryshadow

successes: \
warn-auto.sh successes.sh ../conf-home
	cat warn-auto.sh successes.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> successes
	chmod 755 successes

suids: \
warn-auto.sh suids.sh ../conf-home
	cat warn-auto.sh suids.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> suids
	chmod 755 suids

readsubdir.o: \
compile readsubdir.c 
	./compile readsubdir.c

received.o: \
compile received.c 
	./compile received.c

sendmail: \
load sendmail.o auto_qmail.o qlibs.lib
	./load sendmail auto_qmail.o `cat qlibs.lib`

sendmail.o: \
compile sendmail.c 
	./compile sendmail.c

setforward: \
load setforward.o qlibs.lib
	./load setforward `cat qlibs.lib`

setforward.o: \
compile setforward.c 
	./compile setforward.c

setmaillist: \
load setmaillist.o qlibs.lib
	./load setmaillist  `cat qlibs.lib`

setmaillist.o: \
compile setmaillist.c 
	./compile setmaillist.c

sha1.o: \
compile sha1.c 
	./compile sha1.c

sha256.o : \
compile sha256.c 
	./compile sha256.c

socket.lib: \
trylsock.c compile load
	( ( ./compile trylsock.c && \
	./load trylsock -lsocket -lnsl ) >/dev/null 2>&1 \
	&& echo -lsocket -lnsl || exit 0 ) > socket.lib
	rm -f trylsock.o trylsock

spawn.o: \
compile chkspawn spawn.c 
	./chkspawn
	./compile spawn.c

spfdnsip.o: \
compile spfdnsip.c 
	./compile spfdnsip.c 

spf.o: \
compile spf.c 
	./compile spf.c

spfquery: \
load spfquery.o spf.o ipme.o ipalloc.o now.o dns.o \
spfdnsip.o datetime.a dns.lib qlibs.lib
	./load spfquery spf.o ipme.o ipalloc.o spfdnsip.o \
	now.o dns.o datetime.a `cat dns.lib` `cat socket.lib` `cat qlibs.lib`

spfquery.o: \
compile spfquery.c 
	./compile spfquery.c 

splogger: \
load splogger.o syslog.lib socket.lib qlibs.lib
	./load splogger  `cat syslog.lib` `cat socket.lib` `cat qlibs.lib`

splogger.o: \
compile splogger.c 
	./compile splogger.c 

srs2.o: \
	compile srs2.c 
	./compile srs2.c

srsforward: \
load srsforward.o qmail.o auto_qmail.o control.o constmap.o \
srs2.o sha1.o \
qlibs.lib 
	./load srsforward qmail.o auto_qmail.o control.o constmap.o \
	srs2.o sha1.o `cat qlibs.lib` 

srsforward.o: \
compile srsforward.c 
	./compile srsforward.c

srsreverse: \
load srsreverse.o qmail.o auto_break.o auto_qmail.o \
control.o constmap.o srs2.o sha1.o qlibs.lib
	./load srsreverse qmail.o auto_break.o auto_qmail.o \
	control.o constmap.o srs2.o sha1.o \
	`cat qlibs.lib` 

srsreverse.o: \
compile srsreverse.c 
	./compile srsreverse.c

strset.o: \
compile strset.c 
	./compile strset.c

syslog.lib: \
trysyslog.c compile load
	( ( ./compile trysyslog.c && \
	./load trysyslog -lgen ) >/dev/null 2>&1 \
	&& echo -lgen || exit 0 ) > syslog.lib
	rm -f trysyslog.o trysyslog

systype: \
find-systype trycpp.c
	./find-systype > systype

tai64nfrac: \
load tai64nfrac.o qlibs.lib
	./load tai64nfrac `cat qlibs.lib` 
	
tai64nfrac.o: \
compile tai64nfrac.c 
	./compile tai64nfrac.c

tcpto.o: \
compile tcpto.c 
	./compile tcpto.c

tcpto_clean.o: \
compile tcpto_clean.c 
	./compile tcpto_clean.c

tls_errors.o: \
compile tls_errors.c 
	./compile tls_errors.c

tls_remote.o: \
compile tls_remote.c 
	./compile tls_remote.c

tls_start.o: \
compile tls_start.c 
	./compile tls_start.c tls_errors.c

tls_timeoutio.o: \
compile tls_timeoutio.c 
	./compile tls_timeoutio.c

token822.o: \
compile token822.c 
	./compile token822.c

trigger.o: \
compile trigger.c 
	./compile trigger.c

triggerpull.o: \
compile triggerpull.c 
	./compile triggerpull.c

wildmat.o: \
compile wildmat.c
	./compile wildmat.c

xqp: \
warn-auto.sh xqp.sh ../conf-home
	cat warn-auto.sh xqp.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> xqp
	chmod 755 xqp

xrecipient: \
warn-auto.sh xrecipient.sh ../conf-home
	cat warn-auto.sh xrecipient.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> xrecipient
	chmod 755 xrecipient

xsender: \
warn-auto.sh xsender.sh ../conf-home
	cat warn-auto.sh xsender.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> xsender
	chmod 755 xsender

zddist: \
warn-auto.sh zddist.sh ../conf-home
	cat warn-auto.sh zddist.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> zddist
	chmod 755 zddist

zdeferrals: \
warn-auto.sh zdeferrals.sh ../conf-home
	cat warn-auto.sh zdeferrals.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> zdeferrals
	chmod 755 zdeferrals

zfailures: \
warn-auto.sh zfailures.sh ../conf-home
	cat warn-auto.sh zfailures.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> zfailures
	chmod 755 zfailures

zoverall: \
warn-auto.sh zoverall.sh ../conf-home
	cat warn-auto.sh zoverall.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> zoverall
	chmod 755 zoverall

zrecipients: \
warn-auto.sh zrecipients.sh ../conf-home
	cat warn-auto.sh zrecipients.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> zrecipients
	chmod 755 zrecipients

zrhosts: \
warn-auto.sh zrhosts.sh ../conf-home
	cat warn-auto.sh zrhosts.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> zrhosts
	chmod 755 zrhosts

zrxdelay: \
warn-auto.sh zrxdelay.sh ../conf-home
	cat warn-auto.sh zrxdelay.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> zrxdelay
	chmod 755 zrxdelay

zsenders: \
warn-auto.sh zsenders.sh ../conf-home
	cat warn-auto.sh zsenders.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> zsenders
	chmod 755 zsenders

zsendmail: \
warn-auto.sh zsendmail.sh ../conf-home
	cat warn-auto.sh zsendmail.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> zsendmail
	chmod 755 zsendmail

zsuccesses: \
warn-auto.sh zsuccesses.sh ../conf-home
	cat warn-auto.sh zsuccesses.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> zsuccesses
	chmod 755 zsuccesses

zsuids: \
warn-auto.sh zsuids.sh ../conf-home
	cat warn-auto.sh zsuids.sh \
	| sed s}HOME}"`head -1 ../conf-home`"}g \
	> zsuids
	chmod 755 zsuids

# cpp sources

SRCS = dkim.cpp dkimbase.cpp dkimsign.cpp dkimverify.cpp
OBJS = $(SRCS:.cpp=.o)

.cpp.o:
	g++ -O2   $< $*

libqdkim.a: $(OBJS)
	@rm -f libqdkim.a
	ar cr libqdkim.a $(OBJS) 
	ranlib libqdkim.a