Compiles and links both old and new type stuff all right
[yaz-moved-to-github.git] / win / makefile
1 # Makefile.mak - makefile for MS NMAKE 
2 # $Id: makefile,v 1.6 1999-06-09 13:33:32 heikki 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
37 ###########################################################
38 ############### Directories
39 ###########################################################
40 # The current directory is supposed to be something like
41 # ..../Yaz/Win, everything is relative to that
42 ROOTDIR=..   # The home of Yaz
43
44 INCLDIR=$(ROOTDIR)\include  # our includes
45 LIBDIR=$(ROOTDIR)\lib       # We produce .lib, .exp etc there
46 BINDIR=$(ROOTDIR)\bin       # We produce exes and dlls there
47 WINDIR=$(ROOTDIR)\win       # all these Win make things
48 OBJDIR=$(WINDIR)\obj        # where we store intermediate files
49 UNIXDIR=$(ROOTDIR)\unix     # corresponding unix things
50 SRCDIR=$(ROOTDIR)           # for the case we move them under src
51
52 ASNDIR=$(SRCDIR)\ASN
53 COMSTACKDIR=$(SRCDIR)\COMSTACK
54 ODRDIR=$(SRCDIR)\ODR
55 UTILDIR=$(SRCDIR)\UTIL
56 ZUTILDIR=$(SRCDIR)\ZUTIL
57 RETDIR=$(SRCDIR)\RETRIEVAL
58 Z3950DIR=$(SRCDIR)\Z39.50
59
60 CLIENTDIR=$(SRCDIR)\CLIENT
61 SERVERDIR=$(SRCDIR)\SERVER
62 ZTESTDIR=$(SRCDIR)\ZTEST
63
64 TMPDIR=$(ROOTDIR)\win\tmp
65 TMP=$(TMPDIR)
66
67 ###########################################################
68 ############### Targets - what to make
69 ###########################################################
70
71
72 DLL=$(BINDIR)\Yaz.dll
73 IMPLIB=$(LIBDIR)\Yaz.lib
74
75 CLIENT=$(BINDIR)\client.exe
76 SERVER=$(LIBDIR)\server.lib
77 ZTEST=$(BINDIR)\ztest.exe
78 PROTOH=$(INCLDIR)\proto.h
79
80 # shortcut names defined here
81 dll : $(DLL) 
82 client: $(CLIENT)
83 server: $(SERVER)
84 ztest: $(ZTEST)
85 proto_h: $(PROTOH)
86
87 ###########################################################
88 ############### Compiler and linker options 
89 ###########################################################
90
91
92 ### C and CPP compiler  (the same thing)
93 # Note: $(CPP) has already been defined in the environment
94 # (if you set things up right!)
95
96 COMMON_C_OPTIONS=          \
97   /nologo /W3 /GX /FD /c   \
98   /D "WIN32" /D "_WINDOWS" \
99   /FR"$(OBJDIR)\\"         \
100   /Fo"$(OBJDIR)\\"         \
101   /Fd"$(OBJDIR)\\" 
102
103 COMMON_C_INCLUDES= \
104   /I"$(SRCDIR)\include"
105
106 DEBUG_C_OPTIONS=  \
107   /D "_DEBUG"      \
108   /MDd  /Od /YX /Zi /Gm
109
110 RELEASE_C_OPTIONS=  \
111   /D "NDEBUG"        \
112   /MD /O2
113
114 # /W3  = warning level
115 # /GX  = Enable exception handling
116 # /FD  = Generate file dependencies (what ever they are)
117 # /c   = compile without linking
118 # /FR  = Generate browse info (.sbr file that gets combined into .bsc)
119 # /Fo  = object file name (or at least path)
120 # /Fd  = debug database name (or path)
121 # /MD  = Runtime library: Multithread DLL
122 # /MDd = Runtime library: Multithread DLL (debug)
123 # /Od  = Disable optimising (debug)
124 # /O2  = Optimize for speed
125 # /YX  = Automatic use of precomipled headers
126 # /Gm  = Minimal rebuild (some cpp class stuff)
127 # /Zi  = Program database for debuggers
128 # /ZI  = Pgm database with special "edit&continue" stuff - not available in C5
129
130 ### The RC compiler (resource files)
131 RSC=rc.exe
132 COMMON_RC_OPTIONS= /l 0x406 /i"$(ROOTDIR)" 
133 DEBUG_RC_OPTIONS=/d "_DEBUG"
134 RELEASE_RC_OPTIONS=/d "NDEBUG"
135
136
137 ### Linker options
138 LINK=link.exe
139
140 LINK_LIBS= kernel32.lib user32.lib   gdi32.lib   winspool.lib \
141            comdlg32.lib advapi32.lib shell32.lib ole32.lib    \
142            oleaut32.lib uuid.lib     odbc32.lib  odbccp32.lib \
143            wsock32.lib  advapi32.lib
144
145 COMMON_LNK_OPTIONS= /nologo \
146                     /subsystem:windows \
147                     /machine:i386 \
148                           /incremental:no
149
150 DEBUG_LNK_OPTIONS= /debug 
151
152 RELEASE_LNK_OPTIONS=  /pdb:none
153
154 DLL_LINK_OPTIONS= /dll  
155 CLIENT_LINK_OPTIONS = /subsystem:console  
156 SERVER_LINK_OPTIONS = -lib 
157 ZTEST_LINK_OPTIONS = /subsystem:console  
158
159 # TCL
160 TCL="C:\Program Files\Tcl\bin\tclsh80.exe"
161
162 COMMON_TCL_OPTIONS= ..\util\yc.tcl -d z.tcl -I$(INCLDIR)
163
164 #-I../include
165
166
167 # Final opt variables
168 !if $(DEBUG)
169 COPT=   $(COMMON_C_OPTIONS)   $(DEBUG_C_OPTIONS)     $(COMMON_C_INCLUDES)
170 MTLOPT= $(COMMON_MTL_OPTIONS) $(DEBUG_MTL_OPTIONS)
171 RCOPT=  $(COMMON_RC_OPTIONS)  $(DEBUG_RC_OPTIONS)
172 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS)   $(LNK_LIBS)
173 TCLOPT= $(COMMON_TCL_OPTIONS)
174
175 !else
176 COPT=   $(COMMON_C_OPTIONS)   $(RELEASE_C_OPTIONS)   $(COMMON_C_INCLUDES) 
177 MTLOPT= $(COMMON_MTL_OPTIONS) $(RELEASE_MTL_OPTIONS)
178 RCOPT=  $(COMMON_RC_OPTIONS)  $(RELEASE_RC_OPTIONS)
179 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
180 TCLOPT= $(COMMON_TCL_OPTIONS)
181 !endif
182
183
184
185 ###########################################################
186 ###############  Source and object modules
187 ###########################################################
188
189 # The resource files
190 #RCFILE=$(SRCDIR)\compmak.rc
191 # Horrible Hack: The resfile contains just one line, pointing
192 # to the component.tlb file (which is created by the idl compiler)
193 # Devstudio wants that file to live in YazX3950, this makefile in
194 # win/obj. So we need to RC files!
195
196 #RESFILE=$(OBJDIR)\component.res
197
198 # The def file
199 #DEF_FILE= $(ROOTDIR)\component.def 
200
201 ### !!! Delete the stuff above !!!
202
203 # Note: Ordinary source files are not specified here at 
204 # all, make finds them in suitable dirs. The object modules
205 # need to be specified, though
206
207 YAZ_CLIENT_OBJS= \
208    $(OBJDIR)\client.obj
209
210 YAZ_SERVER_OBJS= \
211         "$(OBJDIR)\eventl.obj" \
212         "$(OBJDIR)\requestq.obj" \
213         "$(OBJDIR)\service.obj" \
214         "$(OBJDIR)\seshigh.obj" \
215         "$(OBJDIR)\statserv.obj" \
216         "$(OBJDIR)\tcpdchk.obj" 
217
218 ZTEST_OBJS= \
219         "$(OBJDIR)\read-grs.obj" \
220         "$(OBJDIR)\ztest.obj" 
221         
222
223 YAZ_ASN_OBJS= \
224    $(OBJDIR)\proto.obj \
225    $(OBJDIR)\prt-acc.obj \
226    $(OBJDIR)\prt-add.obj \
227    $(OBJDIR)\prt-arc.obj \
228    $(OBJDIR)\prt-dat.obj \
229    $(OBJDIR)\prt-dia.obj \
230    $(OBJDIR)\prt-esp.obj \
231    $(OBJDIR)\prt-exd.obj \
232    $(OBJDIR)\prt-exp.obj \
233    $(OBJDIR)\prt-grs.obj \
234    $(OBJDIR)\prt-rsc.obj \
235    $(OBJDIR)\prt-univ.obj 
236
237 YAZ_COMSTACK_OBJS= \
238    $(OBJDIR)\comstack.obj \
239    $(OBJDIR)\tcpip.obj \
240    $(OBJDIR)\waislen.obj 
241
242 YAZ_ODR_OBJS= \
243    $(OBJDIR)\ber_any.obj \
244    $(OBJDIR)\ber_bit.obj \
245    $(OBJDIR)\ber_bool.obj \
246    $(OBJDIR)\ber_int.obj \
247    $(OBJDIR)\ber_len.obj \
248    $(OBJDIR)\ber_null.obj \
249    $(OBJDIR)\ber_oct.obj \
250    $(OBJDIR)\ber_oid.obj \
251    $(OBJDIR)\ber_tag.obj \
252    $(OBJDIR)\dumpber.obj \
253    $(OBJDIR)\odr.obj \
254    $(OBJDIR)\odr_any.obj \
255    $(OBJDIR)\odr_bit.obj \
256    $(OBJDIR)\odr_bool.obj \
257    $(OBJDIR)\odr_choice.obj \
258    $(OBJDIR)\odr_cons.obj \
259    $(OBJDIR)\odr_enum.obj \
260    $(OBJDIR)\odr_int.obj \
261    $(OBJDIR)\odr_mem.obj \
262    $(OBJDIR)\odr_null.obj \
263    $(OBJDIR)\odr_oct.obj \
264    $(OBJDIR)\odr_oid.obj \
265    $(OBJDIR)\odr_priv.obj \
266    $(OBJDIR)\odr_seq.obj \
267    $(OBJDIR)\odr_tag.obj \
268    $(OBJDIR)\odr_use.obj \
269    $(OBJDIR)\odr_util.obj 
270
271 YAZ_UTIL_OBJS= \
272    $(OBJDIR)\atoin.obj \
273    $(OBJDIR)\dmalloc.obj \
274    $(OBJDIR)\log.obj \
275    $(OBJDIR)\marcdisp.obj \
276    $(OBJDIR)\nmem.obj \
277    $(OBJDIR)\nmemsdup.obj \
278    $(OBJDIR)\oid.obj \
279    $(OBJDIR)\options.obj \
280    $(OBJDIR)\readconf.obj \
281    $(OBJDIR)\tpath.obj \
282    $(OBJDIR)\wrbuf.obj \
283    $(OBJDIR)\xmalloc.obj \
284    $(OBJDIR)\matchstr.obj 
285
286 YAZ_ZUTIL_OBJS= \
287    $(OBJDIR)\diagbib1.obj \
288    $(OBJDIR)\zget.obj \
289    $(OBJDIR)\prt-ext.obj \
290    $(OBJDIR)\logrpn.obj \
291    $(OBJDIR)\pquery.obj \
292    $(OBJDIR)\yaz-ccl.obj \
293    $(OBJDIR)\otherinfo.obj
294
295 #   $(OBJDIR)\query.obj \
296
297
298 YAZ_RET_OBJS= \
299    $(OBJDIR)\d1_absyn.obj\
300    $(OBJDIR)\d1_attset.obj\
301    $(OBJDIR)\d1_doespec.obj\
302    $(OBJDIR)\d1_espec.obj\
303    $(OBJDIR)\d1_expout.obj\
304    $(OBJDIR)\d1_grs.obj\
305    $(OBJDIR)\d1_handle.obj\
306    $(OBJDIR)\d1_map.obj\
307    $(OBJDIR)\d1_marc.obj\
308    $(OBJDIR)\d1_prtree.obj\
309    $(OBJDIR)\d1_read.obj\
310    $(OBJDIR)\d1_soif.obj\
311    $(OBJDIR)\d1_sumout.obj\
312    $(OBJDIR)\d1_sutrs.obj\
313    $(OBJDIR)\d1_tagset.obj\
314    $(OBJDIR)\d1_varset.obj\
315    $(OBJDIR)\d1_write.obj
316
317
318 Z3950_OBJS= \
319    $(OBJDIR)\z-date.obj\
320    $(OBJDIR)\z-univ.obj\
321    $(OBJDIR)\zes-update.obj\
322    $(OBJDIR)\z-accdes1.obj \
323    $(OBJDIR)\z-accform1.obj \
324    $(OBJDIR)\z-acckrb1.obj \
325    $(OBJDIR)\z-core.obj \
326    $(OBJDIR)\z-diag1.obj \
327    $(OBJDIR)\z-espec1.obj \
328    $(OBJDIR)\z-estask.obj \
329    $(OBJDIR)\z-exp.obj \
330    $(OBJDIR)\z-grs.obj \
331    $(OBJDIR)\z-opac.obj \
332    $(OBJDIR)\z-uifr1.obj \
333    $(OBJDIR)\z-rrf1.obj \
334    $(OBJDIR)\z-rrf2.obj \
335    $(OBJDIR)\z-sum.obj \
336    $(OBJDIR)\z-sutrs.obj \
337    $(OBJDIR)\zes-expi.obj \
338    $(OBJDIR)\zes-exps.obj \
339    $(OBJDIR)\zes-order.obj \
340    $(OBJDIR)\zes-pquery.obj \
341    $(OBJDIR)\zes-psched.obj \
342    $(OBJDIR)\zes-pset.obj \
343    $(OBJDIR)\zes-update0.obj 
344
345 COMMON_YAZ_OBJS= \
346    $(YAZ_COMSTACK_OBJS) \
347    $(YAZ_ODR_OBJS) \
348    $(YAZ_UTIL_OBJS) \
349    $(YAZ_ZUTIL_OBJS) \
350    $(YAZ_RET_OBJS)
351
352 !if $(NEW_Z3950)
353 YAZ_OBJS= \
354         $(COMMON_YAZ_OBJS) \
355         $(Z3950_OBJS)
356 !else
357 YAZ_OBJS= \
358         $(COMMON_YAZ_OBJS) \
359         $(YAZ_ASN_OBJS)
360 !endif
361
362 DLL_OBJS= $(YAZ_OBJS)
363
364
365
366 ##########################################################
367 ############## proto.h
368 ##########################################################
369
370 !if $(NEW_Z3950)
371 $(PROTOH): makefile $(INCLDIR)\z-proto.h
372         type $(INCLDIR)\z-proto.h > $(INCLDIR)\proto.h
373 !else
374 $(PROTOH): makefile $(INCLDIR)\prt-proto.h 
375         type $(INCLDIR)\prt-proto.h > $(INCLDIR)\proto.h
376 !endif
377
378
379 ###########################################################
380 ############### Generated C and H files
381 ###########################################################
382
383 Z3950_C_DIR=$(Z3950DIR)   #!!! Should be moved to OBJ
384
385 # Files generated from datetime.asn
386 DATETIME_H_FILES = $(INCLDIR)\z-date.h
387 DATETIME_C_FILES = $(Z3950_C_DIR)\z-date.c
388
389 # Files generated from univres.asn
390 UNIVRES_H_FILES = $(INCLDIR)\z-univ.h
391 UNIVRES_C_FILES = $(Z3950_C_DIR)\z-univ.c
392
393 # Files generated from esupdate.asn
394 ESUPDATE_H_FILES = $(INCLDIR)\zes-update.h
395 ESUPDATE_C_FILES = $(Z3950_C_DIR)\zes-update.c
396
397 # Files created from z3950v3.asn
398 Z3950V3_H_FILES= \
399    $(INCLDIR)\z-accdes1.h \
400    $(INCLDIR)\z-core.h
401
402 Z3950V3_C_FILES= \
403    $(Z3950_C_DIR)\z-accdes1.c \
404    $(Z3950_C_DIR)\z-accform1.c \
405    $(Z3950_C_DIR)\z-acckrb1.c \
406    $(Z3950_C_DIR)\z-core.c \
407    $(Z3950_C_DIR)\z-diag1.c \
408    $(Z3950_C_DIR)\z-espec1.c \
409    $(Z3950_C_DIR)\z-estask.c \
410    $(Z3950_C_DIR)\z-exp.c \
411    $(Z3950_C_DIR)\z-grs.c \
412    $(Z3950_C_DIR)\z-opac.c \
413    $(Z3950_C_DIR)\z-uifr1.c \
414    $(Z3950_C_DIR)\z-rrf1.c \
415    $(Z3950_C_DIR)\z-rrf2.c \
416    $(Z3950_C_DIR)\z-sum.c \
417    $(Z3950_C_DIR)\z-sutrs.c \
418    $(Z3950_C_DIR)\zes-expi.c \
419    $(Z3950_C_DIR)\zes-exps.c \
420    $(Z3950_C_DIR)\zes-order.c \
421    $(Z3950_C_DIR)\zes-pquery.c \
422    $(Z3950_C_DIR)\zes-psched.c \
423    $(Z3950_C_DIR)\zes-pset.c \
424    $(Z3950_C_DIR)\zes-update0.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
431 GENERATED_C_FILES= \
432    $(Z3950V3_C_FILES)  \
433    $(ESUPDATE_C_FILES) \
434    $(UNIVRES_C_FILES)  \
435    $(DATETIME_C_FILES)
436
437 GENERATED_H_FILES= \
438    $(Z3950V3_H_FILES)  \
439    $(ESUPDATE_H_FILES) \
440    $(UNIVRES_H_FILES)  \
441    $(DATETIME_H_FILES)
442
443
444 ###########################################################
445 ############### Compiling 
446 ###########################################################
447
448 # Note: This defines where to look for the necessary
449 # source files. Funny way of doing it, but it works.
450
451 # DLL sources
452 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
453         @$(CPP) @<<
454         $(COPT) $<
455 <<
456
457 # Yaz client
458 {$(CLIENTDIR)}.c{$(OBJDIR)}.obj:
459         @$(CPP) @<<  
460         $(COPT) $< 
461         /D"_CONSOLE"
462 <<
463
464 # Ztest
465 {$(ZTESTDIR)}.c{$(OBJDIR)}.obj:
466         @$(CPP) @<<  
467         $(COPT) $< 
468       /D"_CONSOLE"
469         /D"_MBCS"
470 <<
471
472
473 # Server
474 {$(SERVERDIR)}.c{$(OBJDIR)}.obj:
475         @$(CPP) @<<  
476         $(COPT) $< 
477 <<
478
479 # Various YAZ source directories
480 {$(ASNDIR)}.c{$(OBJDIR)}.obj:
481         @$(CPP) @<<  
482         $(COPT) $< 
483 <<
484
485 {$(COMSTACKDIR)}.c{$(OBJDIR)}.obj:
486         @$(CPP) @<<  
487         $(COPT) $< 
488 <<
489
490 {$(ODRDIR)}.c{$(OBJDIR)}.obj:
491         @$(CPP) @<<  
492         $(COPT) $< 
493 <<
494
495 {$(UTILDIR)}.c{$(OBJDIR)}.obj:
496         @$(CPP) @<<  
497         $(COPT) $< 
498 <<
499
500 {$(ZUTILDIR)}.c{$(OBJDIR)}.obj:
501         @$(CPP) @<<  
502         $(COPT) $< 
503 <<
504
505 {$(RETDIR)}.c{$(OBJDIR)}.obj:
506         @$(CPP) @<<  
507         $(COPT) $< 
508 <<
509
510
511 {$(Z3950_C_DIR)}.c{$(OBJDIR)}.obj:
512         @$(CPP) @<<  
513         $(COPT) $< 
514 <<
515
516 ### Resource file
517 #$(RESFILE): $(RCFILE) $(IDLGENERATED)
518 #       $(RSC) $(RCOPT) /fo"$(RESFILE)" $(RCFILE) 
519
520 ############### ASN-generated files
521
522
523 $(Z3950V3_FILES): $(Z3950DIR)\z3950v3.asn
524         @cd $(Z3950DIR)
525         $(TCL) $(TCLOPT) z3950v3.asn
526
527 $(DATETIME_FILES): $(Z3950DIR)\datetime.asn
528         @cd $(Z3950DIR)
529         $(TCL) $(TCLOPT) datetime.asn
530
531 $(UNIVRES_FILES): $(Z3950DIR)\univres.asn
532         @cd $(Z3950DIR)
533         $(TCL) $(TCLOPT) univres.asn
534
535 $(ESUPDATE_FILES): $(Z3950DIR)\esupdate.asn
536         @cd $(Z3950DIR)
537         dir esupdate.asn | find "-"
538         dir $(ESUPDATE_C_FILES) | find "-"
539         dir $(ESUPDATE_H_FILES) | find "-"
540         $(TCL) $(TCLOPT) esupdate.asn
541
542
543 ###########################################################
544 ############### Linking
545 ###########################################################
546
547 ###$(DLL) $(IMPLIB): "$(BINDIR)" $(Z3950_OBJS)
548
549 $(DLL) $(IMPLIB): "$(BINDIR)" $(DLL_OBJS) 
550         @echo Linking the dll  $(DLL)
551         $(LINK) @<<
552                 $(LNKOPT) 
553                 $(LINK_LIBS) 
554                 $(DLL_LINK_OPTIONS)
555                 $(DLL_OBJS) 
556                 /out:$(DLL) 
557                 /implib:$(IMPLIB)
558                 /pdb:"$(LIBDIR)/yaz.pdb" 
559                 /map:"$(LIBDIR)/yaz.map"  
560 <<
561
562 #foo: 
563 #       rem $(Z3950_OBJS)
564 #       pause
565 #       rem $(DLL_OBJS)
566
567 #foo: $(ESUPDATE_FILES)
568 #       dir $(INCLDIR)\zes-update.*
569 #       dir $(Z3950DIR)\zes-update.*
570
571 $(CLIENT) : "$(BINDIR)" $(YAZ_CLIENT_OBJS) 
572         @echo Linking the client  $(CLIENT)
573         $(LINK) @<<
574             $(LNKOPT) 
575                 $(CLIENT_LINK_OPTIONS)
576                 $(LINK_LIBS) 
577                 $(IMPLIB)
578                 $(YAZ_CLIENT_OBJS) 
579                 /out:$(CLIENT) 
580 <<
581
582 $(ZTEST) : "$(BINDIR)" $(ZTEST_OBJS) $(SERVER) $(DLL)
583         @echo Linking the ztest  $(ZTEST)
584         $(LINK) @<<
585             $(LNKOPT) 
586                 $(ZTEST_LINK_OPTIONS)
587                 $(LINK_LIBS) 
588                 shell32.lib 
589                 $(IMPLIB)
590                 $(SERVER)
591                 $(ZTEST_OBJS) 
592                 /out:$(ZTEST) 
593 <<
594
595
596 $(SERVER) : "$(BINDIR)" $(YAZ_SERVER_OBJS) 
597         @echo Linking the server  $(SERVER)
598         $(LINK) $(SERVER_LINK_OPTIONS) @<<
599                 /nologo
600                 $(IMPLIB)
601                 $(YAZ_SERVER_OBJS) 
602                 /out:$(SERVER) 
603 <<
604
605 #               $(LINK_LIBS) 
606
607 # note that this links a lib, so it uses completely different options.
608
609
610
611 ###########################################################
612 ############### Special operations
613 ###########################################################
614
615
616 ############## clean
617 clean:
618         del $(OBJDIR)\*.obj
619         del $(OBJDIR)\*.sbr
620         del $(DLL) 
621         del $(CLIENT)
622         del $(SERVER)
623         del $(ZTEST)
624         del $(TMPDIR)\*.
625         del $(PROTOH)
626         del $(Z3950_C_DIR)\*.c
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 $(DLL_OBJS): makefile $(PROTOH)
640
641 $(Z3950_OBJS): $(GENERATED_C_FILES) $(GENERATED_H_FILES)
642
643
644 ###########################################################
645 ############### Log
646 ###########################################################
647 #
648 # $Log: makefile,v $
649 # Revision 1.6  1999-06-09 13:33:32  heikki
650 # Compiles and links both old and new type stuff all right
651 #
652 # Revision 1.5  1999/06/09 11:05:30  heikki
653 # At least it can compile
654 #
655 # Revision 1.4  1999/06/09 09:41:09  heikki
656 # More work on the ASN-generated files.
657 #
658 # Revision 1.3  1999/06/08 14:32:30  heikki
659 # Proto.h works all right, removed linker warnings from server.lib
660 #
661 # Revision 1.2  1999/06/08 14:07:24  heikki
662 # Renamed a pile of files
663 # Tmpdir (to get around Ms leaving temp files around, and crashing
664 # when too many with same number...)
665 #
666 # Revision 1.1  1999/06/08 12:15:41  heikki
667 # Renamed to makefile (.nothing) (from .mak)
668 # Working on the proto.h problems and alternative confiigurations
669 #
670 # Revision 1.5  1999/06/04 10:04:28  heikki
671 # Cleaning up
672 #
673 # Revision 1.4  1999/06/02 13:23:29  heikki
674 # Debug options for C compiler
675 #
676 # Revision 1.3  1999/05/19 08:26:22  heikki
677 # Added comments
678 #
679 #
680
681
682