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