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