1 # Makefile.mak - makefile for MS NMAKE
2 # $Id: makefile.mak,v 1.3 1999-05-19 08:26:22 heikki Exp $
5 # HL: Heikki Levanto, Index Data
8 # 18-05-99 HL Stole this from YazX, cleaning up
11 # - Move MS-C's whatnots into win direcotry
13 # - rename to makefile (.nothing)
16 # Envoronment problems
17 # - You need to have the proper path and environment for VC set
18 # up. There is a bat file VCVARS32.BAT that sets most of it up
19 # for you. You can find this somewhere near DevStudio\VC\BIN
20 # - RegSvr32 must also be along the path, often in WINDOWS\SYSTEM
22 ###########################################################
23 ############### Parameters
24 ###########################################################
26 DEBUG=1 # 0 for release, 1 for debug
29 all: dirs dll client server ztest
33 ###########################################################
34 ############### Directories
35 ###########################################################
36 # The current directory is supposed to be something like
37 # ..../Yaz/Win, everything is relative to that
38 ROOTDIR=.. # The home of Yaz
40 INCLDIR=$(ROOTDIR)\include # our includes
41 LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there
42 BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there
43 WINDIR=$(ROOTDIR)\win # all these Win make things
44 OBJDIR=$(WINDIR)\obj # where we store intermediate files
45 UNIXDIR=$(ROOTDIR)\unix # corresponding unix things
46 SRCDIR=$(ROOTDIR) # for the case we move them under src
49 COMSTACKDIR=$(SRCDIR)\COMSTACK
51 UTILDIR=$(SRCDIR)\UTIL
52 RETDIR=$(SRCDIR)\RETRIEVAL
54 CLIENTDIR=$(SRCDIR)\CLIENT
55 SERVERDIR=$(SRCDIR)\SERVER
56 ZTESTDIR=$(SRCDIR)\ZTEST
58 ###########################################################
59 ############### Targets - what to make
60 ###########################################################
64 IMPLIB=$(BINDIR)\Yaz.lib
65 BSCFILE=$(LIBDIR)\Yaz.bsc
67 CLIENT=$(BINDIR)\client.exe
68 SERVER=$(BINDIR)\server.lib
69 ZTEST=$(BINDIR)\ztest.exe
71 # shortcut names defined here
72 dll : $(DLL) $(BSCFILE)
77 ###########################################################
78 ############### Compiler and linker options
79 ###########################################################
82 ### C and CPP compiler (the same thing)
83 # Note: $(CPP) has already been defined in the environment
84 # (if you set things up right!)
87 /nologo /W3 /GX /FD /c \
88 /D "WIN32" /D "_WINDOWS" \
93 # /Fp"$(OBJDIR)\YazX3950.pch" \
111 ### The RC compiler (resource files)
113 COMMON_RC_OPTIONS= /l 0x406 /i"$(ROOTDIR)"
114 DEBUG_RC_OPTIONS=/d "_DEBUG"
115 RELEASE_RC_OPTIONS=/d "NDEBUG"
121 LINK_LIBS= kernel32.lib user32.lib gdi32.lib winspool.lib \
122 comdlg32.lib advapi32.lib shell32.lib ole32.lib \
123 oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
124 wsock32.lib advapi32.lib
128 #odbccp32.lib yaz.lib /nologo /subsystem:console /incremental:no /pdb:".\Debug/client.pdb" /debug /machine:I386 /out:".\Debug/client.exe" /libpath:"..\debug"
129 #kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
130 #ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib yaz.lib server.lib
131 #ZT: /nologo /subsystem:console /incremental:no /pdb:"Debug/ztest.pdb" /debug /machine:I386 /out:"Debug/ztest.exe" /pdbtype:sept /libpath:"..\debug" /libpath:"..\server\debug"
134 COMMON_LNK_OPTIONS= /nologo \
139 DEBUG_LNK_OPTIONS= /debug
141 RELEASE_LNK_OPTIONS= /pdb:none
143 DLL_LINK_OPTIONS= /dll
144 CLIENT_LINK_OPTIONS = /subsystem:console
145 SERVER_LINK_OPTIONS = -lib
146 ZTEST_LINK_OPTIONS = /subsystem:console
150 ### BSC compiler options
155 COMMON_BSC_OPTIONS= /nologo /o "$(BSCFILE)" /n
159 # Final opt variables
161 COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES)
162 MTLOPT= $(COMMON_MTL_OPTIONS) $(DEBUG_MTL_OPTIONS)
163 RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS)
164 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS)
165 BSCOPT= $(COMMON_BSC_OPTIONS) $(DEBUG_BSC_OPTIONS)
168 COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES)
169 MTLOPT= $(COMMON_MTL_OPTIONS) $(RELEASE_MTL_OPTIONS)
170 RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS)
171 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
172 BSCOPT= $(COMMON_BSC_OPTIONS) $(RELEASE_BSC_OPTIONS)
177 ###########################################################
178 ############### Source and object modules
179 ###########################################################
183 RCFILE=$(SRCDIR)\compmak.rc
184 # Horrible Hack: The resfile contains just one line, pointing
185 # to the component.tlb file (which is created by the idl compiler)
186 # Devstudio wants that file to live in YazX3950, this makefile in
187 # win/obj. So we need to RC files!
189 RESFILE=$(OBJDIR)\component.res
193 #DEF_FILE= $(ROOTDIR)\component.def
197 # Note: Ordinary source files are not specified here at
198 # all, make finds them in suitable dirs. The object modules
199 # need to be specified, though
205 "$(OBJDIR)\eventl.obj" \
206 "$(OBJDIR)\requestq.obj" \
207 "$(OBJDIR)\service.obj" \
208 "$(OBJDIR)\seshigh.obj" \
209 "$(OBJDIR)\statserv.obj" \
210 "$(OBJDIR)\tcpdchk.obj"
213 "$(OBJDIR)\read-grs.obj" \
214 "$(OBJDIR)\ztest.obj"
218 $(OBJDIR)\diagbib1.obj \
219 $(OBJDIR)\proto.obj \
220 $(OBJDIR)\prt-acc.obj \
221 $(OBJDIR)\prt-add.obj \
222 $(OBJDIR)\prt-arc.obj \
223 $(OBJDIR)\prt-dat.obj \
224 $(OBJDIR)\prt-dia.obj \
225 $(OBJDIR)\prt-esp.obj \
226 $(OBJDIR)\prt-exd.obj \
227 $(OBJDIR)\prt-exp.obj \
228 $(OBJDIR)\prt-ext.obj \
229 $(OBJDIR)\prt-grs.obj \
230 $(OBJDIR)\prt-rsc.obj \
231 $(OBJDIR)\prt-univ.obj \
235 $(OBJDIR)\comstack.obj \
236 $(OBJDIR)\tcpip.obj \
237 $(OBJDIR)\waislen.obj
240 $(OBJDIR)\ber_any.obj \
241 $(OBJDIR)\ber_bit.obj \
242 $(OBJDIR)\ber_bool.obj \
243 $(OBJDIR)\ber_int.obj \
244 $(OBJDIR)\ber_len.obj \
245 $(OBJDIR)\ber_null.obj \
246 $(OBJDIR)\ber_oct.obj \
247 $(OBJDIR)\ber_oid.obj \
248 $(OBJDIR)\ber_tag.obj \
249 $(OBJDIR)\dumpber.obj \
251 $(OBJDIR)\odr_any.obj \
252 $(OBJDIR)\odr_bit.obj \
253 $(OBJDIR)\odr_bool.obj \
254 $(OBJDIR)\odr_choice.obj \
255 $(OBJDIR)\odr_cons.obj \
256 $(OBJDIR)\odr_enum.obj \
257 $(OBJDIR)\odr_int.obj \
258 $(OBJDIR)\odr_mem.obj \
259 $(OBJDIR)\odr_null.obj \
260 $(OBJDIR)\odr_oct.obj \
261 $(OBJDIR)\odr_oid.obj \
262 $(OBJDIR)\odr_priv.obj \
263 $(OBJDIR)\odr_seq.obj \
264 $(OBJDIR)\odr_tag.obj \
265 $(OBJDIR)\odr_use.obj \
266 $(OBJDIR)\odr_util.obj
269 $(OBJDIR)\atoin.obj \
270 $(OBJDIR)\dmalloc.obj \
272 $(OBJDIR)\logrpn.obj \
273 $(OBJDIR)\marcdisp.obj \
275 $(OBJDIR)\nmemsdup.obj \
277 $(OBJDIR)\options.obj \
278 $(OBJDIR)\pquery.obj \
279 $(OBJDIR)\query.obj \
280 $(OBJDIR)\readconf.obj \
281 $(OBJDIR)\tpath.obj \
282 $(OBJDIR)\wrbuf.obj \
283 $(OBJDIR)\xmalloc.obj \
284 $(OBJDIR)\yaz-ccl.obj \
285 $(OBJDIR)\yaz-util.obj
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
308 $(YAZ_COMSTACK_OBJS) \
313 DLL_OBJS= $(YAZ_OBJS)
316 ###########################################################
317 ############### Compiling
318 ###########################################################
320 # Note: This defines where to look for the necessary
321 # source files. Funny way of doing it, but it works.
324 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
330 {$(CLIENTDIR)}.c{$(OBJDIR)}.obj:
337 {$(ZTESTDIR)}.c{$(OBJDIR)}.obj:
346 {$(SERVERDIR)}.c{$(OBJDIR)}.obj:
351 # Various YAZ source directories
352 {$(ASNDIR)}.c{$(OBJDIR)}.obj:
357 {$(COMSTACKDIR)}.c{$(OBJDIR)}.obj:
362 {$(ODRDIR)}.c{$(OBJDIR)}.obj:
367 {$(UTILDIR)}.c{$(OBJDIR)}.obj:
372 {$(RETDIR)}.c{$(OBJDIR)}.obj:
379 $(RESFILE): $(RCFILE) $(IDLGENERATED)
380 $(RSC) $(RCOPT) /fo"$(RESFILE)" $(RCFILE)
383 ###########################################################
384 ############### Linking
385 ###########################################################
388 $(DLL) $(IMPLIB): "$(BINDIR)" $(DLL_OBJS)
396 /pdb:"$(LIBDIR)/yaz.pdb"
397 /map:"$(LIBDIR)/yaz.map"
400 $(CLIENT) : "$(BINDIR)" $(YAZ_CLIENT_OBJS) $(IMPLIB)
403 $(CLIENT_LINK_OPTIONS)
410 $(ZTEST) : "$(BINDIR)" $(ZTEST_OBJS) $(SERVER) $(DLL)
413 $(ZTEST_LINK_OPTIONS)
423 $(SERVER) : "$(BINDIR)" $(YAZ_SERVER_OBJS)
424 $(LINK) $(SERVER_LINK_OPTIONS) @<<
431 # note that this links a lib, so it uses completely different options.
433 # regsvr32 /s /c "$(DLL)"
437 ## Linking the debug info database (or what ever this is...)
438 $(BSCFILE): $(DLL_OBJS)
439 $(BSCMAKE) $(BSCOPT) $(OBJDIR)\*.sbr
442 # @echo OPT=$(LNKOPT)
443 # @echo LIB=$(LINKLIBS)
444 # @echo OBJ=$(DLL_OBJS)
445 # @echo DEF=$(DEF_FILE)
447 ###########################################################
448 ############### Special operations
449 ###########################################################
454 deltree /y "$(OBJDIR)/*.*"
457 ########### check directories and create if needed
458 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR)
460 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) :
461 if not exist "$@/$(NUL)" mkdir "$@"
463 ### test target while debugging makefile...
467 ###########################################################
468 ############### Explicit dependencies
469 ###########################################################
471 $(OBJDIR)/client.obj: $(IDLGENERATED)
473 ###########################################################
475 ###########################################################
477 # $Log: makefile.mak,v $
478 # Revision 1.3 1999-05-19 08:26:22 heikki