YAZ Build date for WIN32.
[yaz-moved-to-github.git] / win / makefile
1 # makefile.mak - makefile for MS NMAKE 
2 # $Id: makefile,v 1.23 2001-05-18 11:42:03 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\tclsh82.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
284 YAZ_RET_OBJS= \
285    $(OBJDIR)\d1_absyn.obj\
286    $(OBJDIR)\d1_attset.obj\
287    $(OBJDIR)\d1_doespec.obj\
288    $(OBJDIR)\d1_espec.obj\
289    $(OBJDIR)\d1_expout.obj\
290    $(OBJDIR)\d1_grs.obj\
291    $(OBJDIR)\d1_handle.obj\
292    $(OBJDIR)\d1_map.obj\
293    $(OBJDIR)\d1_marc.obj\
294    $(OBJDIR)\d1_prtree.obj\
295    $(OBJDIR)\d1_read.obj\
296    $(OBJDIR)\d1_soif.obj\
297    $(OBJDIR)\d1_sumout.obj\
298    $(OBJDIR)\d1_sutrs.obj\
299    $(OBJDIR)\d1_tagset.obj\
300    $(OBJDIR)\d1_varset.obj\
301    $(OBJDIR)\d1_write.obj\
302    $(OBJDIR)\d1_if.obj
303
304 Z3950_OBJS= \
305    $(OBJDIR)\z-date.obj\
306    $(OBJDIR)\z-univ.obj\
307    $(OBJDIR)\zes-update.obj\
308    $(OBJDIR)\zes-admin.obj \
309    $(OBJDIR)\z-accdes1.obj \
310    $(OBJDIR)\z-accform1.obj \
311    $(OBJDIR)\z-acckrb1.obj \
312    $(OBJDIR)\z-core.obj \
313    $(OBJDIR)\z-diag1.obj \
314    $(OBJDIR)\z-espec1.obj \
315    $(OBJDIR)\z-estask.obj \
316    $(OBJDIR)\z-exp.obj \
317    $(OBJDIR)\z-grs.obj \
318    $(OBJDIR)\z-opac.obj \
319    $(OBJDIR)\z-uifr1.obj \
320    $(OBJDIR)\z-rrf1.obj \
321    $(OBJDIR)\z-rrf2.obj \
322    $(OBJDIR)\z-sum.obj \
323    $(OBJDIR)\z-sutrs.obj \
324    $(OBJDIR)\zes-expi.obj \
325    $(OBJDIR)\zes-exps.obj \
326    $(OBJDIR)\zes-order.obj \
327    $(OBJDIR)\zes-pquery.obj \
328    $(OBJDIR)\zes-psched.obj \
329    $(OBJDIR)\zes-pset.obj \
330    $(OBJDIR)\zes-update0.obj
331
332 ILL_OBJS= \
333    $(OBJDIR)\ill-get.obj\
334    $(OBJDIR)\ill-core.obj\
335    $(OBJDIR)\item-req.obj
336
337 COMMON_YAZ_OBJS= \
338    $(YAZ_UTIL_OBJS) \
339    $(YAZ_ODR_OBJS) \
340    $(YAZ_COMSTACK_OBJS) \
341    $(YAZ_ZUTIL_OBJS) \
342    $(YAZ_CCL_OBJS) \
343    $(YAZ_RET_OBJS) \
344    $(YAZ_SERVER_OBJS) 
345
346 !if $(NEW_Z3950)
347 YAZ_OBJS= \
348         $(COMMON_YAZ_OBJS) \
349         $(Z3950_OBJS) \
350         $(ILL_OBJS) 
351 !else
352 YAZ_OBJS= \
353         $(COMMON_YAZ_OBJS) \
354         $(YAZ_ASN_OBJS)
355 !endif
356
357 DLL_OBJS= $(YAZ_OBJS)
358
359 ALL_OBJS= \
360         $(YAZ_OBJS) \
361         $(YAZ_CLIENT_OBJS) \
362         $(ZTEST_OBJS)
363
364
365 ##########################################################
366 ############## proto.h
367 ##########################################################
368
369 !if $(NEW_Z3950)
370 $(PROTOH): $(INCLDIR)\yaz\z-proto.h
371         type $(INCLDIR)\yaz\z-proto.h > $(PROTOH)
372 !else   
373 $(PROTOH): $(INCLDIR)\yaz\prt-proto.h 
374         copy $(ASNDIR)\*.h $(INCLDIR)\yaz
375         type $(INCLDIR)\yaz\prt-proto.h > $(PROTOH)
376 !endif
377
378
379 ###########################################################
380 ############### Generated C and H files
381 #####
382 ######################################################
383
384
385 Z3950_C_DIR=$(Z3950DIR)   
386 ILL_C_DIR=$(ILLDIR)
387 #!!! Should be moved to OBJ, but that requires too much trickery
388
389 # Files generated from datetime.asn
390 DATETIME_H_FILES = $(INCLDIR)\yaz\z-date.h
391 DATETIME_C_FILES = $(Z3950_C_DIR)\z-date.c
392
393 # Files generated from univres.asn
394 UNIVRES_H_FILES = $(INCLDIR)\yaz\z-univ.h
395 UNIVRES_C_FILES = $(Z3950_C_DIR)\z-univ.c
396
397 # Files generated from esupdate.asn
398 ESUPDATE_H_FILES = $(INCLDIR)\yaz\zes-update.h
399 ESUPDATE_C_FILES = $(Z3950_C_DIR)\zes-update.c
400
401 # Files generated from esadmin.asn
402 ESADMIN_H_FILES = $(INCLDIR)\yaz\zes-admin.h
403 ESADMIN_C_FILES = $(Z3950_C_DIR)\zes-admin.c
404
405 # Files created from z3950v3.asn
406 Z3950V3_H_FILES= \
407    $(INCLDIR)\yaz\z-accdes1.h \
408    $(INCLDIR)\yaz\z-core.h
409
410 Z3950V3_C_FILES= \
411    $(Z3950_C_DIR)\z-accdes1.c \
412    $(Z3950_C_DIR)\z-accform1.c \
413    $(Z3950_C_DIR)\z-acckrb1.c \
414    $(Z3950_C_DIR)\z-core.c \
415    $(Z3950_C_DIR)\z-diag1.c \
416    $(Z3950_C_DIR)\z-espec1.c \
417    $(Z3950_C_DIR)\z-estask.c \
418    $(Z3950_C_DIR)\z-exp.c \
419    $(Z3950_C_DIR)\z-grs.c \
420    $(Z3950_C_DIR)\z-opac.c \
421    $(Z3950_C_DIR)\z-uifr1.c \
422    $(Z3950_C_DIR)\z-rrf1.c \
423    $(Z3950_C_DIR)\z-rrf2.c \
424    $(Z3950_C_DIR)\z-sum.c \
425    $(Z3950_C_DIR)\z-sutrs.c \
426    $(Z3950_C_DIR)\zes-expi.c \
427    $(Z3950_C_DIR)\zes-exps.c \
428    $(Z3950_C_DIR)\zes-order.c \
429    $(Z3950_C_DIR)\zes-pquery.c \
430    $(Z3950_C_DIR)\zes-psched.c \
431    $(Z3950_C_DIR)\zes-pset.c \
432    $(Z3950_C_DIR)\zes-update0.c
433
434 # Files generated from ill9702.asn
435 ILL_CORE_H_FILES= \
436    $(INCLDIR)\yaz\ill-core.h
437
438 ILL_CORE_C_FILES= \
439    $(ILL_C_DIR)\ill-core.c
440
441 # Files generated from itemreq.asn
442 ITEM_REQ_H_FILES= \
443    $(INCLDIR)\yaz\item-req.h
444
445 ITEM_REQ_C_FILES= \
446    $(ILL_C_DIR)\item-req.c
447
448 # Combined..
449 DATETIME_FILES = $(DATETIME_H_FILES) $(DATETIME_C_FILES)
450 UNIVRES_FILES = $(UNIVRES_H_FILES) $(UNIVRES_C_FILES)
451 ESUPDATE_FILES = $(ESUPDATE_H_FILES) $(ESUPDATE_C_FILES)
452 ESADMIN_FILES = $(ESADMIN_H_FILES) $(ESADMIN_C_FILES)
453 Z3950V3_FILES= $(Z3950V3_C_FILES) $(Z3950V3_H_FILES)
454 ILL_CORE_FILES= $(ILL_CORE_C_FILES) $(ILL_CORE_H_FILES)
455 ITEM_REQ_FILES= $(ITEM_REQ_C_FILES) $(ITEM_REQ_H_FILES)
456
457 GENERATED_C_FILES= \
458    $(Z3950V3_C_FILES)  \
459    $(ESUPDATE_C_FILES) \
460    $(UNIVRES_C_FILES)  \
461    $(DATETIME_C_FILES) \
462    $(ESADMIN_C_FILES)
463
464 GENERATED_H_FILES= \
465    $(Z3950V3_H_FILES)  \
466    $(ESUPDATE_H_FILES) \
467    $(UNIVRES_H_FILES)  \
468    $(DATETIME_H_FILES) \
469    $(ESADMIN_H_FILES)
470
471 generated_files: \
472         $(GENERATED_H_FILES) \
473         $(GENERATED_C_FILES) \
474         $(PROTOH)
475
476
477 ###########################################################
478 ############### Compiling 
479 ###########################################################
480
481 # Note: This defines where to look for the necessary
482 # source files. Funny way of doing it, but it works.
483
484 # DLL sources
485 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
486         @$(CPP) $(COPT) $<
487
488 # Yaz client
489 {$(CLIENTDIR)}.c{$(OBJDIR)}.obj:
490         @$(CPP) $(COPT) $< /D"_CONSOLE"
491
492 # Ztest
493 {$(ZTESTDIR)}.c{$(OBJDIR)}.obj:
494         @$(CPP) $(COPT) $< /D"_CONSOLE"
495
496 # Server
497 {$(SERVERDIR)}.c{$(OBJDIR)}.obj:
498         $(CPP) $(COPT) $< 
499
500 # Various YAZ source directories
501 {$(ASNDIR)}.c{$(OBJDIR)}.obj:
502         $(CPP) $(COPT) $< 
503
504 {$(COMSTACKDIR)}.c{$(OBJDIR)}.obj:
505         $(CPP) $(COPT) $< 
506
507 {$(ODRDIR)}.c{$(OBJDIR)}.obj:
508         $(CPP) $(COPT) $< 
509
510 {$(UTILDIR)}.c{$(OBJDIR)}.obj:
511         $(CPP) $(COPT) $< 
512
513 {$(ZUTILDIR)}.c{$(OBJDIR)}.obj:
514         $(CPP)  $(COPT) $< 
515
516 {$(RETDIR)}.c{$(OBJDIR)}.obj:
517         $(CPP) $(COPT) $<
518
519 {$(Z3950_C_DIR)}.c{$(OBJDIR)}.obj:
520         $(CPP) $(COPT) $< 
521
522 {$(ILL_C_DIR)}.c{$(OBJDIR)}.obj:
523         $(CPP) $(COPT) $< 
524
525 {$(CCLDIR)}.c{$(OBJDIR)}.obj:
526         $(CPP) $(COPT) $< 
527
528 ############### ASN-generated files
529
530 !if $(HAVE_TCL)
531
532 $(YAZ_DATE_H):
533         @cd ..
534         $(TCL) util\cvs-date.tcl include\yaz\yaz-date.h
535         @cd win
536
537 $(Z3950V3_FILES): $(Z3950DIR)\z3950v3.asn
538         @cd $(Z3950DIR)
539         $(TCL) $(TCLOPT) -d z.tcl z3950v3.asn
540         @cd $(WINDIR)
541
542 $(DATETIME_FILES): $(Z3950DIR)\datetime.asn
543         @cd $(Z3950DIR)
544         $(TCL) $(TCLOPT) -d z.tcl datetime.asn
545         @cd $(WINDIR)
546
547 $(UNIVRES_FILES): $(Z3950DIR)\univres.asn
548         @cd $(Z3950DIR)
549         $(TCL) $(TCLOPT) -d z.tcl univres.asn
550         @cd $(WINDIR)
551
552 $(ESUPDATE_FILES): $(Z3950DIR)\esupdate.asn
553         @cd $(Z3950DIR)
554         $(TCL) $(TCLOPT) -d z.tcl esupdate.asn
555         @cd $(WINDIR)
556
557 $(ESADMIN_FILES): $(Z3950DIR)\esadmin.asn
558         @cd $(Z3950DIR)
559         $(TCL) $(TCLOPT) -d z.tcl esadmin.asn
560         @cd $(WINDIR)
561
562 $(ILL_CORE_FILES): $(ILLDIR)\ill9702.asn
563         @cd $(ILLDIR)
564         $(TCL) $(TCLOPT) -d ill.tcl ill9702.asn
565         @cd $(WINDIR)
566
567 $(ITEM_REQ_FILES): $(ILLDIR)\item-req.asn
568         @cd $(ILLDIR)
569         $(TCL) $(TCLOPT) -d ill.tcl item-req.asn
570         @cd $(WINDIR)
571
572 !endif
573
574
575 ###########################################################
576 ############### Resources
577 ###########################################################
578
579 ### The RC compiler (resource files)
580 RSC=rc.exe
581 COMMON_RC_OPTIONS= /l 0x406 /i"$(ROOTDIR)" 
582 DEBUG_RC_OPTIONS=/d "_DEBUG"
583 RELEASE_RC_OPTIONS=/d "NDEBUG"
584
585 YAZ_RES=$(OBJDIR)\yaz.res
586 YAZ_RC=$(WINDIR)\yaz.rc
587
588 !if $(DEBUG)
589 RSOPT=/d_DEBUG
590 !else
591 RSOPT=/d_NDEBUG
592 !endif
593
594 $(YAZ_RES): $(YAZ_RC)
595         $(RSC) $(RSOPT) /fo"$(YAZ_RES)" $(YAZ_RC) 
596
597 ###########################################################
598 ############### Linking
599 ###########################################################
600
601 $(DLL) $(IMPLIB): "$(BINDIR)" $(DLL_OBJS) $(YAZ_RES)
602         @echo Linking the dll  $(DLL)
603         $(LINK) @<<
604                 $(LNKOPT) 
605                 $(LINK_LIBS) 
606                 $(DLL_LINK_OPTIONS)
607                 $(DLL_OBJS)
608                 $(YAZ_RES)
609                 /out:$(DLL) 
610                 /implib:"$(LIBDIR)\yaz.lib"
611                 /pdb:"$(LIBDIR)\yaz.pdb" 
612                 /map:"$(LIBDIR)\yaz.map"  
613 <<
614
615 $(CLIENT) : "$(BINDIR)" $(YAZ_CLIENT_OBJS) 
616         @echo Linking the client  $(CLIENT)
617         $(LINK) @<<
618         $(LNKOPT) 
619                 $(CLIENT_LINK_OPTIONS)
620                 $(LINK_LIBS) 
621                 $(IMPLIB)
622                 $(YAZ_CLIENT_OBJS)
623                 /pdb:"$(LIBDIR)\yaz-client.pdb"
624                 /map:"$(LIBDIR)\yaz-client.map"
625                 /out:$(CLIENT)
626 <<
627
628 $(ZTEST) : "$(BINDIR)" $(ZTEST_OBJS) $(DLL)
629         @echo Linking the ztest  $(ZTEST)
630         $(LINK) @<<
631         $(LNKOPT) 
632                 $(ZTEST_LINK_OPTIONS)
633                 $(LINK_LIBS) 
634                 shell32.lib
635                 $(IMPLIB)
636                 $(ZTEST_OBJS) 
637                 /implib:"$(LIBDIR)\yaz-ztest.lib"
638                 /pdb:"$(LIBDIR)\yaz-ztest.pdb"
639                 /map:"$(LIBDIR)\yaz-ztest.map"
640                 /out:$(ZTEST) 
641 <<
642
643
644 # note that this links a lib, so it uses completely different options.
645
646 ###########################################################
647 ############### Special operations
648 ###########################################################
649
650
651 ############## clean
652 clean:
653         del $(DLL) 
654         del $(CLIENT)
655         del $(ZTEST)
656         del $(TMPDIR)\*.
657
658         del $(LIBDIR)\*.MAP
659
660         del $(LIBDIR)\*.LIB
661         del $(OBJDIR)\*.OBJ
662
663         del $(PROTOH)
664
665 realclean: clean
666         del $(Z3950_C_DIR)\*.c
667         del $(Z3950_C_DIR)\*.h
668         del $(INCLDIR)\yaz\z-accdes1.h
669         del $(INCLDIR)\yaz\z-core.h
670         del $(DATETIME_H_FILES)
671         del $(UNIVRES_H_FILES)
672         del $(ESUPDATE_H_FILES)
673
674 # Because DOS del will only accept one file name to delete,
675 # the _H_ files work only on sets that have just one file.
676 # Z3950_H_FILES had to be spelled out. One more point for MS!
677
678 ########### check directories and create if needed
679 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR)
680
681 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR):
682         if not exist "$@/$(NUL)" mkdir "$@"
683
684
685 ###########################################################
686 ############### Explicit dependencies
687 ###########################################################
688
689 $(ALL_OBJS): $(PROTOH)
690
691 # force recompilation of everything, if makefile changed
692
693 $(Z3950_OBJS): $(GENERATED_C_FILES) $(GENERATED_H_FILES)
694
695 $(ILL_OBJS): $(ILL_CORE_FILES) $(ITEM_REQ_FILES)
696
697 !if $(NEW_Z3950)
698 $(PROTOH): $(GENERATED_C_FILES) $(GENERATED_H_FILES)
699 !endif
700 # makes sure we generate before compiling anything, as the
701 # new proto.h refers to the generated files, and is included
702 # in various places
703
704 ###########################################################
705 ############### Log
706 ###########################################################
707 #
708 # $Log: makefile,v $
709 # Revision 1.23  2001-05-18 11:42:03  adam
710 # YAZ Build date for WIN32.
711 #
712 # Revision 1.22  2001/03/09 14:58:20  adam
713 # Updated version resource.
714 #
715 # Revision 1.21  2001/02/28 16:56:33  adam
716 # Added version info for WIN32.
717 #
718 # Revision 1.20  2000/12/01 17:56:41  adam
719 # on WIN32 function statserv_closedown closes socket(s) to provoke close.
720 #
721 # Revision 1.19  2000/11/16 13:03:13  adam
722 # Function ccl_rpn_query sets attributeSet to Bib-1.
723 #
724 # Revision 1.18  2000/11/01 14:47:00  adam
725 # Added CCL support for WIN32.
726 #
727 # Revision 1.17  2000/10/06 12:01:12  adam
728 # Updates regarding ASN-code generation (mostly).
729 #
730 # Revision 1.16  2000/05/05 13:48:15  adam
731 # Minor changes.
732 #
733 # Revision 1.15  2000/04/17 14:21:38  adam
734 # WIN32 update.
735 #
736 # Revision 1.14  2000/03/02 08:48:21  adam
737 # Renamed ASN.1 compiler to yaz-comp (used to be yc.tcl).
738 #
739 # Revision 1.13  2000/02/28 11:13:03  adam
740 # Removed odr_priv.obj.
741 #
742 # Revision 1.12  2000/01/06 11:27:16  adam
743 # Updated for ILL.
744 #
745 # Revision 1.11  1999/12/21 14:16:20  ian
746 # Changed retrieval module to allow data1 trees with no associated absyn.
747 # Also added a simple interface for extracting values from data1 trees using
748 # a string based tagpath.
749 #
750 # Revision 1.10  1999/12/08 13:10:48  adam
751 # New version.
752 #
753 # Revision 1.9  1999/11/30 13:47:12  adam
754 # Improved installation. Moved header files to include/yaz.
755 #
756 # Revision 1.8  1999/07/21 08:48:02  adam
757 # Removed dmalloc.obj.
758 #
759 # Revision 1.7  1999/06/09 15:10:08  heikki
760 # Cleaning up. Seems to work all right
761 #
762 # Revision 1.6  1999/06/09 13:33:32  heikki
763 # Compiles and links both old and new type stuff all right
764 #
765 # Revision 1.5  1999/06/09 11:05:30  heikki
766 # At least it can compile
767 #
768 # Revision 1.4  1999/06/09 09:41:09  heikki
769 # More work on the ASN-generated files.
770 #
771 # Revision 1.3  1999/06/08 14:32:30  heikki
772 # Proto.h works all right, removed linker warnings from server.lib
773 #
774 # Revision 1.2  1999/06/08 14:07:24  heikki
775 # Renamed a pile of files
776 # Tmpdir (to get around Ms leaving temp files around, and crashing
777 # when too many with same number...)
778 #
779 # Revision 1.1  1999/06/08 12:15:41  heikki
780 # Renamed to makefile (.nothing) (from .mak)
781 # Working on the proto.h problems and alternative confiigurations
782 #
783 # Revision 1.5  1999/06/04 10:04:28  heikki
784 # Cleaning up
785 #
786 # Revision 1.4  1999/06/02 13:23:29  heikki
787 # Debug options for C compiler
788 #
789 # Revision 1.3  1999/05/19 08:26:22  heikki
790 # Added comments
791 #
792 #
793
794
795