1 # Makefile.mak - makefile for MS NMAKE
2 # $Id: makefile.mak,v 1.4 1999-06-02 13:23:29 heikki Exp $
5 # HL: Heikki Levanto, Index Data
8 # 18-05-99 HL Stole this from YazX, cleaning up
9 # 02-06-99 HL Ztest's bsc file missing, could not debug. Fixing.
12 # - Move MS-C's whatnots into win direcotry
14 # - rename to makefile (.nothing)
17 # Envoronment problems
18 # - You need to have the proper path and environment for VC set
19 # up. There is a bat file VCVARS32.BAT that sets most of it up
20 # for you. You can find this somewhere near DevStudio\VC\BIN
21 # - RegSvr32 must also be along the path, often in WINDOWS\SYSTEM
23 ###########################################################
24 ############### Parameters
25 ###########################################################
27 DEBUG=1 # 0 for release, 1 for debug
32 all: dirs dll client server ztest bsc
34 all: dirs dll client server ztest
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
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
54 COMSTACKDIR=$(SRCDIR)\COMSTACK
56 UTILDIR=$(SRCDIR)\UTIL
57 RETDIR=$(SRCDIR)\RETRIEVAL
59 CLIENTDIR=$(SRCDIR)\CLIENT
60 SERVERDIR=$(SRCDIR)\SERVER
61 ZTESTDIR=$(SRCDIR)\ZTEST
63 ###########################################################
64 ############### Targets - what to make
65 ###########################################################
69 IMPLIB=$(BINDIR)\Yaz.lib
70 YAZ_BSCFILE=$(LIBDIR)\Yaz.bsc
72 CLIENT=$(BINDIR)\client.exe
73 SERVER=$(BINDIR)\server.lib
74 ZTEST=$(BINDIR)\ztest.exe
75 ZTEST_BSCFILE=$(LIBDIR)\ztest.bsc
77 # shortcut names defined here
82 bsc: $(YAZ_BSCFILE) $(ZTEST_BSCFILE)
84 ###########################################################
85 ############### Compiler and linker options
86 ###########################################################
89 ### C and CPP compiler (the same thing)
90 # Note: $(CPP) has already been defined in the environment
91 # (if you set things up right!)
94 /nologo /W3 /GX /FD /c \
95 /D "WIN32" /D "_WINDOWS" \
100 # /Fp"$(OBJDIR)\YazX3950.pch" \
104 /I"$(SRCDIR)\include"
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
135 #odbccp32.lib yaz.lib /nologo /subsystem:console /incremental:no /pdb:".\Debug/client.pdb" /debug /machine:I386 /out:".\Debug/client.exe" /libpath:"..\debug"
136 #kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
137 #ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib yaz.lib server.lib
138 #ZT: /nologo /subsystem:console /incremental:no /pdb:"Debug/ztest.pdb" /debug /machine:I386 /out:"Debug/ztest.exe" /pdbtype:sept /libpath:"..\debug" /libpath:"..\server\debug"
141 COMMON_LNK_OPTIONS= /nologo \
146 DEBUG_LNK_OPTIONS= /debug
148 RELEASE_LNK_OPTIONS= /pdb:none
150 DLL_LINK_OPTIONS= /dll
151 CLIENT_LINK_OPTIONS = /subsystem:console
152 SERVER_LINK_OPTIONS = -lib
153 ZTEST_LINK_OPTIONS = /subsystem:console
157 ### BSC compiler options
162 COMMON_BSC_OPTIONS= /nologo /n
166 # Final opt variables
168 COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES)
169 MTLOPT= $(COMMON_MTL_OPTIONS) $(DEBUG_MTL_OPTIONS)
170 RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS)
171 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS)
172 BSCOPT= $(COMMON_BSC_OPTIONS) $(DEBUG_BSC_OPTIONS)
175 COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES)
176 MTLOPT= $(COMMON_MTL_OPTIONS) $(RELEASE_MTL_OPTIONS)
177 RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS)
178 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
179 BSCOPT= $(COMMON_BSC_OPTIONS) $(RELEASE_BSC_OPTIONS)
184 ###########################################################
185 ############### Source and object modules
186 ###########################################################
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!
196 RESFILE=$(OBJDIR)\component.res
200 #DEF_FILE= $(ROOTDIR)\component.def
204 # Note: Ordinary source files are not specified here at
205 # all, make finds them in suitable dirs. The object modules
206 # need to be specified, though
212 "$(OBJDIR)\eventl.obj" \
213 "$(OBJDIR)\requestq.obj" \
214 "$(OBJDIR)\service.obj" \
215 "$(OBJDIR)\seshigh.obj" \
216 "$(OBJDIR)\statserv.obj" \
217 "$(OBJDIR)\tcpdchk.obj"
220 "$(OBJDIR)\read-grs.obj" \
221 "$(OBJDIR)\ztest.obj"
225 $(OBJDIR)\diagbib1.obj \
226 $(OBJDIR)\proto.obj \
227 $(OBJDIR)\prt-acc.obj \
228 $(OBJDIR)\prt-add.obj \
229 $(OBJDIR)\prt-arc.obj \
230 $(OBJDIR)\prt-dat.obj \
231 $(OBJDIR)\prt-dia.obj \
232 $(OBJDIR)\prt-esp.obj \
233 $(OBJDIR)\prt-exd.obj \
234 $(OBJDIR)\prt-exp.obj \
235 $(OBJDIR)\prt-ext.obj \
236 $(OBJDIR)\prt-grs.obj \
237 $(OBJDIR)\prt-rsc.obj \
238 $(OBJDIR)\prt-univ.obj \
242 $(OBJDIR)\comstack.obj \
243 $(OBJDIR)\tcpip.obj \
244 $(OBJDIR)\waislen.obj
247 $(OBJDIR)\ber_any.obj \
248 $(OBJDIR)\ber_bit.obj \
249 $(OBJDIR)\ber_bool.obj \
250 $(OBJDIR)\ber_int.obj \
251 $(OBJDIR)\ber_len.obj \
252 $(OBJDIR)\ber_null.obj \
253 $(OBJDIR)\ber_oct.obj \
254 $(OBJDIR)\ber_oid.obj \
255 $(OBJDIR)\ber_tag.obj \
256 $(OBJDIR)\dumpber.obj \
258 $(OBJDIR)\odr_any.obj \
259 $(OBJDIR)\odr_bit.obj \
260 $(OBJDIR)\odr_bool.obj \
261 $(OBJDIR)\odr_choice.obj \
262 $(OBJDIR)\odr_cons.obj \
263 $(OBJDIR)\odr_enum.obj \
264 $(OBJDIR)\odr_int.obj \
265 $(OBJDIR)\odr_mem.obj \
266 $(OBJDIR)\odr_null.obj \
267 $(OBJDIR)\odr_oct.obj \
268 $(OBJDIR)\odr_oid.obj \
269 $(OBJDIR)\odr_priv.obj \
270 $(OBJDIR)\odr_seq.obj \
271 $(OBJDIR)\odr_tag.obj \
272 $(OBJDIR)\odr_use.obj \
273 $(OBJDIR)\odr_util.obj
276 $(OBJDIR)\atoin.obj \
277 $(OBJDIR)\dmalloc.obj \
279 $(OBJDIR)\logrpn.obj \
280 $(OBJDIR)\marcdisp.obj \
282 $(OBJDIR)\nmemsdup.obj \
284 $(OBJDIR)\options.obj \
285 $(OBJDIR)\pquery.obj \
286 $(OBJDIR)\query.obj \
287 $(OBJDIR)\readconf.obj \
288 $(OBJDIR)\tpath.obj \
289 $(OBJDIR)\wrbuf.obj \
290 $(OBJDIR)\xmalloc.obj \
291 $(OBJDIR)\yaz-ccl.obj \
292 $(OBJDIR)\yaz-util.obj
295 $(OBJDIR)\d1_absyn.obj\
296 $(OBJDIR)\d1_attset.obj\
297 $(OBJDIR)\d1_doespec.obj\
298 $(OBJDIR)\d1_espec.obj\
299 $(OBJDIR)\d1_expout.obj\
300 $(OBJDIR)\d1_grs.obj\
301 $(OBJDIR)\d1_handle.obj\
302 $(OBJDIR)\d1_map.obj\
303 $(OBJDIR)\d1_marc.obj\
304 $(OBJDIR)\d1_prtree.obj\
305 $(OBJDIR)\d1_read.obj\
306 $(OBJDIR)\d1_soif.obj\
307 $(OBJDIR)\d1_sumout.obj\
308 $(OBJDIR)\d1_sutrs.obj\
309 $(OBJDIR)\d1_tagset.obj\
310 $(OBJDIR)\d1_varset.obj\
311 $(OBJDIR)\d1_write.obj
315 $(YAZ_COMSTACK_OBJS) \
320 DLL_OBJS= $(YAZ_OBJS)
323 ###########################################################
324 ############### Compiling
325 ###########################################################
327 # Note: This defines where to look for the necessary
328 # source files. Funny way of doing it, but it works.
331 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
337 {$(CLIENTDIR)}.c{$(OBJDIR)}.obj:
344 {$(ZTESTDIR)}.c{$(OBJDIR)}.obj:
353 {$(SERVERDIR)}.c{$(OBJDIR)}.obj:
358 # Various YAZ source directories
359 {$(ASNDIR)}.c{$(OBJDIR)}.obj:
364 {$(COMSTACKDIR)}.c{$(OBJDIR)}.obj:
369 {$(ODRDIR)}.c{$(OBJDIR)}.obj:
374 {$(UTILDIR)}.c{$(OBJDIR)}.obj:
379 {$(RETDIR)}.c{$(OBJDIR)}.obj:
386 $(RESFILE): $(RCFILE) $(IDLGENERATED)
387 $(RSC) $(RCOPT) /fo"$(RESFILE)" $(RCFILE)
390 ###########################################################
391 ############### Linking
392 ###########################################################
395 $(DLL) $(IMPLIB): "$(BINDIR)" $(DLL_OBJS)
403 /pdb:"$(LIBDIR)/yaz.pdb"
404 /map:"$(LIBDIR)/yaz.map"
407 $(CLIENT) : "$(BINDIR)" $(YAZ_CLIENT_OBJS) $(IMPLIB)
410 $(CLIENT_LINK_OPTIONS)
417 $(ZTEST) : "$(BINDIR)" $(ZTEST_OBJS) $(SERVER) $(DLL)
420 $(ZTEST_LINK_OPTIONS)
430 $(SERVER) : "$(BINDIR)" $(YAZ_SERVER_OBJS)
431 $(LINK) $(SERVER_LINK_OPTIONS) @<<
438 # note that this links a lib, so it uses completely different options.
440 # regsvr32 /s /c "$(DLL)"
444 ## Linking the debug info database (or what ever this is...)
445 $(YAZ_BSCFILE): $(DLL_OBJS) $(DLL)
446 $(BSCMAKE) $(BSCOPT) /o $(YAZ_BSCFILE) $(OBJDIR)\*.sbr
448 $(ZTEST_BSCFILE): $(DLL_OBJS) $(ZTEST_OBJS) $(ZTEST)
449 $(BSCMAKE) $(BSCOPT) /o $(ZTEST_BSCFILE) $(OBJDIR)\*.sbr
451 # @echo OPT=$(LNKOPT)
452 # @echo LIB=$(LINKLIBS)
453 # @echo OBJ=$(DLL_OBJS)
454 # @echo DEF=$(DEF_FILE)
456 ###########################################################
457 ############### Special operations
458 ###########################################################
463 deltree /y "$(OBJDIR)/*.*"
466 ########### check directories and create if needed
467 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR)
469 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) :
470 if not exist "$@/$(NUL)" mkdir "$@"
472 ### test target while debugging makefile...
476 ###########################################################
477 ############### Explicit dependencies
478 ###########################################################
480 $(OBJDIR)/client.obj: $(IDLGENERATED)
482 ###########################################################
484 ###########################################################
486 # $Log: makefile.mak,v $
487 # Revision 1.4 1999-06-02 13:23:29 heikki
488 # Debug options for C compiler
490 # Revision 1.3 1999/05/19 08:26:22 heikki