File: truemake

package info (click to toggle)
acedb 4.9.39+dfsg.02-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 33,796 kB
  • sloc: ansic: 256,989; perl: 2,803; cpp: 2,534; csh: 1,712; python: 862; sh: 658; makefile: 300; awk: 249; lex: 225; yacc: 221
file content (1478 lines) | stat: -rw-r--r-- 50,882 bytes parent folder | download | duplicates (2)
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
#$Id: truemake,v 1.447 2007/01/17 09:39:58 edgrif Exp $
#################################################################
############### acedb: R.Durbin and J.Thierry-Mieg ##############
#################################################################
#
# ATTENTION:
#   If you are recompiling the distribution code on your own
#  machine, you should NOT edit the present file. All the machine
#  specific options should be given in your personal *_DEF file
#  in the same directory.
#   If you think you have to touch this file, contact the authors
#        mieg@crbm.cnrs-mop.fr, rd@sanger.ac.uk
#
#   If you add a display module, edit this file, not *_DEF
#
#
#   If you wish to specify one off compiler options such as
#   setting the debug flag (-g) or a preprocessor macro
#   value (-DMY_OWN_COMPILE_FLAG) then rather than editting
#   this file use the USEROPTS make macro like this:
#
#   make USEROPTS='-g -DMY_OWN_COMPILE_FLAG -x -y'
#
#   these will then be included in the flags used to compile
#   the .o files.
#
#
#################################################################
#
# Before running the make command
# setenv ACEDB_MACHINE to indicate one of the predefined
# Machine dependant option files, or write your own.
# These files are called  $(ACEDB_SRC)/wmake/$(ACEDB_MACHINE)_DEF
# For more detail about specifying these flags see the README in
# this directory.
#
# They define at least 4 (and possibly many more) make macros:
#
# NAME, COMPILER, LINKER, LIBS, RANLIB_NEEDED, AR_OPTIONS,
# LIBCC, LIBLDFLAGS, TEST, GTKVER
# COMPILER sets the compiler and its specific flags (cc, gcc ...)
# LIBCC is the compiler used to make glib, GTK, readline etc
# LIBLDFLAGS options to use when linking the test programs which are
# part of the configuration the 3rd party libraries. This needs to
# reflect the linking of the main code
# LINKER sets the linker and its specific flags (cc, gcc ...)
# LIBS the OEM (e.g. gnu) and system libraries (gcc-gnulib -lm etc)
# RANLIB_NEEDED should be set to false if ranlib is not needed, 
# it defaults to true for backward compatibility.
# AR_OPTIONS defaults to rlu for backward compatibility.
# TEST the test command, defaults to "test"
# GTKVER - empty or unset to use GTK 1.2
#          set to "gtk2 glib-2.0 gtk+-2.0" to use GTK2
#          the "gtk2" controls the build system, "glib-2.0 gtk+-2.0"
#          are passed to pkg-config and may need to be updated to
#          select later versions.

# NAME must be selected as follows
#
#
### pick NAME from among this list.
### NAME is used in the source code to conform to the
### target machine. It is used mostly in wh/mystdlib.h,
### wh/mydirent.h but also in a few awkward places, for example
### wh/array.h redefines the stack Macros in a particular way to
### please the xlc compiler of the IBM.
### If you port to a new machine, please let us know.
#
# ALPHA  Daily development platform using OSF1 V4.0    (1998)
# SUN    Tested for Sun Sparc 1, 2, 10 and on SUN3/80  (1997)
# NEXT   Tested on a several Next                      (1994)
# SGI    Used daily, but the sgi OS is very unsatble   (1997)
# ALLIANT  Alliant multiprocessor at MRC-LMB.          (1991)
#
# CONVEX Contributed by Jukka Ukkonen (ukkonen@csc.fi)
#       For make command to work
#	it does not help to
#		setenv ACEDB_MACHINE CONVEX
#	as adviced in the installation document. The
#	make command on Convex does not look in the
#	environment variables to fill in it's internal
#	variables when ACEDB_MACHINE is not defined as
#	a make's internal variable. To circumvent this
#	inconvenience do the make as follows
#		make ACEDB_MACHINE=CONVEX
#	and everything should work nice and easy.
#
# IBM   IBM-risc 6000,
#       We sometime  have difficulties to compile the graph package
#       with xlc -O2
#
# LINUX IBM-PC 386 and compatible, running gcc and the freeware
#       LINUX operating system. This platform is extremely cheap 
#       around 2000$ hardware + disk + sofware and remarkably fast
#
#	We use either gnu-compiler gcc or the native cc compilers
#       This choice is made by the $(ACEDB_MACHINE)_DEF file.
# 
#       On Alliant our 2 steps make does not properly works,
#       so on those ACEDB_MACHINEs:
#       do the following by hand:
#	setenv ACEDB_MACHINE SGI or ALLIANT
#       mkdir database ; mkdir bin
#       cp wmake/truemake bin/makefile
#       cd bin ; make all
#
#### The following machine-dependent options are recognized
#### by the code
#
# -DNO_LEFT_CASTING For compilers which refuse (int*)p++ syntax
#
#################################################################

#################################################################
################## Graphics System Libraries ####################
#################################################################
# The acedb-config script will
# select the local copy of gtk-config here if we have it, otherwise
# gtk-config should be in the path.
# These are overridable by the _DEF file :

XWIN_LIBS = `../w3rdparty/acedb-config $(GTKVER)`

# These two need to be over-rideable for the windows build.
# The order should be gex followed by graph since gex calls
# graph routines but not vice versa.
GRAPHXWIN_DEPEND  = libgex.a libgraph.a libgd.a
GRAPHXWIN_LIBS    = -lgex -lgraph -lgd


# On badly configured machines (e.g. Linux), you may redefine
# these libraries in a more precise way in your
# $(ACEDB_MACHINE)_DEF file

#################################################################
###################### Lex Libraries ############################
#################################################################
# most versions of lex require you to use -ll
# but not Linux - reset LEX_LIBS in $(ACEDB_MACHINE)_DEF file

LEX_LIBS = -ll

#################################################################
################## Source code directory, #######################
#################################################################

# The main include directory for public interface acedb headers.
INCLUDE = wh

# General tools, useful in any C program, growable arrays, stacks etc.
LIBUTIL = w1

# Graphics library and backends for GTK, and drawing stack
# interpreters for interactive windows, GIF-images and PostScript
LIBGRAPH = w2

# Main source files of acedb applications
APPMAIN = w3

# Acedb-kernel: session control etc
ACELIBKERNEL = w4

# Acedb-kernel: database manager / object storage
ACEDBKERNEL = w5

# Graphical ace manager: query, keyset display etc.
XACEMGR = w6

# Biological data displays: gmaps, pmaps etc.
MAPDISPLAYS = w7

# Non graphic applications
W8 = w8

# Miscellaneous applications and display tools, dotter etc..
DISPLAYTOOLS = w9

# misc acetools, acediff etc.
MISCTOOLS = wace

# New code: bindex, acelib, table etc
NEWCODE  = wnq

# zmap
ZMAP = wzmap

# New Ace Query language
AQLMODULE  = waql

# Sockets based version of server
ACESOCK  = wsocket

# code for acembly
ACEMBLY = wabi

# links between modules, system classes
HOOKS = whooks

# Jo's comparative mapping display tools, oxgrids etc.
OXGRIDMODULE = wjo

# GD - package for dynamic creation of gif image drawings
LIBGD = wgd

# MD5 - package for encryption using the MD5 algorithm.
LIBMD5 = wmd5

##############################################################

true = 1
false = 0

# defaults overridable in $(ACEDB_MACHINE)_DEF
RANLIB_NEEDED = true	
AR_OPTIONS = rlu
LEX         = lex
LEX_OPTIONS = 
YACC        = yacc
###YACC_OPTIONS = -dvt
YACC_OPTIONS =
TEST = test

# defaults overridable in $(ACEDB_MACHINE)_DEF
# e.g. different compiler when using purify
CCC = g++
CCCLINK = g++
CCCFLAGS = -O2 -g3 -Wall

ZMAPLDFLAGS = `pkg-config --libs libgnomecanvas-2.0`

RPCGEN_FLAGS = -I -K -1
# -I -K -1  good for alpha
# -b  -I -K -1  good for linux, probably solaris ?

# suppress auto SCCS extraction
.SCCS_GET:

#################################################################
########## Machine dependent compiler modification ##############
############# Are included from an external file ################
#### This is equivalent to, but more portable than $($(CC)) #####
### Edit these rules to adapt the makefile to a new machine #####
# Note that you can keep different DEF files for the same machine
# setting various compiler options
#################################################################
include deffile

#################################################################
#################################################################
# In principle you should not have to edit the rest of this file
#################################################################
#################################################################

VERSION_OBJ = aceversion.o

FREE_OBJS = freesubs.o freeout.o messubs.o memsubs.o arraysub.o \
	liste.o filsubs.o msort.o \
	heap.o timesubs.o bump.o randsubs.o call.o menu.o dict.o \
	helpsubs.o texthelp.o utils.o  vtxt.o acein.o aceout.o strsubs.o \
	getopt.o getopt1.o chronoexe.o

FREE_TS_OBJS = acein.o  aceout.o  \
	bump.o        dict.o        liste.o       menu.o \
	texthelp.o  msort.o \
	arraysub.o    call.o        heap.o        \
	memsubs.o     randsubs.o    timesubs.o    utils.o  vtxt.o strsubs.o \
	getopt.o getopt1.o

#####################################################################
# Graph library objects.
#

# Graph layer:
#
GRAPH_HDRS =       ../$(INCLUDE)/graph.h
GRAPH_PRIV_HDRS =  ../$(LIBGRAPH)/graph_.h ../$(LIBGRAPH)/graphcolour.h
GRAPH_OBJS = graphcon.o graphsub.o graphps.o graphgdi.o graphselect.o \
	graphascii.o graphprint.o filquery.o graphgif.o \
	colcontrol.o viewedit.o chronodisp.o graphcolour.o \
	graphAcedbInterface.o graphremote.o graphmesglist.o

# GD image drawing code, used across graph package.
#
LIBGD_OBJS = libgd.o gdfont6x9.o gdfont8x13.o gdfont8x13bold.o

# Graph <-> GraphDev interface:
#
GRAPHDEV_HDRS =  ../$(LIBGRAPH)/graphdev.h

#
# GraphDev layer implementation:
#
GRAPHGEX_OBJS = graphgtk.o graphgdk.o graphgdkremote.o gexhelp.o\
		gexramptool.o gex.o 
GRAPHGEX_HDRS = ../$(LIBGRAPH)/graphgtk_.h

#####################################################################
#####################################################################

AQL_OBJS = aql.o aqlparse.o aqlcheck.o aqlrun.o aqlerror.o aqldebug.o

BASE_OBJS = keysetdump.o lexsubs4.o lexalpha.o \
	disknew.o blocksub.o objcache.o \
	idacedb.o idcurate.o

BASE_5_OBJS = bs2block.o adisk.o acache.o

B_OBJS  = bsubs.o bstree.o bstools.o keyset.o \
	bsdumps.o nicedump.o asubs.o bssubs.o check.o \
	dnasubs.o dnacode.o peptide.o matchtable.o \
	basepad.o smap.o

#########################################

## objects for every acedb build, whether graphical or not.
GENERIC_ACE_OBJS = command.o commandmenu.o session.o dbpath.o aceutils.o banner.o \
	queryexe.o tabledefsubs.o  tabledefio.o flag.o \
	$(AQL_OBJS) $(BASE_OBJS) $(BASE_5_OBJS) $(B_OBJS) \
	class.o sysclass.o tags.o model.o \
	longtext.o quovadis.o picksubs.o alignment.o \
	logsubs.o sigsubs.o prefsubs.o status.o \
	bindex.o acelib.o table.o apputils.o \
	acinside.o actable.o

## same as GENERIC_ACE_OBJS, but these are used in -DACEMBLY builds
GENERIC_ACEMBLY_OBJS = command.acm.o session.o dbpath.o aceutils.o banner.o \
	queryexe.o tabledefsubs.o  tabledefio.o flag.o \
	$(AQL_OBJS) $(BASE_OBJS) $(BASE_5_OBJS) $(B_OBJS) \
	class.acm.o sysclass.acm.o tags.acm.o  model.o \
	longtext.o quovadis.o picksubs.o alignment.o \
	logsubs.o sigsubs.o prefsubs.o status.o \
	bindex.o acelib.o table.o apputils.o \
	acinside.o actable.o

## The GENERIC_ACE_(NON)GRAPH_OBJS files still have #ifdef NON_GRAPHIC
## sections which need to be resolved. These objects can then
## move to the GENERIC_ACE_OBJS group.
GENERIC_ACE_GRAPH_OBJS = parse.o dump.o biblio.o

## special verions of these modules for non-graphical builds
GENERIC_ACE_NONGRAPH_OBJS = parse.ng.o dump.ng.o biblio.ng.o

## for now we have to make sure that gifaceserver gets the non-graphical
## version of parse.c, because of the way parse errors are output
## via freeOut (by .ng.o) and messout/graphOut (by .o), in the latter
## case they are swallowed by the gif backend of the graphlib and not 
## shown to the user
GENERIC_GIFACE_GRAPH_OBJS = parse.ng.o dump.o biblio.o

#################################################################
################## GRAPHICAL_ACE_OBJS ###########################
#################################################################
## these are generic modules, that allow graphical browsing and 
## manipluation of any ace-database (these modules should be in w6)
## functionality of these display is NOT database-dependant

## included in graphical builds
GRAPHICAL_ACE_OBJS = mainpick.o display.o update.o \
	newkey.o treedisp.o forest.o ksetdisp.o \
	plot.o plot2d.o sessiondisp.o longtextdisp.o \
	querydisp.o qbedisp.o querybuild.o  \
	tabledisp.o tablemakerdisp.o multimapdisp.o \
	objcachedisp.o action.o layoutdisp.o prefdisp.o \
	acedbgraph.o acdbtest.o gifcommand.o \
	statusdisp.o aqldisp.o

## included in graphical builds
GRAPHICAL_ACEMBLY_OBJS = mainpick.acm.o display.acm.o update.o \
	newkey.acm.o treedisp.o forest.o ksetdisp.o \
	plot.o plot2d.o sessiondisp.o longtextdisp.o \
	querydisp.o qbedisp.o querybuild.o  \
	tabledisp.o tablemakerdisp.o multimapdisp.o \
	objcachedisp.o action.o layoutdisp.o prefdisp.o \
	acedbgraph.o acdbtest.o gifcommand.o \
	statusdisp.o aqldisp.o

###################################################################
###################### GRAPHICAL_BIO_ACE_OBJS ####################
###################################################################
## these modules allow display of specific biological acedb data
## these modules should NOT be in w4/w5/w6
## functionality of these displays is database-dependant

ALL_DISP_OBJS = geldisp.o \
	cmapdisp.o pmapdisp.o pmapconvert.o \
	gmapdisp.o vmapdisp.o vmapdrag.o \
	pepactivezonecol.o alignmentdisp.o \
	dnacpt.o fpdisp.o pepdisp.o pepgifcommand.o pephomolcol.o \
	pepseqcol.o pepfeaturecol.o pepgraphcol.o metab.o \
        gmapconvert.o gmapmarkercol.o gmapintervalcol.o \
        gmaplocuscol.o gmapremarkcol.o drawdisp.o \
	gmapposnegcol.o method.o methodcache.o gmapsubmapcol.o \
        dendrogram.o 

ZMAP_OBJS = zmapcontrol.o zmapcols.o zmapsequence.o seqregion.o \
            stringbucket.o zmapcalls.o zmapbccol.o


# mapcontrol:
#
MAPCONT_HDRS =  ../$(INCLUDE)/map.h
MAPCONT_ACE_OBJS =  mapcontrol.o
MAPCONT_ACEMBLY_OBJS =  mapcontrol.o


# fmap:
#
FMAP_HDRS =       ../$(INCLUDE)/fmap.h
FMAP_PRIV_HDRS =  ../$(MAPDISPLAYS)/fmap_.h
FMAP_ACE_OBJS = fmapsequence.o fmapfeatures.o fmapgene.o \
	fmaposp.o fmapblast.o fmapmenes.o fmapstatus.o \
	fmapcontrol.o smapconvert.o fmapcdna.o fmapcurate.o \
	das.o gff.o
FMAP_ACEMBLY_OBJS = fmapsequence.o fmapfeatures.o fmapgene.o \
	fmaposp.o fmapblast.o fmapmenes.o fmapstatus.o \
	fmapcontrol.acm.o fmapcdna.acm.o

# grid:
#
GRID_HDRS =       ../$(INCLUDE)/grid.h
GRID_PRIV_HDRS =  ../$(MAPDISPLAYS)/grid_.h
GRID_ACE_OBJS = griddisp.o
GRID_ACEMBLY_OBJS = griddisp.o

OTHER_OBJS = embl.o translate.o \
	gmapdata.o gmapdatacol.o vmapdata2.o \
	align.o gmapphys.o vmapphys.o \
	gfcode.acedb.o hexcode.acedb.o 

DOTTER_OBJS = dotter.o dotterKarlin.o blxview.acedb.o 

JO_OBJS = oxgriddisp.o pairmapdisp.o o2m.o oxhomlist.o specg.o

####

GRAPHICAL_BIO_ACE_OBJS = $(ALL_DISP_OBJS) $(MAPCONT_ACE_OBJS) $(FMAP_ACE_OBJS) $(GRID_ACE_OBJS) \
			  $(OTHER_OBJS) $(DOTTER_OBJS) $(JO_OBJS) #$(ZMAP_OBJS)

GRAPHICAL_BIO_ACEMBLY_OBJS = $(ALL_DISP_OBJS) $(MAPCONT_ACE_OBJS) $(FMAP_ACEMBLY_OBJS) $(GRID_ACEMBLY_OBJS) \
			      $(OTHER_OBJS) $(DOTTER_OBJS) $(JO_OBJS)

######################################################################

### linked in by graphical acembly builds
MAPPING_GRAPH_OBJS = topology.o aligntools.o \
	defcpt.o intrinsictree.o \
	dnaalign.o basecallstat.o


### linked in by non-graphical acembly builds 
MAPPING_NONGRAPH_OBJS = topology.o aligntools.o \
	defcpt.ng.o \
	intrinsictree.ng.o \
	dnaalign.ng.o basecallstat.ng.o

### linked in by graphical acembly builds
ABI_GRAPH_OBJS = trace.acedb.o annot.acedb.o  fmaptrace.acm.o blyctrl.o  geneannot.o

####notneeded####ABI_NONGRAPH_OBJS = trace.acedbng.o annot.acedb.o fmaptrace.acm.o blyctrl.o 

### linked in by graphical acembly builds
BASECALL_GRAPH_OBJS = basecall.acedb.o abifix.acedb.o \
	nnbasecall.acedb.o \
	myNetwork.o acemblyhook.o cdnaalign.o saucisse.o 

### linked in by non-graphical acembly builds
BASECALL_NONGRAPH_OBJS = basecall.acedbng.o abifix.acedbng.o \
	nnbasecall.acedb.o \
	myNetwork.o acemblyhook.o cdnaalign.o saucisse.ng.o 



#####################################################################
# Socket based ace server/client objects.
#

# MD5 encryption package used by socket server code.
#
LIBMD5_HDR            = ../$(LIBMD5)/global.h ../$(LIBMD5)/md5.h
LIBMD5_OBJ            = md5c.o
LIBMD5_TEST_HDR       = ../$(LIBMD5)/digcalc.h
LIBMD5_TEST_OBJ       = mddriver.o digcalc.o digtest.o

# Client/server code.
ACESOCK_SOCKET_HDR    = ../$(ACESOCK)/acesocket_.h
ACESOCK_TRANSPORT_HDR = ../$(ACESOCK)/servertransport.h
ACESOCK_SERVER_HDR    = ../$(ACESOCK)/serverace_.h
ACESOCK_CLIENT_HDR    = ../$(ACESOCK)/saceclient_.h
ACESOCK_CLIENTLIB_HDR = ../$(ACESOCK)/sclientlib.h
ACESOCK_UTILS_HDR     = ../$(ACESOCK)/serverclientutils.h

ACESOCK_SOCKET_OBJ    = acesocket.o acesocketlib.o
ACESOCK_SERVER_OBJ    = serverace.o serveracepasswd.o
ACESOCK_CLIENT_OBJ    = saceclient.o sclient.o
ACESOCK_CLIENTLIB_OBJ = sclientlib.o
ACESOCK_UTILS_OBJ     = serverclientutils.o
ACESOCK_XCLIENT_OBJ   = sxclient.o

ACESOCK_ALL_OBJ = $(ACESOCK_SOCKET_OBJ) $(ACESOCK_SERVER_OBJ) $(ACESOCK_UTILS_OBJ)

###########################################################
## Compile Time Variants
## A single source code will produce several object modules
## Rules are given below
###########################################################

# add any new special suffix here - do not have multiple .SUFFIXES lines 
.SUFFIXES: .o .c .ng.o .acedb.o .acedbng.o .acm.o .acmng.o .ng5.o .a5.o .cc

###########################################################
## Source code location
##
## 
VERSION_SOURCE = $(VERSION_OBJ:.o=.c)

LIBUTIL_SOURCES = $(FREE_OBJS:.o=.c)   

LIBGRAPH_SOURCES = $(GRAPH_OBJS:.o=.c) $(GRAPHGEX_OBJS:.o=.c) xremotemain.c
APPMAIN_SOURCES = gifacemain.c tacemain.c xacemain.c xclientmain.c taqlmain.c apputils.c
ACELIBKERNEL_SOURCES =    command.c commandmenu.c gifcommand.c dump.c model.c \
		banner.c aceutils.c \
		queryexe.c parse.c session.c dbpath.c logsubs.c sigsubs.c \
		prefsubs.c longtext.c picksubs.c mainpick.c metadata.c \
		newkey.c status.c update.c alignment.c \
		tabledefsubs.c tabledefio.c
ACEDBKERNEL_SOURCES = $(BASE_OBJS:.o=.c) $(BASE_5_OBJS:.o=.c)
XACEMGR_SOURCES = $(B_OBJS:.o=.c) \
		display.c treedisp.c forest.c ksetdisp.c \
		querydisp.c qbedisp.c querybuild.c \
		tabledisp.c tablemakerdisp.c multimapdisp.c \
		objcachedisp.c sessiondisp.c \
		action.c plot.c plot2d.c longtextdisp.c \
		acedbgraph.c acdbtest.c layoutdisp.c  prefdisp.c \
		statusdisp.c aqldisp.c
MAPDISPLAYS_SOURCES = $(ALL_DISP_OBJS:.o=.c) $(MAPCONT_ACE_OBJS:.o=.c)  biblio.c \
	$(FMAP_ACE_OBJS:.o=.c) $(GRID_ACE_OBJS:.o=.c) coltest.c 

## MAPPING_OBJS
W8_SOURCES = topology.c defcpt.c intrinsictree.c dnaalign.c \
	aligntools.c basecallstat.c

DISPLAYTOOLS_SOURCES = gfcode.c embl.c  \
	dotter.c dotterKarlin.c \
	translate.c blxview.c \
	gmapdata.c  gmapdatacol.c vmapdata2.c \
	align.c gmapphys.c vmapphys.c hexcode.c \
	blxmain.c blxselect.c blxparser.c \
	diskdump.c diskfix.c \
	dotterMain.c readseq.c \
	efetch.c dbidx.c belvu.c


WRPC_SOURCES = rpcace.x xclient.c jade2ace.c aceclient.c aceclientlib.c \
	aceserver.c jadeserver.c rpcace_sp.c jade2sybase.c

LIBMD5_SOURCES =  $(LIBMD5_OBJ:.o=.c) $(LIBMD5_TEST_OBJ:.o=.c)
ACESOCK_SOURCES = $(ACESOCK_SOCKET_OBJ:.o=.c) $(ACESOCK_SERVER_OBJ:.o=.c) \
                  $(ACESOCK_CLIENT_OBJ:.o=.c) $(ACESOCK_CLIENTLIB_OBJ:.o=.c) \
                  $(ACESOCK_UTILS_OBJ:.o=.c) $(ACESOCK_XCLIENT_OBJ:.o=.c)

NEWCODE_SOURCES = bindex.c acelib.c table.c flag.c acelibtest.c tagcount.c 

# Just too difficult to make it dependent on the .h files as well. This may not 
# be the right place to put them, but in any case I can't make it work.
ZMAP_SOURCES = zmapcontrol.c zmapcols.c seqregion.c stringbucket.c \
	       zmapcalls.c zmapsequence.c zmapbccol.c


AQLMODULE_SOURCES = aql.c aqlcheck.c aqlrun.c aqlerror.c \
		aqldebug.c aqlparse.y aqlparse.l
MISCTOOLS_SOURCES = pmapace2.c homonym.c acediff.c acediffsorted.c makeUserPasswd.c

ACEMBLY_SOURCES = trace.c fmaptrace.c blyctrl.c annot.c geneannot.c \
	basecall.c abifix.c myNetwork.c nnbasecall.c acemblyhook.c \
	cdnaalign.c saucisse.c \
	intron2.c 

HOOKS_SOURCES = sysclass.c class.c tags.c quovadis.c
LIBGD_SOURCES = $(LIBGD_OBJS:.o=.c)
OXGRIDMODULE_SOURCES = $(JO_OBJS:.o=.c)


###########################################################
##  Compiler and library options
## CC, LIBS, NAME are defined in $(ACEDB_MACHINE)_DEF
##

# NB ACEDB_GTK needed everywhere for the time being: TODO
IDIR = -I.. -I../$(INCLUDE) -I../wstaden -DACEDB_GTK
# Do not use -I/usr/include
# it prevents gcc from picking up its own includes
# (cc goes to /usr/include anyway)

## to undefine any rubbish
CCFLAGS =
GCFLAGS =

## Different platforms use CC or COMPILE.c
#  (USEROPTS - see comments at top of file)
#
CC =        $(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -c
COMPILE.c = $(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -c

###########################################################
## make targets.
##
##
.KEEP_STATE: 

# "all" should always be the first target so that it is the default make action.
all : xace tace  \
	aceserver aceclient xaceclient \
	giface gifaceserver \
	jade2ace jadeserver \
	saceserver saceclient sxaceclient makeUserPasswd \
	acediff acediffsorted xacez

acembly : libstaden.a tacembly xacembly \
	makeSCF scf2ctf ctf2scf \
	gifacemblyserver\
	gnbk gnbkclient 

other : blixem efetch \
	pmapace tagcount diskdump diskfix \
	xtest coltest genefeatures \
	libfree.a \
	libgraph.a libgraphgex.a libgd.a \
	libacecl.a libace.a libxace.a 

tools : makeUserPasswd acediff acediffsorted

$(VERSION_SOURCE):
	@$(TEST) -L $@ || ln -s ../$(NEWCODE)/$@ . 
$(LIBUTIL_SOURCES):
	@$(TEST) -L $@ || ln -s ../$(LIBUTIL)/$@ . 
$(LIBGRAPH_SOURCES):
	@$(TEST) -L $@ || ln -s ../$(LIBGRAPH)/$@ . 
$(APPMAIN_SOURCES): 
	@$(TEST) -L $@ || ln -s ../$(APPMAIN)/$@ . 
$(ACELIBKERNEL_SOURCES): 
	@$(TEST) -L $@ || ln -s ../$(ACELIBKERNEL)/$@ .
$(ACEDBKERNEL_SOURCES): 
	@$(TEST) -L $@ || ln -s ../$(ACEDBKERNEL)/$@ .
$(XACEMGR_SOURCES): 
	@$(TEST) -L $@ || ln -s ../$(XACEMGR)/$@ .
$(MAPDISPLAYS_SOURCES):
	@$(TEST) -L $@ || ln -s ../$(MAPDISPLAYS)/$@ . 
$(W8_SOURCES): 
	@$(TEST) -L $@ || ln -s ../$(W8)/$@ . 
$(DISPLAYTOOLS_SOURCES):
	@$(TEST) -L $@ || ln -s ../$(DISPLAYTOOLS)/$@ .
$(NEWCODE_SOURCES):
	@$(TEST) -L $@ || ln -s ../$(NEWCODE)/$@ .
$(ZMAP_SOURCES):
	@$(TEST) -L $@ || ln -s ../$(ZMAP)/$@ .
$(AQLMODULE_SOURCES):
	@$(TEST) -L $@ || ln -s ../$(AQLMODULE)/$@ .
$(ACESOCK_SOURCES): 
	@$(TEST) -L $@ || ln -s ../$(ACESOCK)/$@ .
$(LIBMD5_SOURCES): 
	@$(TEST) -L $@ || ln -s ../$(LIBMD5)/$@ .
$(WRPC_SOURCES): 
	@$(TEST) -L $@ || ln -s ../wrpc/$@ .
$(MISCTOOLS_SOURCES):
	@$(TEST) -L $@ || ln -s ../$(MISCTOOLS)/$@ .
$(ACEMBLY_SOURCES):
	@$(TEST) -L $@ || ln -s ../$(ACEMBLY)/$@ .
$(HOOKS_SOURCES):
	@$(TEST) -L $@ || ln -s ../$(HOOKS)/$@ .
$(LIBGD_SOURCES): 
	@$(TEST) -L $@ || ln -s ../$(LIBGD)/$@ .
$(OXGRIDMODULE_SOURCES): 
	@$(TEST) -L $@ || ln -s ../$(OXGRIDMODULE)/$@ .

#### Compilation of variants ###############

.c.acedb.o: $<
	$(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -DACEDB -c $< -o $@

.c.acedbng.o: $<
	$(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -DNON_GRAPHIC -DACEDB -c $< -o $@

.c.ng.o: $<
	$(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -DNON_GRAPHIC -c $< -o $@

.c.ng5.o: $<
	$(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -DNON_GRAPHIC -DACEDB5 -c $< -o $@

.c.acm.o: $<
	$(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -DACEMBLY -c $< -o $@

.c.acmng.o: $<
	$(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -DNON_GRAPHIC -DACEMBLY -c $< -o $@

.c.a5.o: $<
	$(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -DACEDB5 -c $< -o $@


#############################################################
################## public libraries #########################
#############################################################

########### utilities library #############

# 
# when aceversion.c is recompiled it contains the date and time
# of the recompilation which is used in the version string of
# the executable. It is also altered by wmake/makefile to contain 
# the directory where the make was done, this way we can check
# whether users are using our code or one they compiled themselves.
#
# aceversion.c is recompiled for each invocation of this makefile.
# wmake/makefile, which calls this file, does a "touch"
# on the file denoted by $(VERSION_TIMESTAMP_FILE) which ensures
# aceversion.c gets rebuilt. (The variable VERSION_TIMESTAMP_FILE
# is set in makefile.)
#
$(VERSION_OBJ) : $(VERSION_TIMESTAMP_FILE) ../$(INCLUDE)/regular.h ../$(INCLUDE)/version.h ../$(INCLUDE)/aceversion.h 


$(FREE_OBJS): ../$(INCLUDE)/regular.h ../$(INCLUDE)/mystdlib.h

helpsubs.o texthelp.o: ../$(INCLUDE)/help_.h

libfree.a : $(VERSION_OBJ) $(FREE_OBJS)
	ar $(AR_OPTIONS) libfree.a $?
	@if ( $(RANLIB_NEEDED) ) then ranlib libfree.a; fi

libfree_clean : 
	rm -f $(VERSION_OBJ) $(FREE_OBJS) libfree.a

########### thread safe  library #############

$(FREE_TS_OBJS): ../$(INCLUDE)/regular.h ../$(INCLUDE)/mystdlib.h

libtsfree.a : $(FREE_TS_OBJS)
	ar $(AR_OPTIONS) libtsfree.a $?
	@if ( $(RANLIB_NEEDED) ) then ranlib libtsfree.a; fi


########### graphics libraries ################

$(GRAPH_PRIV_HDRS): $(GRAPH_HDRS)
$(GRAPH_OBJS): $(GRAPH_PRIV_HDRS) $(GRAPHDEV_HDRS)
gexhelp.o: ../$(INCLUDE)/help_.h
libgraph.a :  $(GRAPH_OBJS)
	ar $(AR_OPTIONS) libgraph.a $?
	@if ( $(RANLIB_NEEDED) ) then ranlib libgraph.a; fi


$(GRAPHGEX_OBJS): $(GRAPHGEX_HDRS) $(GRAPHDEV_HDRS)
libgex.a : $(GRAPHGEX_OBJS) 
	ar $(AR_OPTIONS) libgex.a $?
	@if ( $(RANLIB_NEEDED) ) then ranlib libgex.a; fi


# GIF drawing routines, independent of which version of graph device layer is used.
libgd.a : $(LIBGD_OBJS)
	ar $(AR_OPTIONS) libgd.a $?
	@if ( $(RANLIB_NEEDED) ) then ranlib libgd.a; fi


libgraph_clean : 
	rm -f  $(GRAPH_OBJS) libgraph.a
	rm -f  $(GRAPHGEX_OBJS)   libgex.a
	rm -f  $(LIBGD_OBJS)   libgd.a



########### MD5 encryption libraries ################

# MD5 library
$(LIBMD5_OBJ): $(LIBMD5_HDR)

libmd5.a : $(LIBMD5_OBJ)
	ar $(AR_OPTIONS) $@ $?
	@if ( $(RANLIB_NEEDED) ) then ranlib $@ ; fi

# MD5 test programs
$(LIBMD5_TEST_OBJ) : $(LIBMD5_HDR) $(LIBMD5_TEST_HDR)

md5test : libmd5.a $(LIBMD5_TEST_OBJ) mddriver digtest
	$(LINKER) -o mddriver mddriver.o -L. -lmd5
	$(LINKER) -o digtest digcalc.o digtest.o -L. -lmd5

#########################################
#### public C interface: libace #########
#########################################

########### AQL objects ######################

lex.yy.c: aqlparse.l ../$(AQLMODULE)/aql_.h
	$(LEX) $(LEX_OPTIONS) aqlparse.l

aqlparse.c: lex.yy.c aqlparse.y
	$(YACC) $(YACC_OPTIONS) aqlparse.y
	mv y.tab.c aqlparse.c

$(AQL_OBJS): ../$(AQLMODULE)/aql_.h

#
# In the end we want fmap et al. to be a library that is compiled just the once,
# here is the start of some dependencies for them.
#

# mapcontrol
#
$(MAPCONT_ACE_OBJS): $(MAPCONT_HDRS)
$(MAPCONT_ACEMBLY_OBJS): $(MAPCONT_HDRS)

# fmap
#
$(FMAP_HDRS): $(MAPCONT_HDRS)
$(FMAP_PRIV_HDRS): $(FMAP_HDRS)
$(FMAP_ACE_OBJS): $(FMAP_PRIV_HDRS)
$(FMAP_ACEMBLY_OBJS): $(FMAP_PRIV_HDRS)

# grid
#
$(GRID_HDRS): $(MAPCONT_HDRS)
$(GRID_PRIV_HDRS): $(GRID_HDRS)
$(GRID_ACE_OBJS): $(GRID_PRIV_HDRS)
$(GRID_ACEMBLY_OBJS): $(GRID_PRIV_HDRS)



#
# dependencies of selected .o files upon special includes
#
command.o tabledefio.o tabledefsubs.o: ../$(INCLUDE)/spread_.h

tablemakerdisp.o: ../$(INCLUDE)/spread_.h ../$(INCLUDE)/tabledisp.h

tabledisp.o multimapdisp.o: ../$(INCLUDE)/spread.h ../$(INCLUDE)/table.h ../$(INCLUDE)/tabledisp.h

aqldisp.o: ../$(INCLUDE)/aql.h ../$(INCLUDE)/table.h ../$(INCLUDE)/tabledisp.h

## table.h
$(AQL_OBJS) command.o matchtable.o dnacpt.o fmapcontrol.o smapconvert.o pephomolcol.o table.o xclient.o quovadis.o : ../$(INCLUDE)/table.h

## method.h
method.o methodcache.o fmapcdna.o fmapcontrol.o smapconvert.o fmapfeatures.o fmapsequence.o fmapgene.o pepfeaturecol.o pephomolcol.o: ../$(INCLUDE)/method.h

methodcache.o: ../$(INCLUDE)/methodcache.h

## bump.h
bump.o graphascii.o multimapdisp.o cmapdisp.o fmapcdna.o fmapfeatures.o fmaposp.o fmapstatus.o gmapintervalcol.o gmaplocuscol.o gmapremarkcol.o gmapsubmapcol.o pepfeaturecol.o pephomolcol.o pmapdisp.o vmapdisp.o defcpt.o gmapphys.o vmapphys.o fmaptrace.o: ../$(INCLUDE)/bump.h

## bump_.h - some external files intrude the internals of the bump-package
bump.o graphascii.o pmapdisp.o: ../$(INCLUDE)/bump_.h

## aceio.h - files that use the new AceIO package ACEIN/ACEOUT
acein.o aceout.o gifacemain.o tacemain.o xacemain.o command.o gifcommand.o longtext.o parse.o status.o dump.o bsdumps.o session.o logsubs.o aceutils.o tabledefio.o tablemakerdisp.o keysetdump.o ksetdisp.o dnasubs.o longtextdisp.o matchtable.o peptide.o fmapcontrol.o smapconvert.o fmaposp.o pepdisp.o pepgifcommand.o defcpt.o table.o aceserver.o xclient.o: ../$(INCLUDE)/aceio.h

## command.h
gifacemain.o tacemain.o xacemain.o command.o commandmenu.o gifcommand.o defcpt.o aceserver.o: ../$(INCLUDE)/command.h

## dump.h
dump.o tabledefio.o command.o bssubs.o nicedump.o ksetdisp.o dendrogram.o embl.o xclient.o: ../$(INCLUDE)/dump.h

## dna.h
dnasubs.o alignment.o command.o mainpick.o basepad.o diaplay.o ksetdisp.o peptide.o dendrogram.o dnacpt.o fmapblast.o fmapcdna.o fmapcontrol.o smapconvert.o fmapfeatures.o fmapgene.o fmapmenes.o fmaposp.o fmapsequence.o fmapstatus.o fpdisp.o geldisp.o aligntools.o basecallstat.o defcpt.o dnaalign.o align.o asn.o embl.o quovadis.o acelib.o acinside.o aclient.o: ../$(INCLUDE)/dna.h

## peptide.h
alignment.o command.o gifommand.o ksetdisp.o peptide.o dendrogram.o dnacpt.o fmapcontrol.o smapconvert.o fmapfeatures.o fmapgene.o pepdisp.o pepgifcommand.o embl.o quovadis.o: ../$(INCLUDE)/peptide.h

## longtext.h
command.o mainpick.o display.o longtextdisp.o quovadis.o: ../$(INCLUDE)/longtext.h

## matchtable.h
matchtable.o fmapcontrol.o smapconvert.o pephomolcol.o quovadis.o: ../$(INCLUDE)/matchtable.h

## smap.h
fmapcontrol.o smapconvert.o fmapsequence.o pmapconvert.o pmapdisp.o blxview.o smap.o: ../$(INCLUDE)/smap.h

######################

LIBACE_OBJS = $(GENERIC_ACE_OBJS) $(GENERIC_ACE_NONGRAPH_OBJS)

libace.a :  $(LIBACE_OBJS)
	ar $(AR_OPTIONS) libace.a $?
	@if ( $(RANLIB_NEEDED) ) then ranlib libace.a; fi

libace_clean : 
	rm -f $(LIBACE_OBJS) libace.a

######## libxace.a is the variant of libace.a that is
######## compiled without the -DNON_GRAPH compiler flag
######## it is used instead of libace.a in graphical builds
######## it will become obsolete once the code groups
######## GENERIC_ACE_OBJS and GENERIC_ACE_(NON)GRAPH_OBJS have merged

LIBXACE_OBJS = $(GENERIC_ACE_OBJS) $(GENERIC_ACE_GRAPH_OBJS)

LIBGIFACE_OBJS = $(GENERIC_ACE_OBJS) $(GENERIC_GIFACE_GRAPH_OBJS)

libxace.a :  $(LIBXACE_OBJS)
	ar $(AR_OPTIONS) libxace.a $?
	@if ( $(RANLIB_NEEDED) ) then ranlib libxace.a; fi


libgiface.a :  $(LIBGIFACE_OBJS)
	ar $(AR_OPTIONS) libgiface.a $?
	@if ( $(RANLIB_NEEDED) ) then ranlib libgiface.a; fi

libxace_clean : 
	rm -f $(LIBXACE_OBJS) libxace.a

################################################################
############## graphical ACEDB programs ########################
################################################################

# Xace - acedb version 4:
# New build for xace, xacemain.c gets recompiled every time xace is built,
# this allows to include the build date in xacemain.
#
XACE_OBJS = $(GRAPHICAL_ACE_OBJS) $(GRAPHICAL_BIO_ACE_OBJS)

mainpick.o longtextdisp.o qbedisp.o querydisp.o treedisp.o fmapcontrol.o smapconvert.o ksetdisp.o: ../$(INCLUDE)/keysetdisp.h

xace : libfree.a $(GRAPHXWIN_DEPEND) libxace.a xacemain.c $(XACE_OBJS)
	rm -f display.o
	$(CC) xacemain.c display.c
	$(LINKER) -o xace xacemain.o $(XACE_OBJS) -L. -lxace -lfree $(GRAPHXWIN_LIBS) $(XWIN_LIBS) $(LIBS) $(LEX_LIBS) 

xace_clean :
	rm -f $(XACE_OBJS) xace$(EXE_SUFFIX)


# giface:
## much like xace, but using virtual display instead of interactive
## windows. It is terminal based, window contents can be dumped into
## gif and postscript files.
GIFACE_OBJS = $(GRAPHICAL_ACE_OBJS) $(ALL_DISP_OBJS) \
$(MAPCONT_ACE_OBJS) $(FMAP_ACE_OBJS) $(GRID_ACE_OBJS) $(OTHER_OBJS) $(JO_OBJS)

giface : libfree.a libgd.a libgraph.a libxace.a gifacemain.c $(GIFACE_OBJS)
	$(CC) gifacemain.c
	$(LINKER) -o giface gifacemain.o $(GIFACE_OBJS) -L. -lxace -lgraph -lgd -lfree $(LIBS) $(LEX_LIBS)

xacez : libfree.a $(GRAPHXWIN_DEPEND) libxace.a xacemain.c $(XACE_OBJS) $(ZMAP_OBJS)
	rm -f display.o
	$(CC) -DZMAP xacemain.c display.c
	$(LINKER) -o xacez xacemain.o $(XACE_OBJS) $(ZMAP_OBJS)  -L. -lxace -lfree $(GRAPHXWIN_LIBS) $(XWIN_LIBS) $(LIBS) $(LEX_LIBS) $(ZMAPLDFLAGS)

#####################################

# Xacembly version 4 build:
XACEMBLY_OBJS =  \
	$(GENERIC_ACEMBLY_OBJS) $(GENERIC_ACE_GRAPH_OBJS) \
	$(GRAPHICAL_ACEMBLY_OBJS) \
	$(GRAPHICAL_BIO_ACEMBLY_OBJS) \
	$(ABI_GRAPH_OBJS) $(BASECALL_GRAPH_OBJS) $(MAPPING_GRAPH_OBJS)

xacembly : libfree.a $(GRAPHXWIN_DEPEND) libstaden.a xacemain.c $(XACEMBLY_OBJS)
	$(CC) -DACEMBLY -c xacemain.c -o xacemblymain.o
	$(LINKER) -o xacembly $(XACEMBLY_OBJS) xacemblymain.o -L. -lfree $(GRAPHXWIN_LIBS) -lstaden $(XWIN_LIBS) $(LIBS) $(LEX_LIBS)
	chmod 755 xacembly$(EXE_SUFFIX)

################################################################
############## non-graphical ACEDB programs ####################
################################################################

# genefeatures
#genefeatures : gfcode.o readseq.o
#	$(CC) -g -o genefeatures gfcode.o readseq.o -lm

genefeatures : gfcode.o readseq.o
	$(LINKER) -o genefeatures gfcode.o readseq.o -lm

readseq.o : readseq.c 
	$(CC) $(CFLAGS) readseq.c

gfcode.o : gfcode.c
	$(CC) $(USEROPTS) $(CFLAGS) gfcode.c 	

# tace
tace :  libfree.a libace.a tacemain.c
	$(CC) tacemain.c
	$(LINKER) -o tace tacemain.o -L. -lace -lfree $(LIBS) $(LEX_LIBS) 
	chmod 755 tace$(EXE_SUFFIX)

tace_clean :
	rm -f tacemain.o tace$(EXE_SUFFIX)

# tacembly - version 4
TACEMBLY_OBJS =  \
	$(GENERIC_ACEMBLY_OBJS) $(GENERIC_ACE_NONGRAPH_OBJS) \
	$(BASECALL_NONGRAPH_OBJS) $(MAPPING_NONGRAPH_OBJS)

tacembly : libfree.a libstaden.a tacemain.c $(TACEMBLY_OBJS)
	$(CC) -DACEMBLY -c tacemain.c -o tacemblymain.o
	$(LINKER) -o tacembly $(TACEMBLY_OBJS) tacemblymain.o -L. -lfree -lstaden $(LIBS) $(LEX_LIBS)
	chmod 755 tacembly$(EXE_SUFFIX)

# tacembly - version 5
TACEMBLY_5_OBJS = tacemain.acm.o command.acm.o banner.acm.o \
	$(NON_GRAPHIC_OBJS) session.ng5.o $(KERNEL_5_OBJS) $(ACE_5_OBJS) acelib.o \
	$(NON_GRAPHIC_MAPPING_OBJS) \
	$(NON_GRAPHIC_BASECALL_OBJS)

tacembly5 : libfree.a libstaden.a $(TACEMBLY_5_OBJS)
	$(LINKER) -o tacembly $(TACEMBLY_5_OBJS) -L. -lfree -lstaden $(LIBS) $(LEX_LIBS)
	chmod 755 tacembly$(EXE_SUFFIX)

######### the AQL test-platform #################

taql :  libfree.a libace.a taqlmain.o 
	$(LINKER) -o taql taqlmain.o -L. -lace -lfree $(LIBS) $(LEX_LIBS) 

#############################################################
### small test programs using purely libace functionality ###

acelibtest : libfree.a libace.a acelibtest.c
	$(CC) acelibtest.c
	$(LINKER) -o acelibtest acelibtest.o -L. -lace -lfree $(LIBS) $(LEX_LIBS)

tagcount : libfree.a libace.a tagcount.c
	$(CC) tagcount.c
	$(LINKER) -o tagcount tagcount.o -L. -lace -lfree $(LIBS)


##########################################
## drivers for remote control via XAtoms

xremote : xremotemain.o
	$(LINKER) -o xremote xremotemain.o $(XWIN_LIBS) -lXmu -lXt $(LIBS)

###############################################################################
################## Sockets server/client ACEDB programs #######################
###############################################################################

$(ACESOCK_SOCKET_OBJ): $(ACESOCK_TRANSPORT_HDR) $(ACESOCK_SOCKET_HDR)

$(ACESOCK_SERVER_OBJ): $(ACESOCK_TRANSPORT_HDR) $(ACESOCK_SERVER_HDR)

$(ACESOCK_UTILS_OBJ):  $(ACESOCK_UTILS_HDR)


##################### saceserver, the socket server ###########################
#saceserver:  libfree.a libace.a libmd5.a $(ACESOCK_SOCKET_OBJ) $(ACESOCK_UTILS_OBJ) \
#             $(ACESOCK_SERVER_OBJ)
saceserver:  libfree.a libace.a libmd5.a $(ACESOCK_ALL_OBJ)
	$(LINKER) -o $@  $(ACESOCK_SOCKET_OBJ) $(ACESOCK_UTILS_OBJ) $(ACESOCK_SERVER_OBJ) \
	 -L. -lace -lfree -lmd5 -lm $(LIBS) $(LEX_LIBS) 
	chmod 755 $(@)$(EXE_SUFFIX)

##################### sgifaceserver, graphical - via gifs ###################
SGIFACESERVER_OBJS = \
	$(GRAPHICAL_ACE_OBJS) \
	$(ALL_DISP_OBJS) \
	$(MAPCONT_ACE_OBJS) $(FMAP_ACE_OBJS) $(GRID_ACE_OBJS) \
        $(OTHER_OBJS) $(JO_OBJS)


sgifaceserver:  libfree.a  libgraph.a libgd.a libgiface.a libace.a libmd5.a serverace.c $(SGIFACESERVER_OBJS)  $(ACESOCK_ALL_OBJ)
	$(CC) -DGIFACESERVER -c serverace.c -o sgifaceserver.o 
	$(LINKER) -o $@ sgifaceserver.o  $(SGIFACESERVER_OBJS) \
	$(ACESOCK_SOCKET_OBJ) $(ACESOCK_UTILS_OBJ) serveracepasswd.o \
	 -L.  -lgiface -lgraph -lgd -lace -lfree -lmd5 -lm $(LIBS) $(LEX_LIBS) 
	chmod 755 $(@)$(EXE_SUFFIX)

##################### saceclient, client version of tace ####################
$(ACESOCK_CLIENT_OBJ): $(ACESOCK_UTILS_HDR) $(ACESOCK_CLIENTLIB_HDR) $(ACESOCK_CLIENT_HDR)

saceclient:  libfree.a libmd5.a  $(ACESOCK_SOCKET_OBJ) \
             $(ACESOCK_UTILS_OBJ) $(ACESOCK_CLIENTLIB_OBJ) $(ACESOCK_CLIENT_OBJ)
	$(LINKER) -o $@  $(ACESOCK_SOCKET_OBJ) $(ACESOCK_UTILS_OBJ) $(ACESOCK_CLIENTLIB_OBJ) \
	 $(ACESOCK_CLIENT_OBJ) commandmenu.o -L. -lfree -lmd5 -lm $(LIBS) $(LEX_LIBS)
	chmod 755 $(@)$(EXE_SUFFIX)

##################### sxaceclient, client version of xace ###################
SXACECLIENT_OBJS =  $(ACESOCK_XCLIENT_OBJ) $(ACESOCK_CLIENTLIB_OBJ) \
	$(ACESOCK_SOCKET_OBJ) $(ACESOCK_UTILS_OBJ) \
	$(GRAPHICAL_ACE_OBJS) \
	$(GRAPHICAL_BIO_ACE_OBJS)

sxaceclient : libfree.a libmd5.a $(GRAPHXWIN_DEPEND) libxace.a xclientmain.c $(SXACECLIENT_OBJS)
	$(CC) xclientmain.c
	$(LINKER) -o sxaceclient xclientmain.o $(SXACECLIENT_OBJS) \
	 -L. -lxace $(GRAPHXWIN_LIBS) -lfree -lmd5 $(XWIN_LIBS) $(LIBS) $(LEX_LIBS)  
	chmod 755 sxaceclient$(EXE_SUFFIX)

######################### clean all socket code. ############################
sace_build : saceserver sgifaceserver saceclient sxaceclient

sace_clean :
	rm -f $(ACESOCK_SOCKET_OBJ) $(ACESOCK_UTILS_OBJ) $(ACESOCK_SERVER_OBJ)
	rm -f saceclient $(ACESOCK_SOCKET_OBJ) $(ACESOCK_UTILS_OBJ) $(ACESOCK_CLIENT_OBJ)
	rm -f $(SXACECLIENT_OBJS) sxaceclient$(EXE_SUFFIX)



######################################################
#### RPC server/client ACEDB programs ################
######################################################


RPCGEN_PRODUCTS = rpcace.h rpcace_xdr.c rpcace_clnt.c rpcace_svc.c

$(RPCGEN_PRODUCTS): rpcace.x
	rpcgen $(RPCGEN_FLAGS) rpcace.x

rpcace_sp.o: rpcace_sp.c rpcace_svc.c

aceclientlib.o: aceclientlib.c rpcace.h
	$(CC) -c $<

RPC_CLIENT_OBJS = aceclientlib.o rpcace_clnt.o rpcace_xdr.o
RPC_SERVER_OBJS = rpcace_sp.o  rpcace_xdr.o 
NET_CLIENT_OBJS = aceclientlib.o rpcace_clnt.o rpcace_xdr.o
RPC_X_CLIENT_OBJS = xclient.o aceclientlib.o rpcace_clnt.o rpcace_xdr.o

libacecl.a : aceclientlib.o rpcace_clnt.o rpcace_xdr.o
	ar $(AR_OPTIONS) libacecl.a $?
	@if ( $(RANLIB_NEEDED) ) then ranlib libacecl.a; fi


################ aceserver, no graphics #################
ACESERVER_OBJS = $(RPC_SERVER_OBJS) 

aceserver : libfree.a libace.a aceserver.c $(ACESERVER_OBJS) rpcace.x rpcace.h
	$(CC) aceserver.c
	$(LINKER)  -o aceserver aceserver.o $(ACESERVER_OBJS) -L. -lace -lfree $(LIBS) $(LEX_LIBS)
	chmod 755 aceserver
	\rm -f rpc.acedbd
	ln -s aceserver rpc.acedbd

aceserver_clean :
	rm -f $(ACESERVER_OBJS) aceserver$(EXE_SUFFIX)

############# gifaceserver, does gifs of fmap etc. ################

GIFACESERVER_OBJS = \
	$(RPC_SERVER_OBJS) \
	$(GRAPHICAL_ACE_OBJS) \
	$(ALL_DISP_OBJS) \
	$(MAPCONT_ACE_OBJS) $(FMAP_ACE_OBJS) $(GRID_ACE_OBJS) \
        $(OTHER_OBJS) $(JO_OBJS)

gifaceserver : libfree.a libgraph.a libgd.a libgiface.a aceserver.c $(GIFACESERVER_OBJS) rpcace.x rpcace.h
	$(CC) -DGIFACESERVER -c aceserver.c -o gifaceserver.o 
	$(LINKER)  -o gifaceserver gifaceserver.o $(GIFACESERVER_OBJS) -L. -lgiface -lgraph -lgd -lfree $(LIBS) $(LEX_LIBS)
	chmod 755 gifaceserver
	\rm -f rpc.gifacedbd
	ln -s gifaceserver rpc.gifacedbd


############ gifacemblyserver, Jeans sequence assembly variant. ##########################
GIFACEMBLYSERVER_OBJS = \
	$(RPC_SERVER_OBJS) \
	$(GENERIC_ACEMBLY_OBJS) $(GENERIC_ACE_GRAPH_OBJS)  \
	$(GRAPHICAL_ACEMBLY_OBJS) $(GRAPHICAL_BIO_ACEMBLY_OBJS) \
	$(ABI_GRAPH_OBJS) $(BASECALL_GRAPH_OBJS) $(MAPPING_GRAPH_OBJS)


gifacemblyserver : libfree.a libgraph.a libgd.a  libstaden.a aceserver.c $(GIFACEMBLYSERVER_OBJS) rpcace.x rpcace.h
	$(CC) -DGIFACESERVER -c aceserver.c -o gifserver.o 
	$(LINKER)  -o gifacemblyserver gifserver.o $(GIFACEMBLYSERVER_OBJS) -L. -lgraph -lgd -lfree -lstaden $(LIBS) $(LEX_LIBS)
	chmod 755 gifacemblyserver$(EXE_SUFFIX)

gifacemblyserver_clean : 
	rm -f $(GIFACEMBLYSERVER_OBJS) gifacemblyserver$(EXE_SUFFIX)


####### text-based client #############

aceclient : libfree.a aceclient.c $(RPC_CLIENT_OBJS) rpcace.x rpcace.h
	$(CC) aceclient.c
	$(LINKER) -o aceclient aceclient.o $(RPC_CLIENT_OBJS) -L. -lfree $(LIBS)
	chmod 755 aceclient$(EXE_SUFFIX)

aceclient_clean :
	rm -f $(RPC_CLIENT_OBJS) aceclient$(EXE_SUFFIX)


####### graphical client ###############

XACECLIENT_OBJS =  $(RPC_X_CLIENT_OBJS) \
	$(GRAPHICAL_ACE_OBJS) \
	$(GRAPHICAL_BIO_ACE_OBJS)

xaceclient : libfree.a $(GRAPHXWIN_DEPEND) libxace.a xclientmain.c $(XACECLIENT_OBJS)
	$(CC) xclientmain.c
	$(LINKER) -o xaceclient xclientmain.o $(XACECLIENT_OBJS) -L. -lxace $(GRAPHXWIN_LIBS) -lfree $(XWIN_LIBS) $(LIBS) $(LEX_LIBS)  
	chmod 755 xaceclient$(EXE_SUFFIX)

xaceclient_clean :
	rm -f $(XACECLIENT_OBJS) xaceclient$(EXE_SUFFIX)




############################################
#### ACEDB-to-JADE programs ################
############################################

jade2ace : libfree.a jade2ace.c $(NET_CLIENT_OBJS) rpcace.x rpcace.h
	$(CC) jade2ace.c
	$(LINKER) -o jade2ace jade2ace.o $(NET_CLIENT_OBJS) -L. -lfree $(LIBS)
	chmod 755 jade2ace
	\rm -f netclient	
	ln -s jade2ace netclient

jade2sybase : libfree.a jade2sybase.o
	$(LINKER) -o jade2sybase jade2sybase.o -L. -lfree $(LIBS)
	chmod 755 jade2sybase

jadeserver : libfree.a libace.a jadeserver.c
	$(CC) jadeserver.c
	$(LINKER) -o jadeserver jadeserver.o -L. -lace -lfree $(LIBS) $(LEX_LIBS)
	chmod 755 jadeserver

###################################################
############## test programs ######################
###################################################

xtest : libfree.a $(GRAPHXWIN_DEPEND) graphtest.o 
	$(LINKER) -o xtest graphtest.o -L. $(GRAPHXWIN_LIBS) -lfree $(XWIN_LIBS) $(LIBS)

boxtest : libfree.a $(GRAPHXWIN_DEPEND) graphboxtest.o 
	$(LINKER) -o boxtest graphboxtest.o -L. $(GRAPHXWIN_LIBS) -lfree $(XWIN_LIBS) $(LIBS)

giftest : libgraph.a libgd.a graphtest.o 
	$(LINKER) -o giftest graphtest.o -L. -lgraph -lgd -lfree $(LIBS)

coltest : coltest.o $(GRAPHXWIN_DEPEND)
	$(LINKER) -o coltest coltest.o -L. $(GRAPHXWIN_LIBS) -lfree $(XWIN_LIBS) $(LIBS)

#### other programs #########################
##
diskdump : libfree.a diskdump.o
	$(LINKER) -o diskdump diskdump.o -L. -lfree $(LIBS)

diskfix : libfree.a diskfix.o
	$(LINKER) -o diskfix diskfix.o -L. -lfree $(LIBS)

blixelect : blxselect.o blxparser.o blixem.o translate.o dotter.o dotterKarlin.o $(GRAPHXWIN_DEPEND)
	$(LINKER) -o blixelect blxselect.o blxparser.o blixem.o dotter.o dotterKarlin.o \
	translate.o -L. $(GRAPHXWIN_LIBS) -lfree $(XWIN_LIBS) $(LIBS)

blixem : $(GRAPHXWIN_DEPEND) libfree.a blixem.o blxmain.o blxparser.o translate.o dotter.o dotterKarlin.o 
	$(LINKER) -o blixem blixem.o blxmain.o blxparser.o dotter.o dotterKarlin.o \
	translate.o -L. $(GRAPHXWIN_LIBS) -lfree $(XWIN_LIBS) $(LIBS)

blixem.o : blxview.c
	$(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME) -c -o $@ blxview.c


# I have removed this optimisation stuff from dotter for now because you cannot
# debug properly with it, EG
dotter.o: dotter.c
	$(COMPILER) $(USEROPTS) -g $(IDIR) -D$(NAME) -c -o $@ dotter.c

#	$(COMPILER) $(USEROPTS) -O2 -g3 $(IDIR) -D$(NAME) -c -o $@ dotter.c


belvu.o: belvu.c
	$(COMPILER) $(USEROPTS) -O2 -g3 $(IDIR) -D$(NAME) -c -o $@ belvu.c

efetch : efetch.o dbidx.o
	$(LINKER) -o efetch efetch.o dbidx.o

efetch.o: efetch.c
	$(CC) -DMIXDB efetch.c

intron2 : libfree.a intron2.o
	$(LINKER)  -o intron2 intron2.o -L. -lfree $(LIBS)

metacheck : libfree.a libace.a metadata.o
	  $(LINKER) -o metacheck metadata.o -L. -lace -lfree $(LIBS)

makeUserPasswd: makeUserPasswd.c libfree.a libmd5.a 
	$(CC) $@.c
	$(LINKER) -o $@ $@.o -L. -lfree -lmd5 $(LIBS)


#### conversion programs ###################
##
PMAPACE_OBJS  =  pmapace2.o
pmapace : libfree.a $(PMAPACE_OBJS)
	$(LINKER) -o pmapace $(PMAPACE_OBJS) -L. -lfree $(LIBS)

HOMONYM_OBJS  =  homonym.o 
homonym :  $(HOMONYM_OBJS)
	$(LINKER) -o homonym $(HOMONYM_OBJS) -L. -lfree $(LIBS)

acediff : libfree.a acediff.c
	$(CC) acediff.c
	$(LINKER) -o acediff acediff.o -L. -lfree $(LIBS)

# contributed by detlef: acediffs tace outputs
# using the fact that they are naturally sorted

acediffsorted : libfree.a acediffsorted.c
	$(CC) acediffsorted.c
	$(LINKER) -o acediffsorted acediffsorted.o -L. -lfree $(LIBS)


###### genbank indexing program #########################
##
WGNBK = wgnbk # links between modules 

GNBK_OBJS = gnbk.o gnbkserver.o  rpcgnbk_sp.o
GNBK_CLIENT_OBJS = gnbkclient.o gnbkclientlib.o rpcgnbk_clnt.o rpcgnbk_xdr.o

GNBK_SOURCES = rpcgnbk.x gnbk.c gnbkserver.c  rpcgnbk_sp.c \
	 gnbkclient.c gnbkclientlib.c 

$(GNBK_SOURCES) :
	@$(TEST) -L $@ || ln -s ../wgnbk/$@ .

RPCGNBK_PRODUCTS = rpcgnbk.h rpcgnbk_xdr.c  rpcgnbk_clnt.c rpcgnbk_svc.c

$(RPCGNBK_PRODUCTS): rpcgnbk.x
	rpcgen  $(RPCGEN_FLAGS) rpcgnbk.x

rpcgnbk_sp.o: rpcgnbk_sp.c  rpcgnbk_svc.c

gnbkserver.o: gnbkserver.c rpcgnbk.h 
	$(COMPILER) $(USEROPTS) $(IDIR) -D$(NAME)  -c $< 

gnbk :  libfree.a gnbkserver.o $(GNBK_OBJS) rpcgnbk_xdr.o 
	$(LINKER)  -o gnbk $(GNBK_OBJS) rpcgnbk_xdr.o -L. -lfree $(LIBS)

gnbkclient : libfree.a  gnbkserver.o $(GNBK_CLIENT_OBJS) rpcgnbk_xdr.o 
	$(LINKER)  -o gnbkclient $(GNBK_CLIENT_OBJS) -L. -lfree $(LIBS)


###########################################################
###### Staden library #####################################
## These modules were copied form Roger Staden distribution
## io_lib-1.7.tar.gz
## with just a modifications to support CTF format
## for example between staden's array.h and acedb array.h

libstaden.a makeSCF scf2ctf ctf2scf : libfree.a makefile.staden
	$(MAKE) -f makefile.staden  $@
	\rm makefile.staden    # to force evaluation each time

makefile.staden:
	cp ../wstaden/makefile.staden .
	chmod 666 makefile.staden

###########################################################
################## Ace C Library ##########################
###########################################################

WAC_SOURCES = acclient.c actable.c acinside.c

$(WAC_SOURCES):
	@$(TEST) -L $@ || ln -s ../wac/$@ .

acclient.o:     acclient.c ../wac/acclient_acetcp.c ../wac/acclient_rpc.c \
	../wac/acclient_socket.c


# LINK_ACC_RPC=$(RPC_CLIENT_OBJS)
LINK_ACC_RPC=

LINK_ACC=libaccl.a libfree.a $(LINK_ACC_RPC)
# LINK_ACC is the set of object files needed if you use
# the client version of the new Ace C library
#
# In NCBI AceDB, MUST HAVE libtsfree.a
# In Sanger AceDB, you MUST NOT HAVE libtsfree.a

LINK_ACS=libace.a libfree.a libtsfree.a
# LINK_ACS is what to use if you want a standalone Ace C program

LIBACCL_RPC_SUPPORT= aceclientlib.o rpcace_clnt.o rpcace_xdr.o
LIBACCL_SOCKET_SUPPORT=md5c.o

libaccl.a: acclient.o actable.o $(LIBACCL_RPC_SUPPORT) $(LIBACCL_SOCKET_SUPPORT)
	ar $(AR_OPTIONS) libaccl.a $?
	@if ( $(RANLIB_NEEDED) ) then ranlib libaccl.a; fi

###########################################################
#
# ace command interface, using new Ace C
#       will replace aceclient, works with any Ace C transport
#

accmd.c: ../wac/accmd.c
	@$(TEST) -L $@ || ln -s ../wac/accmd.c .

accmd.o:        accmd.c
	$(CC) -I.. -c accmd.c

# The "t" in taceclient stands for "TCP".  This client actually speaks
# any transport protocol known by Ace C.  I originally called it accmd,
# but Jean wanted it named taceclient so it would more resemble aceclient,
# the thing it is replacing.
# Note that taceclient is NOT a drop-in replacement for aceclient.

taceclient accmd: accmd.o $(LINK_ACC)
	$(LINKER) -o taceclient accmd.o $(LINK_ACC) $(LIBS)
	rm -f accmd
	ln taceclient accmd

# saccmd is ac cmd that runs standalone (i.e. without a server)

saccmd: accmd.o $(LINK_ACS)
	$(LINKER) -o $@ accmd.o $(LINK_ACS) $(LIBS) $(LEX_LIBS)

###########################################################
#
# ace client test for new ace C
#

acctest.c: ../wac/acctest.c
	@$(TEST) -L $@ || ln -s ../wac/acctest.c .

acctest.o:      acctest.c
	$(CC) -I.. -c acctest.c

acctest: acctest.o $(LINK_ACC)
	$(LINKER) -o acctest acctest.o $(LINK_ACC) $(LIBS)


acstest: acctest.o $(LINK_ACS)
	$(LINKER) -o acstest acctest.o $(LINK_ACS) $(LIBS) $(LEX_LIBS) 



###########################################################
################## installation ###########################
###########################################################

install_bin :
	@echo 'installing' $@ ;
	for target in $(INSTALL_BIN) ; do  \
	echo 'installing' $$target 'for $(ACEDB_MACHINE)' ; \
	cp $$target $(ACEDB)/bin ; \
	done
	cd $(ACEDB)/bin ; chmod 755 $(INSTALL_BIN)



###########################################################
################## distribution ###########################
###########################################################

# This target cleans up the bin.NNN directory so that it
# contains only executables.
bindistclean :
	@rm -f *.o *.c *.a *.l *.y deffile makefile *.h *.x


# These targets need some work....
clean :
	rm -rf libraries.untarred libraries.install

distclean :
	rm -f ../w*/core ../w*/*~
	rm -rf libraries.untarred libraries.install

dist :
	cd ..; rm w*/*~; \
	tar cvf - w* --exclude CVS --exclude .cvsignore --exclude *~ | gzip -c > ace.tar.gz



###########################################################
############## 3rd party libraries ########################
###########################################################

#libraries :
#	cd ..; w3rdparty/build_all_3rdparty $(GTKVER) $(LIBCC) $(LIBLDFLAGS)

libraries :
	cd ..; w3rdparty/build_all_3rdparty $(LIBCC) $(LIBLDFLAGS)



###########################################################
########### end of the acedb truemake file ################
###########################################################