1 # Makefile.mak - makefile for MS NMAKE
2 # $Id: makefile,v 1.1 1999-06-08 12:15:41 heikki Exp $
5 # HL: Heikki Levanto, Index Data
7 # Log at the end of the file
10 # - Move MS-C's whatnots into win direcotry
11 # - rename to makefile (.nothing)
13 # Envoronment problems
14 # - You need to have the proper path and environment for VC set
15 # up. There is a bat file VCVARS32.BAT that sets most of it up
16 # for you. You can find this somewhere near DevStudio\VC\BIN
17 # - RegSvr32 must also be along the path, often in WINDOWS\SYSTEM
19 ###########################################################
20 ############### Parameters
21 ###########################################################
23 DEBUG=0 # 0 for release, 1 for debug
27 all: dirs dll client server ztest
30 ###########################################################
31 ############### Directories
32 ###########################################################
33 # The current directory is supposed to be something like
34 # ..../Yaz/Win, everything is relative to that
35 ROOTDIR=.. # The home of Yaz
37 INCLDIR=$(ROOTDIR)\include # our includes
38 LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there
39 BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there
40 WINDIR=$(ROOTDIR)\win # all these Win make things
41 OBJDIR=$(WINDIR)\obj # where we store intermediate files
42 UNIXDIR=$(ROOTDIR)\unix # corresponding unix things
43 SRCDIR=$(ROOTDIR) # for the case we move them under src
46 COMSTACKDIR=$(SRCDIR)\COMSTACK
48 UTILDIR=$(SRCDIR)\UTIL
49 ZUTILDIR=$(SRCDIR)\ZUTIL
50 RETDIR=$(SRCDIR)\RETRIEVAL
52 CLIENTDIR=$(SRCDIR)\CLIENT
53 SERVERDIR=$(SRCDIR)\SERVER
54 ZTESTDIR=$(SRCDIR)\ZTEST
56 ###########################################################
57 ############### Targets - what to make
58 ###########################################################
62 IMPLIB=$(BINDIR)\Yaz.lib
64 CLIENT=$(BINDIR)\client.exe
65 SERVER=$(BINDIR)\server.lib
66 ZTEST=$(BINDIR)\ztest.exe
68 # shortcut names defined here
73 bsc: $(YAZ_BSCFILE) $(ZTEST_BSCFILE)
75 ###########################################################
76 ############### Compiler and linker options
77 ###########################################################
80 ### C and CPP compiler (the same thing)
81 # Note: $(CPP) has already been defined in the environment
82 # (if you set things up right!)
85 /nologo /W3 /GX /FD /c \
86 /D "WIN32" /D "_WINDOWS" \
102 # /W3 = warning level
103 # /GX = Enable exception handling
104 # /FD = Generate file dependencies (what ever they are)
105 # /c = compile without linking
106 # /FR = Generate browse info (.sbr file that gets combined into .bsc)
107 # /Fo = object file name (or at least path)
108 # /Fd = debug database name (or path)
109 # /MD = Runtime library: Multithread DLL
110 # /MDd = Runtime library: Multithread DLL (debug)
111 # /Od = Disable optimising (debug)
112 # /O2 = Optimize for speed
113 # /YX = Automatic use of precomipled headers
114 # /Gm = Minimal rebuild (some cpp class stuff)
115 # /Zi = Program database for debuggers
116 # /ZI = Pgm database with special "edit&continue" stuff - not available in C5
118 ### The RC compiler (resource files)
120 COMMON_RC_OPTIONS= /l 0x406 /i"$(ROOTDIR)"
121 DEBUG_RC_OPTIONS=/d "_DEBUG"
122 RELEASE_RC_OPTIONS=/d "NDEBUG"
128 LINK_LIBS= kernel32.lib user32.lib gdi32.lib winspool.lib \
129 comdlg32.lib advapi32.lib shell32.lib ole32.lib \
130 oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
131 wsock32.lib advapi32.lib
133 COMMON_LNK_OPTIONS= /nologo \
138 DEBUG_LNK_OPTIONS= /debug
140 RELEASE_LNK_OPTIONS= /pdb:none
142 DLL_LINK_OPTIONS= /dll
143 CLIENT_LINK_OPTIONS = /subsystem:console
144 SERVER_LINK_OPTIONS = -lib
145 ZTEST_LINK_OPTIONS = /subsystem:console
148 # Final opt variables
150 COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES)
151 MTLOPT= $(COMMON_MTL_OPTIONS) $(DEBUG_MTL_OPTIONS)
152 RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS)
153 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS)
156 COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES)
157 MTLOPT= $(COMMON_MTL_OPTIONS) $(RELEASE_MTL_OPTIONS)
158 RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS)
159 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
164 ###########################################################
165 ############### Source and object modules
166 ###########################################################
170 RCFILE=$(SRCDIR)\compmak.rc
171 # Horrible Hack: The resfile contains just one line, pointing
172 # to the component.tlb file (which is created by the idl compiler)
173 # Devstudio wants that file to live in YazX3950, this makefile in
174 # win/obj. So we need to RC files!
176 RESFILE=$(OBJDIR)\component.res
180 #DEF_FILE= $(ROOTDIR)\component.def
184 # Note: Ordinary source files are not specified here at
185 # all, make finds them in suitable dirs. The object modules
186 # need to be specified, though
192 "$(OBJDIR)\eventl.obj" \
193 "$(OBJDIR)\requestq.obj" \
194 "$(OBJDIR)\service.obj" \
195 "$(OBJDIR)\seshigh.obj" \
196 "$(OBJDIR)\statserv.obj" \
197 "$(OBJDIR)\tcpdchk.obj"
200 "$(OBJDIR)\read-grs.obj" \
201 "$(OBJDIR)\ztest.obj"
205 $(OBJDIR)\proto.obj \
206 $(OBJDIR)\prt-acc.obj \
207 $(OBJDIR)\prt-add.obj \
208 $(OBJDIR)\prt-arc.obj \
209 $(OBJDIR)\prt-dat.obj \
210 $(OBJDIR)\prt-dia.obj \
211 $(OBJDIR)\prt-esp.obj \
212 $(OBJDIR)\prt-exd.obj \
213 $(OBJDIR)\prt-exp.obj \
214 $(OBJDIR)\prt-grs.obj \
215 $(OBJDIR)\prt-rsc.obj \
216 $(OBJDIR)\prt-univ.obj
219 $(OBJDIR)\comstack.obj \
220 $(OBJDIR)\tcpip.obj \
221 $(OBJDIR)\waislen.obj
224 $(OBJDIR)\ber_any.obj \
225 $(OBJDIR)\ber_bit.obj \
226 $(OBJDIR)\ber_bool.obj \
227 $(OBJDIR)\ber_int.obj \
228 $(OBJDIR)\ber_len.obj \
229 $(OBJDIR)\ber_null.obj \
230 $(OBJDIR)\ber_oct.obj \
231 $(OBJDIR)\ber_oid.obj \
232 $(OBJDIR)\ber_tag.obj \
233 $(OBJDIR)\dumpber.obj \
235 $(OBJDIR)\odr_any.obj \
236 $(OBJDIR)\odr_bit.obj \
237 $(OBJDIR)\odr_bool.obj \
238 $(OBJDIR)\odr_choice.obj \
239 $(OBJDIR)\odr_cons.obj \
240 $(OBJDIR)\odr_enum.obj \
241 $(OBJDIR)\odr_int.obj \
242 $(OBJDIR)\odr_mem.obj \
243 $(OBJDIR)\odr_null.obj \
244 $(OBJDIR)\odr_oct.obj \
245 $(OBJDIR)\odr_oid.obj \
246 $(OBJDIR)\odr_priv.obj \
247 $(OBJDIR)\odr_seq.obj \
248 $(OBJDIR)\odr_tag.obj \
249 $(OBJDIR)\odr_use.obj \
250 $(OBJDIR)\odr_util.obj
253 $(OBJDIR)\atoin.obj \
254 $(OBJDIR)\dmalloc.obj \
256 $(OBJDIR)\marcdisp.obj \
258 $(OBJDIR)\nmemsdup.obj \
260 $(OBJDIR)\options.obj \
261 $(OBJDIR)\readconf.obj \
262 $(OBJDIR)\tpath.obj \
263 $(OBJDIR)\wrbuf.obj \
264 $(OBJDIR)\xmalloc.obj \
265 $(OBJDIR)\matchstr.obj
268 $(OBJDIR)\diagbib1.obj \
270 $(OBJDIR)\prt-ext.obj \
271 $(OBJDIR)\logrpn.obj \
272 $(OBJDIR)\pquery.obj \
273 $(OBJDIR)\query.obj \
274 $(OBJDIR)\yaz-ccl.obj \
275 $(OBJDIR)\otherinfo.obj
278 $(OBJDIR)\d1_absyn.obj\
279 $(OBJDIR)\d1_attset.obj\
280 $(OBJDIR)\d1_doespec.obj\
281 $(OBJDIR)\d1_espec.obj\
282 $(OBJDIR)\d1_expout.obj\
283 $(OBJDIR)\d1_grs.obj\
284 $(OBJDIR)\d1_handle.obj\
285 $(OBJDIR)\d1_map.obj\
286 $(OBJDIR)\d1_marc.obj\
287 $(OBJDIR)\d1_prtree.obj\
288 $(OBJDIR)\d1_read.obj\
289 $(OBJDIR)\d1_soif.obj\
290 $(OBJDIR)\d1_sumout.obj\
291 $(OBJDIR)\d1_sutrs.obj\
292 $(OBJDIR)\d1_tagset.obj\
293 $(OBJDIR)\d1_varset.obj\
294 $(OBJDIR)\d1_write.obj
298 $(YAZ_COMSTACK_OBJS) \
304 DLL_OBJS= $(YAZ_OBJS)
307 ###########################################################
308 ############### Compiling
309 ###########################################################
311 # Note: This defines where to look for the necessary
312 # source files. Funny way of doing it, but it works.
315 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
321 {$(CLIENTDIR)}.c{$(OBJDIR)}.obj:
328 {$(ZTESTDIR)}.c{$(OBJDIR)}.obj:
337 {$(SERVERDIR)}.c{$(OBJDIR)}.obj:
342 # Various YAZ source directories
343 {$(ASNDIR)}.c{$(OBJDIR)}.obj:
348 {$(COMSTACKDIR)}.c{$(OBJDIR)}.obj:
353 {$(ODRDIR)}.c{$(OBJDIR)}.obj:
358 {$(UTILDIR)}.c{$(OBJDIR)}.obj:
363 {$(ZUTILDIR)}.c{$(OBJDIR)}.obj:
368 {$(RETDIR)}.c{$(OBJDIR)}.obj:
375 $(RESFILE): $(RCFILE) $(IDLGENERATED)
376 $(RSC) $(RCOPT) /fo"$(RESFILE)" $(RCFILE)
379 ###########################################################
380 ############### Linking
381 ###########################################################
384 $(DLL) $(IMPLIB): "$(BINDIR)" $(DLL_OBJS)
392 /pdb:"$(LIBDIR)/yaz.pdb"
393 /map:"$(LIBDIR)/yaz.map"
396 $(CLIENT) : "$(BINDIR)" $(YAZ_CLIENT_OBJS) $(IMPLIB)
399 $(CLIENT_LINK_OPTIONS)
406 $(ZTEST) : "$(BINDIR)" $(ZTEST_OBJS) $(SERVER) $(DLL)
409 $(ZTEST_LINK_OPTIONS)
419 $(SERVER) : "$(BINDIR)" $(YAZ_SERVER_OBJS)
420 $(LINK) $(SERVER_LINK_OPTIONS) @<<
427 # note that this links a lib, so it uses completely different options.
431 ###########################################################
432 ############### Special operations
433 ###########################################################
445 ########### check directories and create if needed
446 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR)
448 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) :
449 if not exist "$@/$(NUL)" mkdir "$@"
452 ###########################################################
453 ############### Explicit dependencies
454 ###########################################################
456 $(OBJDIR)/client.obj: $(IDLGENERATED)
458 ###########################################################
460 ###########################################################
463 # Revision 1.1 1999-06-08 12:15:41 heikki
464 # Renamed to makefile (.nothing) (from .mak)
465 # Working on the proto.h problems and alternative confiigurations
467 # Revision 1.5 1999/06/04 10:04:28 heikki
470 # Revision 1.4 1999/06/02 13:23:29 heikki
471 # Debug options for C compiler
473 # Revision 1.3 1999/05/19 08:26:22 heikki