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

SHELL=/bin/sh

default: it

alloc.a: \
makelib alloc.o alloc_re.o getln.o getln2.o stralloc_cat.o \
stralloc_catb.o stralloc_cats.o stralloc_copy.o stralloc_eady.o \
stralloc_num.o stralloc_opyb.o stralloc_opys.o stralloc_pend.o
	./makelib alloc.a alloc.o alloc_re.o getln.o getln2.o \
	stralloc_cat.o stralloc_catb.o stralloc_cats.o \
	stralloc_copy.o stralloc_eady.o stralloc_num.o \
	stralloc_opyb.o stralloc_opys.o stralloc_pend.o

alloc.o: \
compile alloc.c alloc.h error.h
	./compile alloc.c

alloc_re.o: \
compile alloc_re.c alloc.h byte.h
	./compile alloc_re.c

auto-str: \
load auto-str.o buffer.a unix.a byte.a
	./load auto-str buffer.a unix.a byte.a 

auto-str.o: \
compile auto-str.c buffer.h exit.h
	./compile auto-str.c

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

auto_home.o: \
compile auto_home.c
	./compile auto_home.c

axfr-get: \
load axfr-get.o iopause.o timeoutread.o timeoutwrite.o dns.a libtai.a \
alloc.a buffer.a unix.a byte.a
	./load axfr-get iopause.o timeoutread.o timeoutwrite.o \
	dns.a libtai.a alloc.a buffer.a unix.a byte.a 

axfr-get.o: \
compile axfr-get.c uint32.h uint16.h stralloc.h gen_alloc.h error.h \
strerr.h getln.h buffer.h stralloc.h buffer.h exit.h open.h scan.h \
byte.h str.h ip4.h timeoutread.h timeoutwrite.h dns.h stralloc.h \
iopause.h taia.h tai.h uint64.h taia.h
	./compile axfr-get.c

axfrdns: \
load axfrdns.o iopause.o droproot.o tdlookup.o response.o qlog.o \
prot.o timeoutread.o timeoutwrite.o clientloc.o dns.a libtai.a alloc.a env.a \
cdb.a buffer.a unix.a byte.a
	./load axfrdns iopause.o droproot.o tdlookup.o response.o \
	qlog.o prot.o timeoutread.o timeoutwrite.o clientloc.o dns.a libtai.a \
	alloc.a env.a cdb.a buffer.a unix.a byte.a 

axfrdns-conf: \
load axfrdns-conf.o generic-conf.o auto_home.o buffer.a unix.a byte.a
	./load axfrdns-conf generic-conf.o auto_home.o buffer.a \
	unix.a byte.a 

axfrdns-conf.o: \
compile axfrdns-conf.c strerr.h exit.h auto_home.h generic-conf.h \
buffer.h
	./compile axfrdns-conf.c

axfrdns.o: \
compile axfrdns.c droproot.h exit.h env.h uint32.h uint16.h ip4.h \
tai.h uint64.h buffer.h timeoutread.h timeoutwrite.h open.h seek.h \
cdb.h uint32.h stralloc.h gen_alloc.h strerr.h str.h byte.h case.h \
dns.h stralloc.h iopause.h taia.h tai.h taia.h scan.h qlog.h uint16.h \
response.h uint32.h clientloc.h
	./compile axfrdns.c

buffer.a: \
makelib buffer.o buffer_1.o buffer_2.o buffer_copy.o buffer_get.o \
buffer_put.o strerr_die.o strerr_sys.o
	./makelib buffer.a buffer.o buffer_1.o buffer_2.o \
	buffer_copy.o buffer_get.o buffer_put.o strerr_die.o \
	strerr_sys.o

buffer.o: \
compile buffer.c buffer.h
	./compile buffer.c

buffer_1.o: \
compile buffer_1.c buffer.h
	./compile buffer_1.c

buffer_2.o: \
compile buffer_2.c buffer.h
	./compile buffer_2.c

buffer_copy.o: \
compile buffer_copy.c buffer.h
	./compile buffer_copy.c

buffer_get.o: \
compile buffer_get.c buffer.h byte.h error.h
	./compile buffer_get.c

buffer_put.o: \
compile buffer_put.c buffer.h str.h byte.h error.h
	./compile buffer_put.c

buffer_read.o: \
compile buffer_read.c buffer.h
	./compile buffer_read.c

buffer_write.o: \
compile buffer_write.c buffer.h
	./compile buffer_write.c

byte.a: \
makelib byte_chr.o byte_copy.o byte_cr.o byte_diff.o byte_zero.o \
case_diffb.o case_diffs.o case_lowerb.o fmt_ulong.o ip4_fmt.o \
ip4_scan.o scan_ulong.o str_chr.o str_diff.o str_len.o str_rchr.o \
str_start.o uint16_pack.o uint16_unpack.o uint32_pack.o \
uint32_unpack.o ip6_fmt.o ip6_scan.o fmt_xlong.o \
scan_xlong.o
	./makelib byte.a byte_chr.o byte_copy.o byte_cr.o \
	byte_diff.o byte_zero.o case_diffb.o case_diffs.o \
	case_lowerb.o fmt_ulong.o ip4_fmt.o ip4_scan.o scan_ulong.o \
	str_chr.o str_diff.o str_len.o str_rchr.o str_start.o \
	uint16_pack.o uint16_unpack.o uint32_pack.o uint32_unpack.o \
	ip6_fmt.o ip6_scan.o fmt_xlong.o scan_xlong.o

byte_chr.o: \
compile byte_chr.c byte.h
	./compile byte_chr.c

byte_copy.o: \
compile byte_copy.c byte.h
	./compile byte_copy.c

byte_cr.o: \
compile byte_cr.c byte.h
	./compile byte_cr.c

byte_diff.o: \
compile byte_diff.c byte.h
	./compile byte_diff.c

byte_zero.o: \
compile byte_zero.c byte.h
	./compile byte_zero.c

cache.o: \
compile cache.c alloc.h byte.h uint32.h exit.h tai.h uint64.h cache.h \
uint32.h uint64.h
	./compile cache.c

cachetest: \
load cachetest.o cache.o libtai.a buffer.a alloc.a unix.a byte.a
	./load cachetest cache.o libtai.a buffer.a alloc.a unix.a \
	byte.a 

cachetest.o: \
compile cachetest.c buffer.h exit.h cache.h uint32.h uint64.h str.h
	./compile cachetest.c

case_diffb.o: \
compile case_diffb.c case.h
	./compile case_diffb.c

case_diffs.o: \
compile case_diffs.c case.h
	./compile case_diffs.c

case_lowerb.o: \
compile case_lowerb.c case.h
	./compile case_lowerb.c

cdb.a: \
makelib cdb.o cdb_hash.o cdb_make.o
	./makelib cdb.a cdb.o cdb_hash.o cdb_make.o

cdb.o: \
compile cdb.c error.h seek.h byte.h cdb.h uint32.h
	./compile cdb.c

cdb_hash.o: \
compile cdb_hash.c cdb.h uint32.h
	./compile cdb_hash.c

cdb_make.o: \
compile cdb_make.c seek.h error.h alloc.h cdb.h uint32.h cdb_make.h \
buffer.h uint32.h
	./compile cdb_make.c

check: \
it instcheck
	./instcheck

chkshsgr: \
load chkshsgr.o
	./load chkshsgr 

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

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

clientloc.o: \
compile clientloc.c open.h byte.h cdb.h ip6.h
	./compile clientloc.c

compile: \
warn-auto.sh conf-cc
	( cat warn-auto.sh; \
	echo exec "`head -1 conf-cc`" '-c $${1+"$$@"}' \
	) > compile
	chmod 755 compile

dd.o: \
compile dd.c dns.h stralloc.h gen_alloc.h iopause.h taia.h tai.h \
uint64.h taia.h dd.h
	./compile dd.c

direntry.h: \
choose compile trydrent.c direntry.h1 direntry.h2
	./choose c trydrent direntry.h1 direntry.h2 > direntry.h

dns.a: \
makelib dns_dfd.o dns_domain.o dns_dtda.o dns_ip.o dns_ipq.o dns_mx.o \
dns_name.o dns_nd.o dns_packet.o dns_random.o dns_rcip.o dns_rcrw.o \
dns_resolve.o dns_sortip.o dns_transmit.o dns_txt.o dns_ip6.o \
dns_sortip6.o dns_nd6.o dns_ipq6.o
	./makelib dns.a dns_dfd.o dns_domain.o dns_dtda.o dns_ip.o \
	dns_ipq.o dns_mx.o dns_name.o dns_nd.o dns_packet.o \
	dns_random.o dns_rcip.o dns_rcrw.o dns_resolve.o \
	dns_sortip.o dns_transmit.o dns_txt.o dns_ip6.o dns_sortip6.o \
	dns_nd6.o dns_ipq6.o

dns_dfd.o: \
compile dns_dfd.c error.h alloc.h byte.h dns.h stralloc.h gen_alloc.h \
iopause.h taia.h tai.h uint64.h taia.h
	./compile dns_dfd.c

dns_domain.o: \
compile dns_domain.c error.h alloc.h case.h byte.h dns.h stralloc.h \
gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dns_domain.c

dns_dtda.o: \
compile dns_dtda.c stralloc.h gen_alloc.h dns.h stralloc.h iopause.h \
taia.h tai.h uint64.h taia.h
	./compile dns_dtda.c

dns_ip.o: \
compile dns_ip.c stralloc.h gen_alloc.h uint16.h byte.h dns.h \
stralloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dns_ip.c

dns_ip6.o: \
compile dns_ip6.c stralloc.h gen_alloc.h uint16.h byte.h dns.h \
stralloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dns_ip6.c

dns_ipq.o: \
compile dns_ipq.c stralloc.h gen_alloc.h case.h byte.h str.h dns.h \
stralloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dns_ipq.c

dns_ipq6.o: \
compile dns_ipq6.c stralloc.h gen_alloc.h case.h byte.h str.h dns.h \
stralloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dns_ipq6.c

dns_mx.o: \
compile dns_mx.c stralloc.h gen_alloc.h byte.h uint16.h dns.h \
stralloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dns_mx.c

dns_name.o: \
compile dns_name.c stralloc.h gen_alloc.h uint16.h byte.h dns.h \
stralloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dns_name.c

dns_nd.o: \
compile dns_nd.c byte.h fmt.h dns.h stralloc.h gen_alloc.h iopause.h \
taia.h tai.h uint64.h taia.h
	./compile dns_nd.c

dns_nd6.o: \
compile dns_nd6.c byte.h fmt.h dns.h stralloc.h gen_alloc.h iopause.h \
taia.h tai.h uint64.h taia.h
	./compile dns_nd6.c

dns_packet.o: \
compile dns_packet.c error.h dns.h stralloc.h gen_alloc.h iopause.h \
taia.h tai.h uint64.h taia.h
	./compile dns_packet.c

dns_random.o: \
compile dns_random.c dns.h stralloc.h gen_alloc.h iopause.h taia.h \
tai.h uint64.h taia.h taia.h uint32.h
	./compile dns_random.c

dns_rcip.o: \
compile dns_rcip.c taia.h tai.h uint64.h openreadclose.h stralloc.h \
gen_alloc.h byte.h ip4.h env.h dns.h stralloc.h iopause.h taia.h \
taia.h
	./compile dns_rcip.c

dns_rcrw.o: \
compile dns_rcrw.c taia.h tai.h uint64.h env.h byte.h str.h \
openreadclose.h stralloc.h gen_alloc.h dns.h stralloc.h iopause.h \
taia.h taia.h
	./compile dns_rcrw.c

dns_resolve.o: \
compile dns_resolve.c iopause.h taia.h tai.h uint64.h taia.h byte.h \
dns.h stralloc.h gen_alloc.h iopause.h taia.h
	./compile dns_resolve.c

dns_sortip.o: \
compile dns_sortip.c byte.h dns.h stralloc.h gen_alloc.h iopause.h \
taia.h tai.h uint64.h taia.h
	./compile dns_sortip.c

dns_sortip6.o: \
compile dns_sortip6.c byte.h dns.h stralloc.h gen_alloc.h iopause.h \
taia.h tai.h uint64.h taia.h
	./compile dns_sortip6.c

dns_transmit.o: \
compile dns_transmit.c socket.h uint16.h alloc.h error.h byte.h \
uint16.h dns.h stralloc.h gen_alloc.h iopause.h taia.h tai.h uint64.h \
taia.h
	./compile dns_transmit.c

dns_txt.o: \
compile dns_txt.c stralloc.h gen_alloc.h uint16.h byte.h dns.h \
stralloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dns_txt.c

dnscache: \
load dnscache.o droproot.o okclient.o log.o cache.o query.o \
response.o dd.o roots.o iopause.o prot.o dns.a env.a alloc.a buffer.a \
libtai.a unix.a byte.a socket.lib
	./load dnscache droproot.o okclient.o log.o cache.o \
	query.o response.o dd.o roots.o iopause.o prot.o dns.a \
	env.a alloc.a buffer.a libtai.a unix.a byte.a  `cat \
	socket.lib`

dnscache-conf: \
load dnscache-conf.o generic-conf.o auto_home.o libtai.a buffer.a \
unix.a byte.a
	./load dnscache-conf generic-conf.o auto_home.o libtai.a \
	buffer.a unix.a byte.a 

dnscache-conf.o: \
compile dnscache-conf.c hasdevtcp.h strerr.h buffer.h uint32.h taia.h \
tai.h uint64.h str.h open.h error.h exit.h auto_home.h generic-conf.h \
buffer.h
	./compile dnscache-conf.c

dnscache.o: \
compile dnscache.c env.h exit.h scan.h strerr.h error.h ip4.h \
uint16.h uint64.h socket.h uint16.h dns.h stralloc.h gen_alloc.h \
iopause.h taia.h tai.h uint64.h taia.h taia.h byte.h roots.h fmt.h \
iopause.h query.h dns.h uint32.h alloc.h response.h uint32.h cache.h \
uint32.h uint64.h ndelay.h log.h uint64.h okclient.h droproot.h
	./compile dnscache.c

dnsfilter: \
load dnsfilter.o iopause.o getopt.a dns.a env.a libtai.a alloc.a \
buffer.a unix.a byte.a socket.lib
	./load dnsfilter iopause.o getopt.a dns.a env.a libtai.a \
	alloc.a buffer.a unix.a byte.a  `cat socket.lib`

dnsfilter.o: \
compile dnsfilter.c strerr.h buffer.h stralloc.h gen_alloc.h alloc.h \
dns.h stralloc.h iopause.h taia.h tai.h uint64.h taia.h ip4.h byte.h \
scan.h taia.h sgetopt.h subgetopt.h iopause.h error.h exit.h
	./compile dnsfilter.c

dnsip: \
load dnsip.o iopause.o dns.a env.a libtai.a alloc.a buffer.a unix.a \
byte.a socket.lib
	./load dnsip iopause.o dns.a env.a libtai.a alloc.a \
	buffer.a unix.a byte.a  `cat socket.lib`

dnsip.o: \
compile dnsip.c buffer.h exit.h strerr.h ip4.h dns.h stralloc.h \
gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dnsip.c

dnsip6: \
load dnsip6.o iopause.o dns.a env.a libtai.a alloc.a buffer.a unix.a \
byte.a socket.lib
	./load dnsip6 iopause.o dns.a env.a libtai.a alloc.a \
	buffer.a unix.a byte.a  `cat socket.lib`

dnsip6.o: \
compile dnsip6.c buffer.h exit.h strerr.h ip6.h dns.h stralloc.h \
gen_alloc.h iopause.h taia.h tai.h uint64.h
	./compile dnsip6.c

dnsipq: \
load dnsipq.o iopause.o dns.a env.a libtai.a alloc.a buffer.a unix.a \
byte.a socket.lib
	./load dnsipq iopause.o dns.a env.a libtai.a alloc.a \
	buffer.a unix.a byte.a  `cat socket.lib`

dnsipq.o: \
compile dnsipq.c buffer.h exit.h strerr.h ip4.h dns.h stralloc.h \
gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dnsipq.c

dnsip6q: \
load dnsip6q.o iopause.o dns.a env.a libtai.a alloc.a buffer.a unix.a \
byte.a socket.lib
	./load dnsip6q iopause.o dns.a env.a libtai.a alloc.a \
	buffer.a unix.a byte.a  `cat socket.lib`

dnsip6q.o: \
compile dnsip6q.c buffer.h exit.h strerr.h ip4.h dns.h stralloc.h \
gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dnsip6q.c

dnsmx: \
load dnsmx.o iopause.o dns.a env.a libtai.a alloc.a buffer.a unix.a \
byte.a socket.lib
	./load dnsmx iopause.o dns.a env.a libtai.a alloc.a \
	buffer.a unix.a byte.a  `cat socket.lib`

dnsmx.o: \
compile dnsmx.c buffer.h exit.h strerr.h uint16.h byte.h str.h fmt.h \
dns.h stralloc.h gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dnsmx.c

dnsname: \
load dnsname.o iopause.o dns.a env.a libtai.a alloc.a buffer.a unix.a \
byte.a socket.lib
	./load dnsname iopause.o dns.a env.a libtai.a alloc.a \
	buffer.a unix.a byte.a  `cat socket.lib`

dnsname.o: \
compile dnsname.c buffer.h exit.h strerr.h ip4.h dns.h stralloc.h \
gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h ip6.h
	./compile dnsname.c

dnsq: \
load dnsq.o iopause.o printrecord.o printpacket.o parsetype.o dns.a \
env.a libtai.a buffer.a alloc.a unix.a byte.a socket.lib
	./load dnsq iopause.o printrecord.o printpacket.o \
	parsetype.o dns.a env.a libtai.a buffer.a alloc.a unix.a \
	byte.a  `cat socket.lib`

dnsq.o: \
compile dnsq.c uint16.h strerr.h buffer.h scan.h str.h byte.h error.h \
ip4.h iopause.h taia.h tai.h uint64.h printpacket.h stralloc.h \
gen_alloc.h parsetype.h dns.h stralloc.h iopause.h taia.h
	./compile dnsq.c

dnsqr: \
load dnsqr.o iopause.o printrecord.o printpacket.o parsetype.o dns.a \
env.a libtai.a buffer.a alloc.a unix.a byte.a socket.lib
	./load dnsqr iopause.o printrecord.o printpacket.o \
	parsetype.o dns.a env.a libtai.a buffer.a alloc.a unix.a \
	byte.a  `cat socket.lib`

dnsqr.o: \
compile dnsqr.c uint16.h strerr.h buffer.h scan.h str.h byte.h \
error.h iopause.h taia.h tai.h uint64.h printpacket.h stralloc.h \
gen_alloc.h parsetype.h dns.h stralloc.h iopause.h taia.h
	./compile dnsqr.c

dnstrace: \
load dnstrace.o dd.o iopause.o printrecord.o parsetype.o dns.a env.a \
libtai.a alloc.a buffer.a unix.a byte.a socket.lib
	./load dnstrace dd.o iopause.o printrecord.o parsetype.o \
	dns.a env.a libtai.a alloc.a buffer.a unix.a byte.a  `cat \
	socket.lib`

dnstrace.o: \
compile dnstrace.c uint16.h uint32.h fmt.h str.h byte.h ip4.h \
gen_alloc.h gen_allocdefs.h exit.h buffer.h stralloc.h gen_alloc.h \
error.h strerr.h iopause.h taia.h tai.h uint64.h printrecord.h \
stralloc.h alloc.h parsetype.h dd.h dns.h stralloc.h iopause.h taia.h
	./compile dnstrace.c

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

dnstxt: \
load dnstxt.o iopause.o dns.a env.a libtai.a alloc.a buffer.a unix.a \
byte.a socket.lib
	./load dnstxt iopause.o dns.a env.a libtai.a alloc.a \
	buffer.a unix.a byte.a  `cat socket.lib`

dnstxt.o: \
compile dnstxt.c buffer.h exit.h strerr.h dns.h stralloc.h \
gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile dnstxt.c

droproot.o: \
compile droproot.c env.h scan.h prot.h strerr.h
	./compile droproot.c

env.a: \
makelib env.o
	./makelib env.a env.o

env.o: \
compile env.c str.h env.h
	./compile env.c

error.o: \
compile error.c error.h
	./compile error.c

error_str.o: \
compile error_str.c error.h
	./compile error_str.c

fmt_ulong.o: \
compile fmt_ulong.c fmt.h
	./compile fmt_ulong.c

fmt_xlong.o: \
compile fmt_xlong.c scan.h
	./compile fmt_xlong.c

generic-conf.o: \
compile generic-conf.c strerr.h buffer.h open.h generic-conf.h \
buffer.h
	./compile generic-conf.c

getln.o: \
compile getln.c byte.h getln.h buffer.h stralloc.h gen_alloc.h
	./compile getln.c

getln2.o: \
compile getln2.c byte.h getln.h buffer.h stralloc.h gen_alloc.h
	./compile getln2.c

getopt.a: \
makelib sgetopt.o subgetopt.o
	./makelib getopt.a sgetopt.o subgetopt.o

hasdevtcp.h: \
systype hasdevtcp.h1 hasdevtcp.h2
	( case "`cat systype`" in \
	  sunos-5.*) cat hasdevtcp.h2 ;; \
	  *) cat hasdevtcp.h1 ;; \
	esac ) > hasdevtcp.h

hasshsgr.h: \
choose compile load tryshsgr.c hasshsgr.h1 hasshsgr.h2 chkshsgr \
warn-shsgr
	./chkshsgr || ( cat warn-shsgr; exit 1 )
	./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h

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

install: \
load install.o hier.o auto_home.o buffer.a unix.a byte.a
	./load install hier.o auto_home.o buffer.a unix.a byte.a 

install.o: \
compile install.c buffer.h strerr.h error.h open.h exit.h
	./compile install.c

instcheck: \
load instcheck.o hier.o auto_home.o buffer.a unix.a byte.a
	./load instcheck hier.o auto_home.o buffer.a unix.a byte.a 

instcheck.o: \
compile instcheck.c strerr.h error.h exit.h
	./compile instcheck.c

iopause.h: \
choose compile load trypoll.c iopause.h1 iopause.h2
	./choose clr trypoll iopause.h1 iopause.h2 > iopause.h

iopause.o: \
compile iopause.c taia.h tai.h uint64.h select.h iopause.h taia.h
	./compile iopause.c

ip4_fmt.o: \
compile ip4_fmt.c fmt.h ip4.h
	./compile ip4_fmt.c

ip6_fmt.o: \
compile ip6_fmt.c fmt.h ip6.h
	./compile ip6_fmt.c

ip4_scan.o: \
compile ip4_scan.c scan.h ip4.h
	./compile ip4_scan.c

ip6_scan.o: \
compile ip6_scan.c scan.h ip6.h
	./compile ip6_scan.c

it: \
prog install instcheck

libtai.a: \
makelib tai_add.o tai_now.o tai_pack.o tai_sub.o tai_uint.o \
tai_unpack.o taia_add.o taia_approx.o taia_frac.o taia_less.o \
taia_now.o taia_pack.o taia_sub.o taia_tai.o taia_uint.o
	./makelib libtai.a tai_add.o tai_now.o tai_pack.o \
	tai_sub.o tai_uint.o tai_unpack.o taia_add.o taia_approx.o \
	taia_frac.o taia_less.o taia_now.o taia_pack.o taia_sub.o \
	taia_tai.o taia_uint.o

load: \
warn-auto.sh conf-ld
	( cat warn-auto.sh; \
	echo 'main="$$1"; shift'; \
	echo exec "`head -1 conf-ld`" \
	'-o "$$main" "$$main".o $${1+"$$@"}' \
	) > load
	chmod 755 load

log.o: \
compile log.c buffer.h uint32.h uint16.h error.h byte.h log.h \
uint64.h
	./compile log.c

makelib: \
warn-auto.sh systype
	( cat warn-auto.sh; \
	echo 'main="$$1"; shift'; \
	echo 'rm -f "$$main"'; \
	echo 'ar cr "$$main" $${1+"$$@"}'; \
	case "`cat systype`" in \
	sunos-5.*) ;; \
	unix_sv*) ;; \
	irix64-*) ;; \
	irix-*) ;; \
	dgux-*) ;; \
	hp-ux-*) ;; \
	sco*) ;; \
	*) echo 'ranlib "$$main"' ;; \
	esac \
	) > makelib
	chmod 755 makelib

ndelay_off.o: \
compile ndelay_off.c ndelay.h
	./compile ndelay_off.c

ndelay_on.o: \
compile ndelay_on.c ndelay.h
	./compile ndelay_on.c

okclient.o: \
compile okclient.c str.h ip4.h okclient.h
	./compile okclient.c

open_read.o: \
compile open_read.c open.h
	./compile open_read.c

open_trunc.o: \
compile open_trunc.c open.h
	./compile open_trunc.c

openreadclose.o: \
compile openreadclose.c error.h open.h readclose.h stralloc.h \
gen_alloc.h openreadclose.h stralloc.h
	./compile openreadclose.c

parsetype.o: \
compile parsetype.c scan.h byte.h case.h dns.h stralloc.h gen_alloc.h \
iopause.h taia.h tai.h uint64.h taia.h uint16.h parsetype.h
	./compile parsetype.c

pickdns: \
load pickdns.o server.o iopause.o response.o droproot.o qlog.o prot.o dns.a \
env.a libtai.a cdb.a alloc.a buffer.a unix.a byte.a socket.lib
	./load pickdns server.o iopause.o response.o droproot.o qlog.o \
	prot.o dns.a env.a libtai.a cdb.a alloc.a buffer.a unix.a \
	byte.a  `cat socket.lib`

pickdns-conf: \
load pickdns-conf.o generic-conf.o auto_home.o buffer.a unix.a byte.a
	./load pickdns-conf generic-conf.o auto_home.o buffer.a \
	unix.a byte.a 

pickdns-conf.o: \
compile pickdns-conf.c strerr.h exit.h auto_home.h generic-conf.h \
buffer.h
	./compile pickdns-conf.c

pickdns-data: \
load pickdns-data.o cdb.a dns.a alloc.a buffer.a unix.a byte.a
	./load pickdns-data cdb.a dns.a alloc.a buffer.a unix.a \
	byte.a 

pickdns-data.o: \
compile pickdns-data.c buffer.h exit.h cdb_make.h buffer.h uint32.h \
open.h alloc.h gen_allocdefs.h stralloc.h gen_alloc.h getln.h \
buffer.h stralloc.h case.h strerr.h str.h byte.h scan.h fmt.h ip4.h \
dns.h stralloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile pickdns-data.c

pickdns.o: \
compile pickdns.c byte.h case.h dns.h stralloc.h gen_alloc.h \
iopause.h taia.h tai.h uint64.h taia.h open.h cdb.h uint32.h \
response.h uint32.h
	./compile pickdns.c

printpacket.o: \
compile printpacket.c uint16.h uint32.h error.h byte.h dns.h \
stralloc.h gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h \
printrecord.h stralloc.h printpacket.h stralloc.h
	./compile printpacket.c

printrecord.o: \
compile printrecord.c uint16.h uint32.h error.h byte.h dns.h \
stralloc.h gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h \
printrecord.h stralloc.h
	./compile printrecord.c

prog: \
dnscache-conf dnscache walldns-conf walldns rbldns-conf rbldns \
rbldns-data pickdns-conf pickdns pickdns-data tinydns-conf tinydns \
tinydns-data tinydns-get tinydns-edit axfr-get axfrdns-conf axfrdns \
dnsip dnsipq dnsname dnstxt dnsmx dnsfilter random-ip dnsqr dnsq \
dnstrace dnstracesort cachetest utime rts dnsip6 dnsip6q

prot.o: \
compile prot.c hasshsgr.h prot.h
	./compile prot.c

qlog.o: \
compile qlog.c buffer.h qlog.h uint16.h
	./compile qlog.c

query.o: \
compile query.c error.h roots.h log.h uint64.h case.h cache.h \
uint32.h uint64.h byte.h dns.h stralloc.h gen_alloc.h iopause.h \
taia.h tai.h uint64.h taia.h uint64.h uint32.h uint16.h dd.h alloc.h \
response.h uint32.h query.h dns.h uint32.h
	./compile query.c

random-ip: \
load random-ip.o dns.a libtai.a buffer.a unix.a byte.a
	./load random-ip dns.a libtai.a buffer.a unix.a byte.a 

random-ip.o: \
compile random-ip.c buffer.h exit.h fmt.h scan.h dns.h stralloc.h \
gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile random-ip.c

rbldns: \
load rbldns.o server.o iopause.o response.o dd.o droproot.o qlog.o prot.o dns.a \
env.a libtai.a cdb.a alloc.a buffer.a unix.a byte.a socket.lib
	./load rbldns server.o iopause.o response.o dd.o droproot.o qlog.o \
	prot.o dns.a env.a libtai.a cdb.a alloc.a buffer.a unix.a \
	byte.a  `cat socket.lib`

rbldns-conf: \
load rbldns-conf.o generic-conf.o auto_home.o buffer.a unix.a byte.a
	./load rbldns-conf generic-conf.o auto_home.o buffer.a \
	unix.a byte.a 

rbldns-conf.o: \
compile rbldns-conf.c strerr.h exit.h auto_home.h generic-conf.h \
buffer.h
	./compile rbldns-conf.c

rbldns-data: \
load rbldns-data.o cdb.a alloc.a buffer.a unix.a byte.a
	./load rbldns-data cdb.a alloc.a buffer.a unix.a byte.a 

rbldns-data.o: \
compile rbldns-data.c buffer.h exit.h cdb_make.h buffer.h uint32.h \
open.h stralloc.h gen_alloc.h getln.h buffer.h stralloc.h strerr.h \
byte.h scan.h fmt.h ip4.h
	./compile rbldns-data.c

rbldns.o: \
compile rbldns.c str.h byte.h ip4.h open.h env.h cdb.h uint32.h dns.h \
stralloc.h gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h dd.h \
strerr.h response.h uint32.h
	./compile rbldns.c

readclose.o: \
compile readclose.c error.h readclose.h stralloc.h gen_alloc.h
	./compile readclose.c

response.o: \
compile response.c dns.h stralloc.h gen_alloc.h iopause.h taia.h \
tai.h uint64.h taia.h byte.h uint16.h response.h uint32.h
	./compile response.c

roots.o: \
compile roots.c open.h error.h str.h byte.h error.h direntry.h ip4.h \
dns.h stralloc.h gen_alloc.h iopause.h taia.h tai.h uint64.h taia.h \
openreadclose.h stralloc.h roots.h
	./compile roots.c

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

scan_ulong.o: \
compile scan_ulong.c scan.h
	./compile scan_ulong.c

scan_xlong.o: \
compile scan_xlong.c scan.h
	./compile scan_xlong.c

seek_set.o: \
compile seek_set.c seek.h
	./compile seek_set.c

select.h: \
choose compile trysysel.c select.h1 select.h2
	./choose c trysysel select.h1 select.h2 > select.h

server.o: \
compile server.c byte.h case.h env.h buffer.h strerr.h ip4.h uint16.h \
ndelay.h socket.h uint16.h droproot.h qlog.h uint16.h response.h \
uint32.h dns.h stralloc.h gen_alloc.h iopause.h taia.h tai.h uint64.h \
taia.h iopause.h alloc.h str.h
	./compile server.c

setup: \
it install
	./install

sgetopt.o: \
compile sgetopt.c buffer.h sgetopt.h subgetopt.h subgetopt.h
	./compile sgetopt.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

socket_accept.o: \
compile socket_accept.c byte.h socket.h uint16.h
	./compile socket_accept.c

socket_accept6.o: \
compile socket_accept6.c byte.h socket.h uint16.h
	./compile socket_accept6.c

socket_bind.o: \
compile socket_bind.c byte.h socket.h uint16.h
	./compile socket_bind.c

socket_bind6.o: \
compile socket_bind6.c sockaddr_in6.h haveip6.h byte.h socket.h uint16.h uint32.h ip6.h error.h
	./compile socket_bind6.c

socket_conn.o: \
compile socket_conn.c byte.h socket.h uint16.h
	./compile socket_conn.c

socket_connect6.o: \
compile socket_connect6.c byte.h socket.h uint16.h uint32.h
	./compile socket_connect6.c

socket_listen.o: \
compile socket_listen.c socket.h uint16.h
	./compile socket_listen.c

socket_recv.o: \
compile socket_recv.c byte.h socket.h uint16.h
	./compile socket_recv.c

socket_recv6.o: \
compile socket_recv6.c sockaddr_in6.h haveip6.h byte.h socket.h uint16.h uint32.h ip6.h error.h
	./compile socket_recv6.c

socket_send.o: \
compile socket_send.c byte.h socket.h uint16.h
	./compile socket_send.c

socket_send6.o: \
compile socket_send6.c byte.h socket.h uint16.h uint32.h ip6.h haveip6.h error.h
	./compile socket_send6.c

socket_tcp.o: \
compile socket_tcp.c ndelay.h socket.h uint16.h
	./compile socket_tcp.c

socket_tcp6.o: \
compile socket_tcp6.c ndelay.h socket.h uint16.h uint32.h haveip6.h
	./compile socket_tcp6.c

socket_udp.o: \
compile socket_udp.c ndelay.h socket.h uint16.h
	./compile socket_udp.c

socket_udp6.o: \
compile socket_udp6.c ndelay.h socket.h uint16.h uint32.h haveip6.h
	./compile socket_udp6.c

socket_noipv6.o: \
compile socket_noipv6.c haveip6.h
	./compile socket_noipv6.c

socket_getifidx.o: \
compile socket_getifidx.c socket.h uint16.h uint32.h haven2i.h
	./compile socket_getifidx.c

haven2i.h: \
tryn2i.c choose compile load socket.lib haven2i.h1 haven2i.h2
	cp /dev/null haven2i.h
	./choose cL tryn2i haven2i.h1 haven2i.h2 socket > haven2i.h

str_chr.o: \
compile str_chr.c str.h
	./compile str_chr.c

str_diff.o: \
compile str_diff.c str.h
	./compile str_diff.c

str_len.o: \
compile str_len.c str.h
	./compile str_len.c

str_rchr.o: \
compile str_rchr.c str.h
	./compile str_rchr.c

str_start.o: \
compile str_start.c str.h
	./compile str_start.c

stralloc_cat.o: \
compile stralloc_cat.c byte.h stralloc.h gen_alloc.h
	./compile stralloc_cat.c

stralloc_catb.o: \
compile stralloc_catb.c stralloc.h gen_alloc.h byte.h
	./compile stralloc_catb.c

stralloc_cats.o: \
compile stralloc_cats.c byte.h str.h stralloc.h gen_alloc.h
	./compile stralloc_cats.c

stralloc_copy.o: \
compile stralloc_copy.c byte.h stralloc.h gen_alloc.h
	./compile stralloc_copy.c

stralloc_eady.o: \
compile stralloc_eady.c alloc.h stralloc.h gen_alloc.h \
gen_allocdefs.h
	./compile stralloc_eady.c

stralloc_num.o: \
compile stralloc_num.c stralloc.h gen_alloc.h
	./compile stralloc_num.c

stralloc_opyb.o: \
compile stralloc_opyb.c stralloc.h gen_alloc.h byte.h
	./compile stralloc_opyb.c

stralloc_opys.o: \
compile stralloc_opys.c byte.h str.h stralloc.h gen_alloc.h
	./compile stralloc_opys.c

stralloc_pend.o: \
compile stralloc_pend.c alloc.h stralloc.h gen_alloc.h \
gen_allocdefs.h
	./compile stralloc_pend.c

strerr_die.o: \
compile strerr_die.c buffer.h exit.h strerr.h
	./compile strerr_die.c

strerr_sys.o: \
compile strerr_sys.c error.h strerr.h
	./compile strerr_sys.c

subgetopt.o: \
compile subgetopt.c subgetopt.h
	./compile subgetopt.c

systype: \
find-systype.sh conf-cc conf-ld trycpp.c x86cpuid.c
	( cat warn-auto.sh; \
	echo CC=\'`head -1 conf-cc`\'; \
	echo LD=\'`head -1 conf-ld`\'; \
	cat find-systype.sh; \
	) | sh > systype

tai_add.o: \
compile tai_add.c tai.h uint64.h
	./compile tai_add.c

tai_now.o: \
compile tai_now.c tai.h uint64.h
	./compile tai_now.c

tai_pack.o: \
compile tai_pack.c tai.h uint64.h
	./compile tai_pack.c

tai_sub.o: \
compile tai_sub.c tai.h uint64.h
	./compile tai_sub.c

tai_uint.o: \
compile tai_uint.c tai.h uint64.h
	./compile tai_uint.c

tai_unpack.o: \
compile tai_unpack.c tai.h uint64.h
	./compile tai_unpack.c

taia_add.o: \
compile taia_add.c taia.h tai.h uint64.h
	./compile taia_add.c

taia_approx.o: \
compile taia_approx.c taia.h tai.h uint64.h
	./compile taia_approx.c

taia_frac.o: \
compile taia_frac.c taia.h tai.h uint64.h
	./compile taia_frac.c

taia_less.o: \
compile taia_less.c taia.h tai.h uint64.h
	./compile taia_less.c

taia_now.o: \
compile taia_now.c taia.h tai.h uint64.h
	./compile taia_now.c

taia_pack.o: \
compile taia_pack.c taia.h tai.h uint64.h
	./compile taia_pack.c

taia_sub.o: \
compile taia_sub.c taia.h tai.h uint64.h
	./compile taia_sub.c

taia_tai.o: \
compile taia_tai.c taia.h tai.h uint64.h
	./compile taia_tai.c

taia_uint.o: \
compile taia_uint.c taia.h tai.h uint64.h
	./compile taia_uint.c

tdlookup.o: \
compile tdlookup.c uint16.h open.h tai.h uint64.h cdb.h uint32.h \
byte.h case.h dns.h stralloc.h gen_alloc.h iopause.h taia.h tai.h \
taia.h seek.h response.h uint32.h ip6.h clientloc.h
	./compile tdlookup.c

timeoutread.o: \
compile timeoutread.c error.h iopause.h taia.h tai.h uint64.h \
timeoutread.h
	./compile timeoutread.c

timeoutwrite.o: \
compile timeoutwrite.c error.h iopause.h taia.h tai.h uint64.h \
timeoutwrite.h
	./compile timeoutwrite.c

tinydns: \
load tinydns.o server.o iopause.o droproot.o tdlookup.o response.o qlog.o \
prot.o clientloc.o dns.a libtai.a env.a cdb.a alloc.a buffer.a unix.a byte.a \
socket.lib
	./load tinydns server.o iopause.o droproot.o tdlookup.o response.o \
	qlog.o prot.o clientloc.o dns.a libtai.a env.a cdb.a alloc.a buffer.a \
	unix.a byte.a  `cat socket.lib`

tinydns-conf: \
load tinydns-conf.o generic-conf.o auto_home.o buffer.a unix.a byte.a
	./load tinydns-conf generic-conf.o auto_home.o buffer.a \
	unix.a byte.a 

tinydns-conf.o: \
compile tinydns-conf.c strerr.h exit.h auto_home.h generic-conf.h \
buffer.h
	./compile tinydns-conf.c

tinydns-data: \
load tinydns-data.o cdb.a dns.a alloc.a buffer.a unix.a byte.a
	./load tinydns-data cdb.a dns.a alloc.a buffer.a unix.a \
	byte.a 

tinydns-data.o: \
compile tinydns-data.c uint16.h uint32.h str.h byte.h fmt.h ip4.h \
exit.h case.h scan.h buffer.h strerr.h getln.h buffer.h stralloc.h \
gen_alloc.h cdb_make.h buffer.h uint32.h stralloc.h open.h dns.h \
stralloc.h iopause.h taia.h tai.h uint64.h taia.h ip6.h
	./compile tinydns-data.c

tinydns-edit: \
load tinydns-edit.o dns.a alloc.a buffer.a unix.a byte.a
	./load tinydns-edit dns.a alloc.a buffer.a unix.a byte.a 

tinydns-edit.o: \
compile tinydns-edit.c stralloc.h gen_alloc.h buffer.h exit.h open.h \
getln.h buffer.h stralloc.h strerr.h scan.h byte.h str.h fmt.h ip4.h \
dns.h stralloc.h iopause.h taia.h tai.h uint64.h taia.h
	./compile tinydns-edit.c

tinydns-get: \
load tinydns-get.o tdlookup.o response.o printpacket.o printrecord.o \
parsetype.o clientloc.o dns.a libtai.a cdb.a buffer.a alloc.a unix.a byte.a
	./load tinydns-get tdlookup.o response.o printpacket.o \
	printrecord.o parsetype.o clientloc.o dns.a libtai.a cdb.a buffer.a \
	alloc.a unix.a byte.a 

tinydns-get.o: \
compile tinydns-get.c str.h byte.h scan.h exit.h stralloc.h \
gen_alloc.h buffer.h strerr.h uint16.h response.h uint32.h case.h \
printpacket.h stralloc.h parsetype.h ip4.h dns.h stralloc.h iopause.h \
taia.h tai.h uint64.h taia.h
	./compile tinydns-get.c

tinydns.o: \
compile tinydns.c dns.h stralloc.h gen_alloc.h iopause.h taia.h tai.h \
uint64.h taia.h
	./compile tinydns.c

uint16_pack.o: \
compile uint16_pack.c uint16.h
	./compile uint16_pack.c

uint16_unpack.o: \
compile uint16_unpack.c uint16.h
	./compile uint16_unpack.c

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

uint32_pack.o: \
compile uint32_pack.c uint32.h
	./compile uint32_pack.c

uint32_unpack.o: \
compile uint32_unpack.c uint32.h
	./compile uint32_unpack.c

uint64.h: \
choose compile load tryulong64.c uint64.h1 uint64.h2
	./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h

unix.a: \
makelib buffer_read.o buffer_write.o error.o error_str.o ndelay_off.o \
ndelay_on.o open_read.o open_trunc.o openreadclose.o readclose.o \
seek_set.o socket_accept.o socket_bind.o socket_conn.o \
socket_listen.o socket_recv.o socket_send.o socket_tcp.o socket_udp.o \
socket_udp6.o socket_getifidx.o socket_recv6.o socket_send6.o \
socket_bind6.o socket_noipv6.o socket_tcp6.o socket_connect6.o \
socket_accept6.o
	./makelib unix.a buffer_read.o buffer_write.o error.o \
	error_str.o ndelay_off.o ndelay_on.o open_read.o \
	open_trunc.o openreadclose.o readclose.o seek_set.o \
	socket_accept.o socket_bind.o socket_conn.o socket_listen.o \
	socket_recv.o socket_send.o socket_tcp.o socket_udp.o \
	socket_udp6.o socket_getifidx.o socket_recv6.o socket_send6.o \
	socket_bind6.o socket_noipv6.o socket_tcp6.o socket_connect6.o \
	socket_accept6.o

utime: \
load utime.o byte.a
	./load utime byte.a 

utime.o: \
compile utime.c scan.h exit.h
	./compile utime.c

walldns: \
load walldns.o server.o iopause.o response.o droproot.o qlog.o prot.o dd.o \
dns.a env.a cdb.a alloc.a buffer.a unix.a byte.a socket.lib
	./load walldns server.o iopause.o response.o droproot.o qlog.o \
	prot.o dd.o dns.a libtai.a env.a cdb.a alloc.a buffer.a unix.a \
	byte.a  `cat socket.lib`

walldns-conf: \
load walldns-conf.o generic-conf.o auto_home.o buffer.a unix.a byte.a
	./load walldns-conf generic-conf.o auto_home.o buffer.a \
	unix.a byte.a 

walldns-conf.o: \
compile walldns-conf.c strerr.h exit.h auto_home.h generic-conf.h \
buffer.h
	./compile walldns-conf.c

walldns.o: \
compile walldns.c byte.h dns.h stralloc.h gen_alloc.h iopause.h \
taia.h tai.h uint64.h taia.h dd.h response.h uint32.h
	./compile walldns.c

haveip6.h: \
tryip6.c choose compile haveip6.h1 haveip6.h2
	./choose c tryip6 haveip6.h1 haveip6.h2 > haveip6.h

sockaddr_in6.h: \
trysa6.c choose compile sockaddr_in6.h1 sockaddr_in6.h2 haveip6.h
	./choose c trysa6 sockaddr_in6.h1 sockaddr_in6.h2 > sockaddr_in6.h

clean:
	rm -f `cat TARGETS`