3353ff05efdf25ead90c5a4353e382bdd5b65396
[yaz-moved-to-github.git] / win / makefile
1 # makefile.mak - makefile for MS NMAKE 
2 # $Id: makefile,v 1.18 2000-11-01 14:47:00 adam Exp $
3 #
4 # Programmed by
5 #  HL: Heikki Levanto, Index Data
6 #
7 # Log at the end of the file
8 #
9 # Missing
10 # - Move MS-C's whatnots into win direcotry
11 # - The TCL script produces C and H files in the same dir as the 
12 #   ASN files. H's are copied to INCL, C's are left there.
13 #   They should be produced into OBJ...
14 #  
15 # Envoronment problems
16 # - You need to have the proper path and environment for VC set
17 #   up. There is a bat file VCVARS32.BAT that sets most of it up
18 #   for you. You can find this somewhere near DevStudio\VC\BIN
19 # - RegSvr32 must also be along the path, often in WINDOWS\SYSTEM
20 # - TCL has to be available too, if compiling for NEW_Z3950
21
22 ###########################################################
23 ############### Parameters 
24 ###########################################################
25
26 DEBUG=0   # 0 for release, 1 for debug
27
28 NEW_Z3950=1  # 0= use old asn files
29              # 1= generate files from *.asn (needs tcl)
30
31
32 default: all
33
34 all: dirs proto_h dll client ztest 
35
36 generate: generated_files
37
38 ###########################################################
39 ############### Directories
40 ###########################################################
41 # The current directory is supposed to be something like
42 # ..../Yaz/Win, everything is relative to that
43 ROOTDIR=..   # The home of Yaz
44
45 INCLDIR=$(ROOTDIR)\include  # our includes
46 LIBDIR=$(ROOTDIR)\lib       # We produce .lib, .exp etc there
47 BINDIR=$(ROOTDIR)\bin       # We produce exes and dlls there
48 WINDIR=$(ROOTDIR)\win       # all these Win make things
49 OBJDIR=$(WINDIR)\obj        # where we store intermediate files
50 UNIXDIR=$(ROOTDIR)\unix     # corresponding unix things
51 SRCDIR=$(ROOTDIR)           # for the case we move them under src
52
53 ASNDIR=$(SRCDIR)\ASN
54 COMSTACKDIR=$(SRCDIR)\COMSTACK
55 ODRDIR=$(SRCDIR)\ODR
56 UTILDIR=$(SRCDIR)\UTIL
57 ZUTILDIR=$(SRCDIR)\ZUTIL
58 RETDIR=$(SRCDIR)\RETRIEVAL
59 Z3950DIR=$(SRCDIR)\Z39.50
60 ILLDIR=$(SRCDIR)\ill
61 CCLDIR=$(SRCDIR)\ccl
62
63 CLIENTDIR=$(SRCDIR)\CLIENT
64 SERVERDIR=$(SRCDIR)\SERVER
65 ZTESTDIR=$(SRCDIR)\ZTEST
66
67 TMPDIR=$(ROOTDIR)\win\tmp
68 TMP=$(TMPDIR)
69
70 ###########################################################
71 ############### Targets - what to make
72 ###########################################################
73
74
75 DLL=$(BINDIR)\Yaz.dll
76 IMPLIB=$(LIBDIR)\Yaz.lib
77
78 CLIENT=$(BINDIR)\yaz-client.exe
79 ZTEST=$(BINDIR)\yaz-ztest.exe
80 PROTOH=$(INCLDIR)\yaz\proto.h
81
82 # shortcut names defined here
83 dll : $(DLL) 
84 client: $(CLIENT)
85 ztest: $(ZTEST)
86 proto_h: $(PROTOH)
87
88 ###########################################################
89 ############### Compiler and linker options 
90 ###########################################################
91
92
93 ### C and CPP compiler  (the same thing)
94 # Note: $(CPP) has already been defined in the environment
95 # (if you set things up right!)
96
97 COMMON_C_OPTIONS=          \
98   /nologo /W3 /GX /FD /c   \
99   /D "WIN32" /D "_WINDOWS" \
100   /D "CCL2RPN=1"           \
101   /FR"$(OBJDIR)\\"         \
102   /Fo"$(OBJDIR)\\"         \
103   /Fd"$(OBJDIR)\\" 
104
105 COMMON_C_INCLUDES= \
106   /I"$(SRCDIR)\include"
107
108 DEBUG_C_OPTIONS=  \
109   /D "_DEBUG"      \
110   /MDd  /Od /YX /Zi /Gm
111
112 RELEASE_C_OPTIONS=  \
113   /D "NDEBUG"        \
114   /MD /O2
115
116 # /W3  = warning level
117 # /GX  = Enable exception handling
118 # /FD  = Generate file dependencies (what ever they are)
119 # /c   = compile without linking
120 # /FR  = Generate browse info (.sbr file that gets combined into .bsc)
121 # /Fo  = object file name (or at least path)
122 # /Fd  = debug database name (or path)
123 # /MD  = Runtime library: Multithread DLL
124 # /MDd = Runtime library: Multithread DLL (debug)
125 # /Od  = Disable optimising (debug)
126 # /O2  = Optimize for speed
127 # /YX  = Automatic use of precomipled headers
128 # /Gm  = Minimal rebuild (some cpp class stuff)
129 # /Zi  = Program database for debuggers
130 # /ZI  = Pgm database with special "edit&continue" stuff - not available in C5
131
132
133 ### Linker options
134 LINK=link.exe
135
136 LINK_LIBS= kernel32.lib user32.lib   gdi32.lib   winspool.lib \
137            comdlg32.lib advapi32.lib shell32.lib ole32.lib    \
138            oleaut32.lib uuid.lib     odbc32.lib  odbccp32.lib \
139            wsock32.lib  advapi32.lib
140
141 COMMON_LNK_OPTIONS= /nologo \
142                     /subsystem:windows \
143                     /machine:i386 \
144                           /incremental:no
145
146 DEBUG_LNK_OPTIONS= /debug 
147
148 RELEASE_LNK_OPTIONS=  /pdb:none
149
150 DLL_LINK_OPTIONS= /dll  
151 CLIENT_LINK_OPTIONS = /subsystem:console  
152 SERVER_LINK_OPTIONS = -lib 
153 ZTEST_LINK_OPTIONS = /subsystem:console  
154
155 # TCL
156 TCL="C:\Program Files\Tcl\bin\tclsh83.exe"
157 HAVE_TCL=1
158
159 COMMON_TCL_OPTIONS= ..\util\yaz-comp -I$(INCLDIR) -i yaz
160
161 # Final opt variables
162 !if $(DEBUG)
163 COPT=   $(COMMON_C_OPTIONS)   $(DEBUG_C_OPTIONS)     $(COMMON_C_INCLUDES)
164 MTLOPT= $(COMMON_MTL_OPTIONS) $(DEBUG_MTL_OPTIONS)
165 RCOPT=  $(COMMON_RC_OPTIONS)  $(DEBUG_RC_OPTIONS)
166 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS)   $(LNK_LIBS)
167 TCLOPT= $(COMMON_TCL_OPTIONS)
168
169 !else
170 COPT=   $(COMMON_C_OPTIONS)   $(RELEASE_C_OPTIONS)   $(COMMON_C_INCLUDES) 
171 MTLOPT= $(COMMON_MTL_OPTIONS) $(RELEASE_MTL_OPTIONS)
172 RCOPT=  $(COMMON_RC_OPTIONS)  $(RELEASE_RC_OPTIONS)
173 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
174 TCLOPT= $(COMMON_TCL_OPTIONS)
175 !endif
176
177
178
179 ###########################################################
180 ###############  Source and object modules
181 ###########################################################
182
183 # Note: Ordinary source files are not specified here at 
184 # all, make finds them in suitable dirs. The object modules
185 # need to be specified, though
186
187 YAZ_CLIENT_OBJS= \
188    $(OBJDIR)\client.obj \
189    $(OBJDIR)\admin.obj
190
191 YAZ_SERVER_OBJS= \
192         "$(OBJDIR)\eventl.obj" \
193         "$(OBJDIR)\requestq.obj" \
194         "$(OBJDIR)\service.obj" \
195         "$(OBJDIR)\seshigh.obj" \
196         "$(OBJDIR)\statserv.obj" \
197         "$(OBJDIR)\tcpdchk.obj" 
198
199 ZTEST_OBJS= \
200         "$(OBJDIR)\read-grs.obj" \
201         "$(OBJDIR)\ztest.obj" 
202
203 YAZ_CCL_OBJS= \
204    $(OBJDIR)\cclerrms.obj \
205    $(OBJDIR)\cclfind.obj \
206    $(OBJDIR)\cclptree.obj \
207    $(OBJDIR)\cclqfile.obj \
208    $(OBJDIR)\cclqual.obj \
209    $(OBJDIR)\cclstr.obj \
210    $(OBJDIR)\ccltoken.obj
211
212 YAZ_ASN_OBJS= \
213    $(OBJDIR)\proto.obj \
214    $(OBJDIR)\prt-acc.obj \
215    $(OBJDIR)\prt-add.obj \
216    $(OBJDIR)\prt-arc.obj \
217    $(OBJDIR)\prt-dat.obj \
218    $(OBJDIR)\prt-dia.obj \
219    $(OBJDIR)\prt-esp.obj \
220    $(OBJDIR)\prt-exd.obj \
221    $(OBJDIR)\prt-exp.obj \
222    $(OBJDIR)\prt-grs.obj \
223    $(OBJDIR)\prt-rsc.obj \
224    $(OBJDIR)\prt-univ.obj 
225
226 YAZ_COMSTACK_OBJS= \
227    $(OBJDIR)\comstack.obj \
228    $(OBJDIR)\tcpip.obj \
229    $(OBJDIR)\waislen.obj 
230
231 YAZ_ODR_OBJS= \
232    $(OBJDIR)\ber_any.obj \
233    $(OBJDIR)\ber_bit.obj \
234    $(OBJDIR)\ber_bool.obj \
235    $(OBJDIR)\ber_int.obj \
236    $(OBJDIR)\ber_len.obj \
237    $(OBJDIR)\ber_null.obj \
238    $(OBJDIR)\ber_oct.obj \
239    $(OBJDIR)\ber_oid.obj \
240    $(OBJDIR)\ber_tag.obj \
241    $(OBJDIR)\dumpber.obj \
242    $(OBJDIR)\odr.obj \
243    $(OBJDIR)\odr_any.obj \
244    $(OBJDIR)\odr_bit.obj \
245    $(OBJDIR)\odr_bool.obj \
246    $(OBJDIR)\odr_choice.obj \
247    $(OBJDIR)\odr_cons.obj \
248    $(OBJDIR)\odr_enum.obj \
249    $(OBJDIR)\odr_int.obj \
250    $(OBJDIR)\odr_mem.obj \
251    $(OBJDIR)\odr_null.obj \
252    $(OBJDIR)\odr_oct.obj \
253    $(OBJDIR)\odr_oid.obj \
254    $(OBJDIR)\odr_seq.obj \
255    $(OBJDIR)\odr_tag.obj \
256    $(OBJDIR)\odr_use.obj \
257    $(OBJDIR)\odr_util.obj 
258
259 YAZ_UTIL_OBJS= \
260    $(OBJDIR)\atoin.obj \
261    $(OBJDIR)\log.obj \
262    $(OBJDIR)\marcdisp.obj \
263    $(OBJDIR)\nmem.obj \
264    $(OBJDIR)\nmemsdup.obj \
265    $(OBJDIR)\oid.obj \
266    $(OBJDIR)\options.obj \
267    $(OBJDIR)\readconf.obj \
268    $(OBJDIR)\tpath.obj \
269    $(OBJDIR)\wrbuf.obj \
270    $(OBJDIR)\xmalloc.obj \
271    $(OBJDIR)\matchstr.obj 
272
273 YAZ_ZUTIL_OBJS= \
274    $(OBJDIR)\diagbib1.obj \
275    $(OBJDIR)\zget.obj \
276    $(OBJDIR)\prt-ext.obj \
277    $(OBJDIR)\logrpn.obj \
278    $(OBJDIR)\pquery.obj \
279    $(OBJDIR)\yaz-ccl.obj \
280    $(OBJDIR)\otherinfo.obj
281
282 YAZ_RET_OBJS= \
283    $(OBJDIR)\d1_absyn.obj\
284    $(OBJDIR)\d1_attset.obj\
285    $(OBJDIR)\d1_doespec.obj\
286    $(OBJDIR)\d1_espec.obj\
287    $(OBJDIR)\d1_expout.obj\
288    $(OBJDIR)\d1_grs.obj\
289    $(OBJDIR)\d1_handle.obj\
290    $(OBJDIR)\d1_map.obj\
291    $(OBJDIR)\d1_marc.obj\
292    $(OBJDIR)\d1_prtree.obj\
293    $(OBJDIR)\d1_read.obj\
294    $(OBJDIR)\d1_soif.obj\
295    $(OBJDIR)\d1_sumout.obj\
296    $(OBJDIR)\d1_sutrs.obj\
297    $(OBJDIR)\d1_tagset.obj\
298    $(OBJDIR)\d1_varset.obj\
299    $(OBJDIR)\d1_write.obj\
300    $(OBJDIR)\d1_if.obj
301
302 Z3950_OBJS= \
303    $(OBJDIR)\z-date.obj\
304    $(OBJDIR)\z-univ.obj\
305    $(OBJDIR)\zes-update.obj\
306    $(OBJDIR)\zes-admin.obj \
307    $(OBJDIR)\z-accdes1.obj \
308    $(OBJDIR)\z-accform1.obj \
309    $(OBJDIR)\z-acckrb1.obj \
310    $(OBJDIR)\z-core.obj \
311    $(OBJDIR)\z-diag1.obj \
312    $(OBJDIR)\z-espec1.obj \
313    $(OBJDIR)\z-estask.obj \
314    $(OBJDIR)\z-exp.obj \
315    $(OBJDIR)\z-grs.obj \
316    $(OBJDIR)\z-opac.obj \
317    $(OBJDIR)\z-uifr1.obj \
318    $(OBJDIR)\z-rrf1.obj \
319    $(OBJDIR)\z-rrf2.obj \
320    $(OBJDIR)\z-sum.obj \
321    $(OBJDIR)\z-sutrs.obj \
322    $(OBJDIR)\zes-expi.obj \
323    $(OBJDIR)\zes-exps.obj \
324    $(OBJDIR)\zes-order.obj \
325    $(OBJDIR)\zes-pquery.obj \
326    $(OBJDIR)\zes-psched.obj \
327    $(OBJDIR)\zes-pset.obj \
328    $(OBJDIR)\zes-update0.obj
329
330 ILL_OBJS= \
331    $(OBJDIR)\ill-get.obj\
332    $(OBJDIR)\ill-core.obj\
333    $(OBJDIR)\item-req.obj
334
335 COMMON_YAZ_OBJS= \
336    $(YAZ_UTIL_OBJS) \
337    $(YAZ_ODR_OBJS) \
338    $(YAZ_COMSTACK_OBJS) \
339    $(YAZ_ZUTIL_OBJS) \
340    $(YAZ_CCL_OBJS) \
341    $(YAZ_RET_OBJS) \
342    $(YAZ_SERVER_OBJS) 
343
344 !if $(NEW_Z3950)
345 YAZ_OBJS= \
346         $(COMMON_YAZ_OBJS) \
347         $(Z3950_OBJS) \
348         $(ILL_OBJS) 
349 !else
350 YAZ_OBJS= \
351         $(COMMON_YAZ_OBJS) \
352         $(YAZ_ASN_OBJS)
353 !endif
354
355 DLL_OBJS= $(YAZ_OBJS)
356
357 ALL_OBJS= \
358         $(YAZ_OBJS) \
359         $(YAZ_CLIENT_OBJS) \
360         $(ZTEST_OBJS)
361
362
363 ##########################################################
364 ############## proto.h
365 ##########################################################
366
367 !if $(NEW_Z3950)
368 $(PROTOH): makefile $(INCLDIR)\yaz\z-proto.h
369         type $(INCLDIR)\yaz\z-proto.h > $(PROTOH)
370 !else   
371 $(PROTOH): makefile $(INCLDIR)\yaz\prt-proto.h 
372         copy $(ASNDIR)\*.h $(INCLDIR)\yaz
373         type $(INCLDIR)\yaz\prt-proto.h > $(PROTOH)
374 !endif
375
376
377 ###########################################################
378 ############### Generated C and H files
379 #####
380 ######################################################
381
382
383 Z3950_C_DIR=$(Z3950DIR)   
384 ILL_C_DIR=$(ILLDIR)
385 #!!! Should be moved to OBJ, but that requires too much trickery
386
387 # Files generated from datetime.asn
388 DATETIME_H_FILES = $(INCLDIR)\yaz\z-date.h
389 DATETIME_C_FILES = $(Z3950_C_DIR)\z-date.c
390
391 # Files generated from univres.asn
392 UNIVRES_H_FILES = $(INCLDIR)\yaz\z-univ.h
393 UNIVRES_C_FILES = $(Z3950_C_DIR)\z-univ.c
394
395 # Files generated from esupdate.asn
396 ESUPDATE_H_FILES = $(INCLDIR)\yaz\zes-update.h
397 ESUPDATE_C_FILES = $(Z3950_C_DIR)\zes-update.c
398
399 # Files generated from esadmin.asn
400 ESADMIN_H_FILES = $(INCLDIR)\yaz\zes-admin.h
401 ESADMIN_C_FILES = $(Z3950_C_DIR)\zes-admin.c
402
403 # Files created from z3950v3.asn
404 Z3950V3_H_FILES= \
405    $(INCLDIR)\yaz\z-accdes1.h \
406    $(INCLDIR)\yaz\z-core.h
407
408 Z3950V3_C_FILES= \
409    $(Z3950_C_DIR)\z-accdes1.c \
410    $(Z3950_C_DIR)\z-accform1.c \
411    $(Z3950_C_DIR)\z-acckrb1.c \
412    $(Z3950_C_DIR)\z-core.c \
413    $(Z3950_C_DIR)\z-diag1.c \
414    $(Z3950_C_DIR)\z-espec1.c \
415    $(Z3950_C_DIR)\z-estask.c \
416    $(Z3950_C_DIR)\z-exp.c \
417    $(Z3950_C_DIR)\z-grs.c \
418    $(Z3950_C_DIR)\z-opac.c \
419    $(Z3950_C_DIR)\z-uifr1.c \
420    $(Z3950_C_DIR)\z-rrf1.c \
421    $(Z3950_C_DIR)\z-rrf2.c \
422    $(Z3950_C_DIR)\z-sum.c \
423    $(Z3950_C_DIR)\z-sutrs.c \
424    $(Z3950_C_DIR)\zes-expi.c \
425    $(Z3950_C_DIR)\zes-exps.c \
426    $(Z3950_C_DIR)\zes-order.c \
427    $(Z3950_C_DIR)\zes-pquery.c \
428    $(Z3950_C_DIR)\zes-psched.c \
429    $(Z3950_C_DIR)\zes-pset.c \
430    $(Z3950_C_DIR)\zes-update0.c
431
432 # Files generated from ill9702.asn
433 ILL_CORE_H_FILES= \
434    $(INCLDIR)\yaz\ill-core.h
435
436 ILL_CORE_C_FILES= \
437    $(ILL_C_DIR)\ill-core.c
438
439 # Files generated from itemreq.asn
440 ITEM_REQ_H_FILES= \
441    $(INCLDIR)\yaz\item-req.h
442
443 ITEM_REQ_C_FILES= \
444    $(ILL_C_DIR)\item-req.c
445
446 # Combined..
447 DATETIME_FILES = $(DATETIME_H_FILES) $(DATETIME_C_FILES)
448 UNIVRES_FILES = $(UNIVRES_H_FILES) $(UNIVRES_C_FILES)
449 ESUPDATE_FILES = $(ESUPDATE_H_FILES) $(ESUPDATE_C_FILES)
450 ESADMIN_FILES = $(ESADMIN_H_FILES) $(ESADMIN_C_FILES)
451 Z3950V3_FILES= $(Z3950V3_C_FILES) $(Z3950V3_H_FILES)
452 ILL_CORE_FILES= $(ILL_CORE_C_FILES) $(ILL_CORE_H_FILES)
453 ITEM_REQ_FILES= $(ITEM_REQ_C_FILES) $(ITEM_REQ_H_FILES)
454
455 GENERATED_C_FILES= \
456    $(Z3950V3_C_FILES)  \
457    $(ESUPDATE_C_FILES) \
458    $(UNIVRES_C_FILES)  \
459    $(DATETIME_C_FILES) \
460    $(ESADMIN_C_FILES)
461
462 GENERATED_H_FILES= \
463    $(Z3950V3_H_FILES)  \
464    $(ESUPDATE_H_FILES) \
465    $(UNIVRES_H_FILES)  \
466    $(DATETIME_H_FILES) \
467    $(ESADMIN_H_FILES)
468
469 generated_files: \
470         $(GENERATED_H_FILES) \
471         $(GENERATED_C_FILES) \
472         $(PROTOH)
473
474
475 ###########################################################
476 ############### Compiling 
477 ###########################################################
478
479 # Note: This defines where to look for the necessary
480 # source files. Funny way of doing it, but it works.
481
482 # DLL sources
483 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
484         @$(CPP) $(COPT) $<
485
486 # Yaz client
487 {$(CLIENTDIR)}.c{$(OBJDIR)}.obj:
488         @$(CPP) $(COPT) $< /D"_CONSOLE"
489
490 # Ztest
491 {$(ZTESTDIR)}.c{$(OBJDIR)}.obj:
492         @$(CPP) $(COPT) $< /D"_CONSOLE"
493
494 # Server
495 {$(SERVERDIR)}.c{$(OBJDIR)}.obj:
496         @$(CPP) $(COPT) $< 
497
498 # Various YAZ source directories
499 {$(ASNDIR)}.c{$(OBJDIR)}.obj:
500         @$(CPP) $(COPT) $< 
501
502 {$(COMSTACKDIR)}.c{$(OBJDIR)}.obj:
503         @$(CPP) $(COPT) $< 
504
505 {$(ODRDIR)}.c{$(OBJDIR)}.obj:
506         @$(CPP) $(COPT) $< 
507
508 {$(UTILDIR)}.c{$(OBJDIR)}.obj:
509         @$(CPP) $(COPT) $< 
510
511 {$(ZUTILDIR)}.c{$(OBJDIR)}.obj:
512         @$(CPP) $(COPT) $< 
513
514 {$(RETDIR)}.c{$(OBJDIR)}.obj:
515         @$(CPP) $(COPT) $<
516
517 {$(Z3950_C_DIR)}.c{$(OBJDIR)}.obj:
518         @$(CPP) $(COPT) $< 
519
520 {$(ILL_C_DIR)}.c{$(OBJDIR)}.obj:
521         @$(CPP) $(COPT) $< 
522
523 {$(CCLDIR)}.c{$(OBJDIR)}.obj:
524         @$(CPP) $(COPT) $< 
525
526 ############### ASN-generated files
527
528 !if $(HAVE_TCL)
529
530 $(Z3950V3_FILES): $(Z3950DIR)\z3950v3.asn
531         @cd $(Z3950DIR)
532         $(TCL) $(TCLOPT) -d z.tcl z3950v3.asn
533         @cd $(WINDIR)
534
535 $(DATETIME_FILES): $(Z3950DIR)\datetime.asn
536         @cd $(Z3950DIR)
537         $(TCL) $(TCLOPT) -d z.tcl datetime.asn
538         @cd $(WINDIR)
539
540 $(UNIVRES_FILES): $(Z3950DIR)\univres.asn
541         @cd $(Z3950DIR)
542         $(TCL) $(TCLOPT) -d z.tcl univres.asn
543         @cd $(WINDIR)
544
545 $(ESUPDATE_FILES): $(Z3950DIR)\esupdate.asn
546         @cd $(Z3950DIR)
547         $(TCL) $(TCLOPT) -d z.tcl esupdate.asn
548         @cd $(WINDIR)
549
550 $(ESADMIN_FILES): $(Z3950DIR)\esadmin.asn
551         @cd $(Z3950DIR)
552         $(TCL) $(TCLOPT) -d z.tcl esadmin.asn
553         @cd $(WINDIR)
554
555 $(ILL_CORE_FILES): $(ILLDIR)\ill9702.asn
556         @cd $(ILLDIR)
557         $(TCL) $(TCLOPT) -d ill.tcl ill9702.asn
558         @cd $(WINDIR)
559
560 $(ITEM_REQ_FILES): $(ILLDIR)\item-req.asn
561         @cd $(ILLDIR)
562         $(TCL) $(TCLOPT) -d ill.tcl item-req.asn
563         @cd $(WINDIR)
564
565 !endif
566
567 ###########################################################
568 ############### Linking
569 ###########################################################
570
571 $(DLL) $(IMPLIB): "$(BINDIR)" $(DLL_OBJS) 
572         @echo Linking the dll  $(DLL)
573         $(LINK) @<<
574                 $(LNKOPT) 
575                 $(LINK_LIBS) 
576                 $(DLL_LINK_OPTIONS)
577                 $(DLL_OBJS) 
578                 /out:$(DLL) 
579                 /implib:"$(LIBDIR)\yaz.lib"
580                 /pdb:"$(LIBDIR)\yaz.pdb" 
581                 /map:"$(LIBDIR)\yaz.map"  
582 <<
583
584 $(CLIENT) : "$(BINDIR)" $(YAZ_CLIENT_OBJS) 
585         @echo Linking the client  $(CLIENT)
586         $(LINK) @<<
587         $(LNKOPT) 
588                 $(CLIENT_LINK_OPTIONS)
589                 $(LINK_LIBS) 
590                 $(IMPLIB)
591                 $(YAZ_CLIENT_OBJS)
592                 /pdb:"$(LIBDIR)\yaz-client.pdb"
593                 /map:"$(LIBDIR)\yaz-client.map"
594                 /out:$(CLIENT)
595 <<
596
597 $(ZTEST) : "$(BINDIR)" $(ZTEST_OBJS) $(DLL)
598         @echo Linking the ztest  $(ZTEST)
599         $(LINK) @<<
600         $(LNKOPT) 
601                 $(ZTEST_LINK_OPTIONS)
602                 $(LINK_LIBS) 
603                 shell32.lib
604                 $(IMPLIB)
605                 $(ZTEST_OBJS) 
606                 /implib:"$(LIBDIR)\yaz-ztest.lib"
607                 /pdb:"$(LIBDIR)\yaz-ztest.pdb"
608                 /map:"$(LIBDIR)\yaz-ztest.map"
609                 /out:$(ZTEST) 
610 <<
611
612
613 # note that this links a lib, so it uses completely different options.
614
615 ###########################################################
616 ############### Special operations
617 ###########################################################
618
619
620 ############## clean
621 clean:
622         del $(DLL) 
623         del $(CLIENT)
624         del $(ZTEST)
625         del $(TMPDIR)\*.
626
627         del $(LIBDIR)\*.MAP
628
629         del $(LIBDIR)\*.LIB
630         del $(OBJDIR)\*.OBJ
631
632         del $(PROTOH)
633
634 realclean: clean
635         del $(Z3950_C_DIR)\*.c
636         del $(Z3950_C_DIR)\*.h
637         del $(INCLDIR)\yaz\z-accdes1.h
638         del $(INCLDIR)\yaz\z-core.h
639         del $(DATETIME_H_FILES)
640         del $(UNIVRES_H_FILES)
641         del $(ESUPDATE_H_FILES)
642
643 # Because DOS del will only accept one file name to delete,
644 # the _H_ files work only on sets that have just one file.
645 # Z3950_H_FILES had to be spelled out. One more point for MS!
646
647 ########### check directories and create if needed
648 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR)
649
650 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR):
651         if not exist "$@/$(NUL)" mkdir "$@"
652
653
654 ###########################################################
655 ############### Explicit dependencies
656 ###########################################################
657
658 $(ALL_OBJS): $(PROTOH)
659
660 # force recompilation of everything, if makefile changed
661
662 $(Z3950_OBJS): $(GENERATED_C_FILES) $(GENERATED_H_FILES)
663
664 $(ILL_OBJS): $(ILL_CORE_FILES) $(ITEM_REQ_FILES)
665
666 !if $(NEW_Z3950)
667 $(PROTOH): $(GENERATED_C_FILES) $(GENERATED_H_FILES)
668 !endif
669 # makes sure we generate before compiling anything, as the
670 # new proto.h refers to the generated files, and is included
671 # in various places
672
673 ###########################################################
674 ############### Log
675 ###########################################################
676 #
677 # $Log: makefile,v $
678 # Revision 1.18  2000-11-01 14:47:00  adam
679 # Added CCL support for WIN32.
680 #
681 # Revision 1.17  2000/10/06 12:01:12  adam
682 # Updates regarding ASN-code generation (mostly).
683 #
684 # Revision 1.16  2000/05/05 13:48:15  adam
685 # Minor changes.
686 #
687 # Revision 1.15  2000/04/17 14:21:38  adam
688 # WIN32 update.
689 #
690 # Revision 1.14  2000/03/02 08:48:21  adam
691 # Renamed ASN.1 compiler to yaz-comp (used to be yc.tcl).
692 #
693 # Revision 1.13  2000/02/28 11:13:03  adam
694 # Removed odr_priv.obj.
695 #
696 # Revision 1.12  2000/01/06 11:27:16  adam
697 # Updated for ILL.
698 #
699 # Revision 1.11  1999/12/21 14:16:20  ian
700 # Changed retrieval module to allow data1 trees with no associated absyn.
701 # Also added a simple interface for extracting values from data1 trees using
702 # a string based tagpath.
703 #
704 # Revision 1.10  1999/12/08 13:10:48  adam
705 # New version.
706 #
707 # Revision 1.9  1999/11/30 13:47:12  adam
708 # Improved installation. Moved header files to include/yaz.
709 #
710 # Revision 1.8  1999/07/21 08:48:02  adam
711 # Removed dmalloc.obj.
712 #
713 # Revision 1.7  1999/06/09 15:10:08  heikki
714 # Cleaning up. Seems to work all right
715 #
716 # Revision 1.6  1999/06/09 13:33:32  heikki
717 # Compiles and links both old and new type stuff all right
718 #
719 # Revision 1.5  1999/06/09 11:05:30  heikki
720 # At least it can compile
721 #
722 # Revision 1.4  1999/06/09 09:41:09  heikki
723 # More work on the ASN-generated files.
724 #
725 # Revision 1.3  1999/06/08 14:32:30  heikki
726 # Proto.h works all right, removed linker warnings from server.lib
727 #
728 # Revision 1.2  1999/06/08 14:07:24  heikki
729 # Renamed a pile of files
730 # Tmpdir (to get around Ms leaving temp files around, and crashing
731 # when too many with same number...)
732 #
733 # Revision 1.1  1999/06/08 12:15:41  heikki
734 # Renamed to makefile (.nothing) (from .mak)
735 # Working on the proto.h problems and alternative confiigurations
736 #
737 # Revision 1.5  1999/06/04 10:04:28  heikki
738 # Cleaning up
739 #
740 # Revision 1.4  1999/06/02 13:23:29  heikki
741 # Debug options for C compiler
742 #
743 # Revision 1.3  1999/05/19 08:26:22  heikki
744 # Added comments
745 #
746 #
747
748
749