Updated for ILL.
[yaz-moved-to-github.git] / win / makefile
1 # Makefile.mak - makefile for MS NMAKE 
2 # $Id: makefile,v 1.12 2000-01-06 11:27:16 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 server 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
62 CLIENTDIR=$(SRCDIR)\CLIENT
63 SERVERDIR=$(SRCDIR)\SERVER
64 ZTESTDIR=$(SRCDIR)\ZTEST
65
66 TMPDIR=$(ROOTDIR)\win\tmp
67 TMP=$(TMPDIR)
68
69 ###########################################################
70 ############### Targets - what to make
71 ###########################################################
72
73
74 DLL=$(BINDIR)\Yaz.dll
75 IMPLIB=$(LIBDIR)\Yaz.lib
76
77 CLIENT=$(BINDIR)\yaz-client.exe
78 SERVER=$(LIBDIR)\server.lib
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 server: $(SERVER)
86 ztest: $(ZTEST)
87 proto_h: $(PROTOH)
88
89 ###########################################################
90 ############### Compiler and linker options 
91 ###########################################################
92
93
94 ### C and CPP compiler  (the same thing)
95 # Note: $(CPP) has already been defined in the environment
96 # (if you set things up right!)
97
98 COMMON_C_OPTIONS=          \
99   /nologo /W3 /GX /FD /c   \
100   /D "WIN32" /D "_WINDOWS" \
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\tclsh82.exe"
157
158 COMMON_TCL_OPTIONS= ..\util\yc.tcl -I$(INCLDIR) -i yaz
159
160 # Final opt variables
161 !if $(DEBUG)
162 COPT=   $(COMMON_C_OPTIONS)   $(DEBUG_C_OPTIONS)     $(COMMON_C_INCLUDES)
163 MTLOPT= $(COMMON_MTL_OPTIONS) $(DEBUG_MTL_OPTIONS)
164 RCOPT=  $(COMMON_RC_OPTIONS)  $(DEBUG_RC_OPTIONS)
165 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS)   $(LNK_LIBS)
166 TCLOPT= $(COMMON_TCL_OPTIONS)
167
168 !else
169 COPT=   $(COMMON_C_OPTIONS)   $(RELEASE_C_OPTIONS)   $(COMMON_C_INCLUDES) 
170 MTLOPT= $(COMMON_MTL_OPTIONS) $(RELEASE_MTL_OPTIONS)
171 RCOPT=  $(COMMON_RC_OPTIONS)  $(RELEASE_RC_OPTIONS)
172 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
173 TCLOPT= $(COMMON_TCL_OPTIONS)
174 !endif
175
176
177
178 ###########################################################
179 ###############  Source and object modules
180 ###########################################################
181
182 # Note: Ordinary source files are not specified here at 
183 # all, make finds them in suitable dirs. The object modules
184 # need to be specified, though
185
186 YAZ_CLIENT_OBJS= \
187    $(OBJDIR)\client.obj
188
189 YAZ_SERVER_OBJS= \
190         "$(OBJDIR)\eventl.obj" \
191         "$(OBJDIR)\requestq.obj" \
192         "$(OBJDIR)\service.obj" \
193         "$(OBJDIR)\seshigh.obj" \
194         "$(OBJDIR)\statserv.obj" \
195         "$(OBJDIR)\tcpdchk.obj" 
196
197 ZTEST_OBJS= \
198         "$(OBJDIR)\read-grs.obj" \
199         "$(OBJDIR)\ztest.obj" 
200         
201
202 YAZ_ASN_OBJS= \
203    $(OBJDIR)\proto.obj \
204    $(OBJDIR)\prt-acc.obj \
205    $(OBJDIR)\prt-add.obj \
206    $(OBJDIR)\prt-arc.obj \
207    $(OBJDIR)\prt-dat.obj \
208    $(OBJDIR)\prt-dia.obj \
209    $(OBJDIR)\prt-esp.obj \
210    $(OBJDIR)\prt-exd.obj \
211    $(OBJDIR)\prt-exp.obj \
212    $(OBJDIR)\prt-grs.obj \
213    $(OBJDIR)\prt-rsc.obj \
214    $(OBJDIR)\prt-univ.obj 
215
216 YAZ_COMSTACK_OBJS= \
217    $(OBJDIR)\comstack.obj \
218    $(OBJDIR)\tcpip.obj \
219    $(OBJDIR)\waislen.obj 
220
221 YAZ_ODR_OBJS= \
222    $(OBJDIR)\ber_any.obj \
223    $(OBJDIR)\ber_bit.obj \
224    $(OBJDIR)\ber_bool.obj \
225    $(OBJDIR)\ber_int.obj \
226    $(OBJDIR)\ber_len.obj \
227    $(OBJDIR)\ber_null.obj \
228    $(OBJDIR)\ber_oct.obj \
229    $(OBJDIR)\ber_oid.obj \
230    $(OBJDIR)\ber_tag.obj \
231    $(OBJDIR)\dumpber.obj \
232    $(OBJDIR)\odr.obj \
233    $(OBJDIR)\odr_any.obj \
234    $(OBJDIR)\odr_bit.obj \
235    $(OBJDIR)\odr_bool.obj \
236    $(OBJDIR)\odr_choice.obj \
237    $(OBJDIR)\odr_cons.obj \
238    $(OBJDIR)\odr_enum.obj \
239    $(OBJDIR)\odr_int.obj \
240    $(OBJDIR)\odr_mem.obj \
241    $(OBJDIR)\odr_null.obj \
242    $(OBJDIR)\odr_oct.obj \
243    $(OBJDIR)\odr_oid.obj \
244    $(OBJDIR)\odr_priv.obj \
245    $(OBJDIR)\odr_seq.obj \
246    $(OBJDIR)\odr_tag.obj \
247    $(OBJDIR)\odr_use.obj \
248    $(OBJDIR)\odr_util.obj 
249
250 YAZ_UTIL_OBJS= \
251    $(OBJDIR)\atoin.obj \
252    $(OBJDIR)\log.obj \
253    $(OBJDIR)\marcdisp.obj \
254    $(OBJDIR)\nmem.obj \
255    $(OBJDIR)\nmemsdup.obj \
256    $(OBJDIR)\oid.obj \
257    $(OBJDIR)\options.obj \
258    $(OBJDIR)\readconf.obj \
259    $(OBJDIR)\tpath.obj \
260    $(OBJDIR)\wrbuf.obj \
261    $(OBJDIR)\xmalloc.obj \
262    $(OBJDIR)\matchstr.obj 
263
264 YAZ_ZUTIL_OBJS= \
265    $(OBJDIR)\diagbib1.obj \
266    $(OBJDIR)\zget.obj \
267    $(OBJDIR)\prt-ext.obj \
268    $(OBJDIR)\logrpn.obj \
269    $(OBJDIR)\pquery.obj \
270    $(OBJDIR)\yaz-ccl.obj \
271    $(OBJDIR)\otherinfo.obj
272
273 YAZ_RET_OBJS= \
274    $(OBJDIR)\d1_absyn.obj\
275    $(OBJDIR)\d1_attset.obj\
276    $(OBJDIR)\d1_doespec.obj\
277    $(OBJDIR)\d1_espec.obj\
278    $(OBJDIR)\d1_expout.obj\
279    $(OBJDIR)\d1_grs.obj\
280    $(OBJDIR)\d1_handle.obj\
281    $(OBJDIR)\d1_map.obj\
282    $(OBJDIR)\d1_marc.obj\
283    $(OBJDIR)\d1_prtree.obj\
284    $(OBJDIR)\d1_read.obj\
285    $(OBJDIR)\d1_soif.obj\
286    $(OBJDIR)\d1_sumout.obj\
287    $(OBJDIR)\d1_sutrs.obj\
288    $(OBJDIR)\d1_tagset.obj\
289    $(OBJDIR)\d1_varset.obj\
290    $(OBJDIR)\d1_write.obj\
291    $(OBJDIR)\d1_if.obj
292
293 Z3950_OBJS= \
294    $(OBJDIR)\z-date.obj\
295    $(OBJDIR)\z-univ.obj\
296    $(OBJDIR)\zes-update.obj\
297    $(OBJDIR)\z-accdes1.obj \
298    $(OBJDIR)\z-accform1.obj \
299    $(OBJDIR)\z-acckrb1.obj \
300    $(OBJDIR)\z-core.obj \
301    $(OBJDIR)\z-diag1.obj \
302    $(OBJDIR)\z-espec1.obj \
303    $(OBJDIR)\z-estask.obj \
304    $(OBJDIR)\z-exp.obj \
305    $(OBJDIR)\z-grs.obj \
306    $(OBJDIR)\z-opac.obj \
307    $(OBJDIR)\z-uifr1.obj \
308    $(OBJDIR)\z-rrf1.obj \
309    $(OBJDIR)\z-rrf2.obj \
310    $(OBJDIR)\z-sum.obj \
311    $(OBJDIR)\z-sutrs.obj \
312    $(OBJDIR)\zes-expi.obj \
313    $(OBJDIR)\zes-exps.obj \
314    $(OBJDIR)\zes-order.obj \
315    $(OBJDIR)\zes-pquery.obj \
316    $(OBJDIR)\zes-psched.obj \
317    $(OBJDIR)\zes-pset.obj \
318    $(OBJDIR)\zes-update0.obj 
319
320 ILL_OBJS= \
321    $(OBJDIR)\ill-get.obj\
322    $(OBJDIR)\ill-core.obj\
323    $(OBJDIR)\item-req.obj
324
325 COMMON_YAZ_OBJS= \
326    $(YAZ_COMSTACK_OBJS) \
327    $(YAZ_ODR_OBJS) \
328    $(YAZ_UTIL_OBJS) \
329    $(YAZ_ZUTIL_OBJS) \
330    $(YAZ_RET_OBJS)
331
332 !if $(NEW_Z3950)
333 YAZ_OBJS= \
334         $(COMMON_YAZ_OBJS) \
335         $(ILL_OBJS) \
336         $(Z3950_OBJS)
337 !else
338 YAZ_OBJS= \
339         $(COMMON_YAZ_OBJS) \
340         $(YAZ_ASN_OBJS)
341 !endif
342
343 DLL_OBJS= $(YAZ_OBJS)
344
345 ALL_OBJS= \
346         $(YAZ_OBJS) \
347         $(YAZ_CLIENT_OBJS) \
348         $(YAZ_SERVER_OBJS) \
349         $(ZTEST_OBJS)
350
351
352 ##########################################################
353 ############## proto.h
354 ##########################################################
355
356 !if $(NEW_Z3950)
357 $(PROTOH): makefile $(INCLDIR)\yaz\z-proto.h
358         type $(INCLDIR)\yaz\z-proto.h > $(PROTOH)
359 !else
360 $(PROTOH): makefile $(INCLDIR)\yaz\prt-proto.h 
361         type $(INCLDIR)\yaz\prt-proto.h > $(PROTOH)
362 !endif
363
364
365 ###########################################################
366 ############### Generated C and H files
367 ###########################################################
368
369 Z3950_C_DIR=$(Z3950DIR)   
370 ILL_C_DIR=$(ILLDIR)
371 #!!! Should be moved to OBJ, but that requires too much trickery
372
373 # Files generated from datetime.asn
374 DATETIME_H_FILES = $(INCLDIR)\yaz\z-date.h
375 DATETIME_C_FILES = $(Z3950_C_DIR)\z-date.c
376
377 # Files generated from univres.asn
378 UNIVRES_H_FILES = $(INCLDIR)\yaz\z-univ.h
379 UNIVRES_C_FILES = $(Z3950_C_DIR)\z-univ.c
380
381 # Files generated from esupdate.asn
382 ESUPDATE_H_FILES = $(INCLDIR)\yaz\zes-update.h
383 ESUPDATE_C_FILES = $(Z3950_C_DIR)\zes-update.c
384
385 # Files created from z3950v3.asn
386 Z3950V3_H_FILES= \
387    $(INCLDIR)\yaz\z-accdes1.h \
388    $(INCLDIR)\yaz\z-core.h
389
390 Z3950V3_C_FILES= \
391    $(Z3950_C_DIR)\z-accdes1.c \
392    $(Z3950_C_DIR)\z-accform1.c \
393    $(Z3950_C_DIR)\z-acckrb1.c \
394    $(Z3950_C_DIR)\z-core.c \
395    $(Z3950_C_DIR)\z-diag1.c \
396    $(Z3950_C_DIR)\z-espec1.c \
397    $(Z3950_C_DIR)\z-estask.c \
398    $(Z3950_C_DIR)\z-exp.c \
399    $(Z3950_C_DIR)\z-grs.c \
400    $(Z3950_C_DIR)\z-opac.c \
401    $(Z3950_C_DIR)\z-uifr1.c \
402    $(Z3950_C_DIR)\z-rrf1.c \
403    $(Z3950_C_DIR)\z-rrf2.c \
404    $(Z3950_C_DIR)\z-sum.c \
405    $(Z3950_C_DIR)\z-sutrs.c \
406    $(Z3950_C_DIR)\zes-expi.c \
407    $(Z3950_C_DIR)\zes-exps.c \
408    $(Z3950_C_DIR)\zes-order.c \
409    $(Z3950_C_DIR)\zes-pquery.c \
410    $(Z3950_C_DIR)\zes-psched.c \
411    $(Z3950_C_DIR)\zes-pset.c \
412    $(Z3950_C_DIR)\zes-update0.c 
413
414 ILL_CORE_H_FILES= \
415    $(INCLDIR)\yaz\ill-core.h
416
417 ILL_CORE_C_FILES= \
418    $(ILL_C_DIR)\ill-core.c
419
420 ITEM_REQ_H_FILES= \
421    $(INCLDIR)\yaz\item-req.h
422
423 ITEM_REQ_C_FILES= \
424    $(ILL_C_DIR)\item-req.c
425
426 DATETIME_FILES = $(DATETIME_H_FILES) $(DATETIME_C_FILES)
427 UNIVRES_FILES = $(UNIVRES_H_FILES) $(UNIVRES_C_FILES)
428 ESUPDATE_FILES = $(ESUPDATE_H_FILES) $(ESUPDATE_C_FILES)
429 Z3950V3_FILES= $(Z3950V3_C_FILES) $(Z3950V3_H_FILES)
430 ILL_CORE_FILES= $(ILL_CORE_C_FILES) $(ILL_CORE_H_FILES)
431 ITEM_REQ_FILES= $(ITEM_REQ_C_FILES) $(ITEM_REQ_H_FILES)
432
433 GENERATED_C_FILES= \
434    $(Z3950V3_C_FILES)  \
435    $(ESUPDATE_C_FILES) \
436    $(UNIVRES_C_FILES)  \
437    $(DATETIME_C_FILES)
438
439 GENERATED_H_FILES= \
440    $(Z3950V3_H_FILES)  \
441    $(ESUPDATE_H_FILES) \
442    $(UNIVRES_H_FILES)  \
443    $(DATETIME_H_FILES)
444
445 generated_files: \
446         $(GENERATED_H_FILES) \
447         $(GENERATED_C_FILES) \
448         $(PROTOH)
449
450 ###########################################################
451 ############### Compiling 
452 ###########################################################
453
454 # Note: This defines where to look for the necessary
455 # source files. Funny way of doing it, but it works.
456
457 # DLL sources
458 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
459         @$(CPP) $(COPT) $<
460
461 # Yaz client
462 {$(CLIENTDIR)}.c{$(OBJDIR)}.obj:
463         @$(CPP) $(COPT) $< /D"_CONSOLE"
464
465 # Ztest
466 {$(ZTESTDIR)}.c{$(OBJDIR)}.obj:
467         @$(CPP) $(COPT) $< /D"_CONSOLE"
468
469 # Server
470 {$(SERVERDIR)}.c{$(OBJDIR)}.obj:
471         @$(CPP) $(COPT) $< 
472
473 # Various YAZ source directories
474 {$(ASNDIR)}.c{$(OBJDIR)}.obj:
475         @$(CPP) $(COPT) $< 
476
477 {$(COMSTACKDIR)}.c{$(OBJDIR)}.obj:
478         @$(CPP) $(COPT) $< 
479
480 {$(ODRDIR)}.c{$(OBJDIR)}.obj:
481         @$(CPP) $(COPT) $< 
482
483 {$(UTILDIR)}.c{$(OBJDIR)}.obj:
484         @$(CPP) $(COPT) $< 
485
486 {$(ZUTILDIR)}.c{$(OBJDIR)}.obj:
487         @$(CPP) $(COPT) $< 
488
489 {$(RETDIR)}.c{$(OBJDIR)}.obj:
490         @$(CPP) $(COPT) $<
491
492 {$(Z3950_C_DIR)}.c{$(OBJDIR)}.obj:
493         @$(CPP) $(COPT) $< 
494
495 {$(ILL_C_DIR)}.c{$(OBJDIR)}.obj:
496         @$(CPP) $(COPT) $< 
497
498 ############### ASN-generated files
499
500 $(Z3950V3_FILES): $(Z3950DIR)\z3950v3.asn
501         @cd $(Z3950DIR)
502         $(TCL) $(TCLOPT) -d z.tcl z3950v3.asn
503         @cd $(WINDIR)
504
505 $(DATETIME_FILES): $(Z3950DIR)\datetime.asn
506         @cd $(Z3950DIR)
507         $(TCL) $(TCLOPT) -d z.tcl datetime.asn
508         @cd $(WINDIR)
509
510 $(UNIVRES_FILES): $(Z3950DIR)\univres.asn
511         @cd $(Z3950DIR)
512         $(TCL) $(TCLOPT) -d z.tcl univres.asn
513         @cd $(WINDIR)
514
515 $(ESUPDATE_FILES): $(Z3950DIR)\esupdate.asn
516         @cd $(Z3950DIR)
517         $(TCL) $(TCLOPT) -d z.tcl esupdate.asn
518         @cd $(WINDIR)
519
520 $(ILL_CORE_FILES): $(ILLDIR)\ill9702.asn
521         @cd $(ILLDIR)
522         $(TCL) $(TCLOPT) -d ill.tcl ill9702.asn
523         @cd $(WINDIR)
524
525 $(ITEM_REQ_FILES): $(ILLDIR)\item-req.asn
526         @cd $(ILLDIR)
527         $(TCL) $(TCLOPT) -d ill.tcl item-req.asn
528         @cd $(WINDIR)
529
530 ###########################################################
531 ############### Linking
532 ###########################################################
533
534 $(DLL) $(IMPLIB): "$(BINDIR)" $(DLL_OBJS) 
535         @echo Linking the dll  $(DLL)
536         $(LINK) @<<
537                 $(LNKOPT) 
538                 $(LINK_LIBS) 
539                 $(DLL_LINK_OPTIONS)
540                 $(DLL_OBJS) 
541                 /out:$(DLL) 
542                 /implib:"$(LIBDIR)/yaz.lib"
543                 /pdb:"$(LIBDIR)/yaz.pdb" 
544                 /map:"$(LIBDIR)/yaz.map"  
545 <<
546
547 $(CLIENT) : "$(BINDIR)" $(YAZ_CLIENT_OBJS) 
548         @echo Linking the client  $(CLIENT)
549         $(LINK) @<<
550         $(LNKOPT) 
551                 $(CLIENT_LINK_OPTIONS)
552                 $(LINK_LIBS) 
553                 $(IMPLIB)
554                 $(YAZ_CLIENT_OBJS)
555
556                 /pdb:"$(LIBDIR)/yaz-client.pdb"
557
558                 /map:"$(LIBDIR)/yaz-client.map"
559                 /out:$(CLIENT)
560 <<
561
562 $(ZTEST) : "$(BINDIR)" $(ZTEST_OBJS) $(SERVER) $(DLL)
563         @echo Linking the ztest  $(ZTEST)
564         $(LINK) @<<
565         $(LNKOPT) 
566                 $(ZTEST_LINK_OPTIONS)
567                 $(LINK_LIBS) 
568                 shell32.lib
569                 $(IMPLIB)
570                 $(SERVER)
571                 $(ZTEST_OBJS) 
572
573                 /implib:"$(LIBDIR)/yaz-ztest.lib"
574
575                 /pdb:"$(LIBDIR)/yaz-ztest.pdb"
576
577                 /map:"$(LIBDIR)/yaz-ztest.map"
578                 /out:$(ZTEST) 
579 <<
580
581
582 $(SERVER) : "$(BINDIR)" $(YAZ_SERVER_OBJS) 
583         @echo Linking the server  $(SERVER)
584         $(LINK) $(SERVER_LINK_OPTIONS) @<<
585                 /nologo
586                 $(IMPLIB)
587                 $(YAZ_SERVER_OBJS) 
588                 /out:$(SERVER) 
589 <<
590
591 # note that this links a lib, so it uses completely different options.
592
593
594
595 ###########################################################
596 ############### Special operations
597 ###########################################################
598
599
600 ############## clean
601 clean:
602         del $(DLL) 
603         del $(CLIENT)
604         del $(SERVER)
605         del $(ZTEST)
606         del $(TMPDIR)\*.
607
608         del $(LIBDIR)\*.MAP
609
610         del $(LIBDIR)\*.LIB
611         del $(OBJDIR)\*.OBJ
612
613         del $(PROTOH)
614
615 realclean: clean
616         del $(Z3950_C_DIR)\*.c
617         del $(Z3950_C_DIR)\*.h
618         del $(INCLDIR)\yaz\z-accdes1.h
619         del $(INCLDIR)\yaz\z-core.h
620         del $(DATETIME_H_FILES)
621         del $(UNIVRES_H_FILES)
622         del $(ESUPDATE_H_FILES)
623
624 # Because DOS del will only accept one file name to delete,
625 # the _H_ files work only on sets that have just one file.
626 # Z3950_H_FILES had to be spelled out. One more point for MS!
627
628 ########### check directories and create if needed
629 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR)
630
631 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR):
632         if not exist "$@/$(NUL)" mkdir "$@"
633
634
635 ###########################################################
636 ############### Explicit dependencies
637 ###########################################################
638
639 $(ALL_OBJS): makefile $(PROTOH)
640
641 # force recompilation of everything, if makefile changed
642
643 $(Z3950_OBJS): $(GENERATED_C_FILES) $(GENERATED_H_FILES)
644
645 $(ILL_OBJS): $(ILL_CORE_FILES) $(ITEM_REQ_FILES)
646
647 !if $(NEW_Z3950)
648 $(PROTOH): $(GENERATED_C_FILES) $(GENERATED_H_FILES)
649 !endif
650 # makes sure we generate before compiling anything, as the
651 # new proto.h refers to the generated files, and is included
652 # in various places
653
654 ###########################################################
655 ############### Log
656 ###########################################################
657 #
658 # $Log: makefile,v $
659 # Revision 1.12  2000-01-06 11:27:16  adam
660 # Updated for ILL.
661 #
662 # Revision 1.11  1999/12/21 14:16:20  ian
663 # Changed retrieval module to allow data1 trees with no associated absyn.
664 # Also added a simple interface for extracting values from data1 trees using
665 # a string based tagpath.
666 #
667 # Revision 1.10  1999/12/08 13:10:48  adam
668 # New version.
669 #
670 # Revision 1.9  1999/11/30 13:47:12  adam
671 # Improved installation. Moved header files to include/yaz.
672 #
673 # Revision 1.8  1999/07/21 08:48:02  adam
674 # Removed dmalloc.obj.
675 #
676 # Revision 1.7  1999/06/09 15:10:08  heikki
677 # Cleaning up. Seems to work all right
678 #
679 # Revision 1.6  1999/06/09 13:33:32  heikki
680 # Compiles and links both old and new type stuff all right
681 #
682 # Revision 1.5  1999/06/09 11:05:30  heikki
683 # At least it can compile
684 #
685 # Revision 1.4  1999/06/09 09:41:09  heikki
686 # More work on the ASN-generated files.
687 #
688 # Revision 1.3  1999/06/08 14:32:30  heikki
689 # Proto.h works all right, removed linker warnings from server.lib
690 #
691 # Revision 1.2  1999/06/08 14:07:24  heikki
692 # Renamed a pile of files
693 # Tmpdir (to get around Ms leaving temp files around, and crashing
694 # when too many with same number...)
695 #
696 # Revision 1.1  1999/06/08 12:15:41  heikki
697 # Renamed to makefile (.nothing) (from .mak)
698 # Working on the proto.h problems and alternative confiigurations
699 #
700 # Revision 1.5  1999/06/04 10:04:28  heikki
701 # Cleaning up
702 #
703 # Revision 1.4  1999/06/02 13:23:29  heikki
704 # Debug options for C compiler
705 #
706 # Revision 1.3  1999/05/19 08:26:22  heikki
707 # Added comments
708 #
709 #
710
711
712