1 # IRTCL makefile for MS NMAKE
2 # $Id: makefile,v 1.5 2004-04-26 09:31:00 adam Exp $
4 # Log at the end of the file
7 ###########################################################
8 ############### Parameters
9 ###########################################################
11 DEBUG=0 # 0 for release, 1 for debug
17 ###########################################################
18 ############### Directories
19 ###########################################################
20 # The current directory is supposed to be something like
21 # ..../IRTCL/Win, everything is relative to that
22 ROOTDIR=.. # The home of IRTCL
24 # TCL include files, libraries, etc.
26 TCLINCL=$(TCLDIR)\include
27 TCLLIB=$(TCLDIR)\lib\tclstub84.lib
29 # YAZ include files, libraries, etc.
30 YAZDIR=$(ROOTDIR)\..\YAZ
31 YAZLIB=$(YAZDIR)\lib\yaz.lib
32 YAZINCL=$(YAZDIR)\include
34 # IRTCL Include files, libraries, programs, etc.
35 INCLDIR=$(ROOTDIR) # our includes
36 LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there
37 BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there
38 WINDIR=$(ROOTDIR)\win # all these Win make things
39 OBJDIR=$(WINDIR)\obj # where we store intermediate files
40 UNIXDIR=$(ROOTDIR)\unix # corresponding unix things
41 SRCDIR=$(ROOTDIR) # for the case we move them under src
43 # Force temp files in a local temp, easier to clean
44 # when nmake crashes and leaves a lot of rubbish behind
45 TMPDIR=$(ROOTDIR)\win\tmp
49 ###########################################################
50 ############### Targets - what to make
51 ###########################################################
53 IRTCLDLL=$(BINDIR)\irtcl.dll
56 ###########################################################
57 ############### Compiler and linker options
58 ###########################################################
61 ### C and CPP compiler (the same thing)
62 # Note: $(CPP) has already been defined in the environment
63 # (if you set things up right!)
69 /D "IR_TCL_VERSION=\"$(VERSION)\"" \
89 # /GX = Enable exception handling
90 # /FD = Generate file dependencies (what ever they are)
91 # /c = compile without linking
92 # /FR = Generate browse info (.sbr file that gets combined into .bsc)
93 # /Fo = object file name (or at least path)
94 # /Fd = debug database name (or path)
95 # /MD = Runtime library: Multithread DLL
96 # /MDd = Runtime library: Multithread DLL (debug)
97 # /Od = Disable optimising (debug)
98 # /O2 = Optimize for speed
99 # /YX = Automatic use of precomipled headers
100 # /Gm = Minimal rebuild (some cpp class stuff)
101 # /Zi = Program database for debuggers
102 # /ZI = Pgm database with special "edit&continue" stuff - not available in C5
108 LINK_LIBS= kernel32.lib user32.lib gdi32.lib winspool.lib \
109 comdlg32.lib advapi32.lib shell32.lib ole32.lib \
110 oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
111 wsock32.lib advapi32.lib
113 COMMON_LNK_OPTIONS= \
117 DEBUG_LNK_OPTIONS= /debug
119 RELEASE_LNK_OPTIONS= /pdb:none
121 IRTCL_LINK_OPTIONS = /dll
123 # Final opt variables
125 COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES)
126 MTLOPT= $(COMMON_MTL_OPTIONS) $(DEBUG_MTL_OPTIONS)
127 RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS)
128 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS)
131 COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES)
132 MTLOPT= $(COMMON_MTL_OPTIONS) $(RELEASE_MTL_OPTIONS)
133 RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS)
134 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
137 ###########################################################
138 ############### Source and object modules
139 ###########################################################
141 # Note: Ordinary source files are not specified here at
142 # all, make finds them in suitable dirs. The object modules
143 # need to be specified, though
146 $(OBJDIR)\ir-tcl.obj \
148 $(OBJDIR)\explain.obj \
151 $(OBJDIR)\queue.obj \
154 ALL_OBJS=$(IRTCL_OBJS)
156 ###########################################################
157 ############### Compiling
158 ###########################################################
160 # Note: This defines where to look for the necessary
161 # source files. Funny way of doing it, but it works.
163 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
166 {$(SRCDIR)}.c{$(OBJDIR)}.obj:
169 ###########################################################
170 ############### Resources
171 ###########################################################
173 ### The RC compiler (resource files)
175 COMMON_RC_OPTIONS= /l 0x406 /i"$(ROOTDIR)"
176 DEBUG_RC_OPTIONS=/d "_DEBUG"
177 RELEASE_RC_OPTIONS=/d "NDEBUG"
179 RES=$(OBJDIR)\irtcl.res
180 RC=$(WINDIR)\irtcl.rc
189 $(RSC) $(RSOPT) /fo"$(RES)" $(RC)
191 ###########################################################
192 ############### Linking
193 ###########################################################
195 $(IRTCLDLL) : "$(BINDIR)" $(IRTCL_OBJS) $(RES)
196 @echo Linking irtcl DLL $(IRTCLDLL)
197 $(LINK) $(IRTCL_LINK_OPTIONS) @<<
207 ###########################################################
208 ############### Special operations
209 ###########################################################
219 # Because DOS del will only accept one file name to delete,
220 # the _H_ files work only on sets that have just one file.
221 # Z3950_H_FILES had to be spelled out. One more point for MS!
223 ########### check directories and create if needed
224 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR)
226 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR):
227 if not exist "$@/$(NUL)" mkdir "$@"
229 ###########################################################
230 ############### Explicit dependencies
231 ###########################################################
233 $(ALL_OBJS): makefile
235 # force recompilation of everything, if makefile changed
237 ###########################################################
239 ###########################################################
242 # Revision 1.5 2004-04-26 09:31:00 adam
245 # Revision 1.4 2003/03/05 22:06:32 adam
248 # Revision 1.3 2003/01/30 13:27:07 adam
249 # Changed version to 1.4.1. Added WIN32 version resource.
250 # IrTcl ignores unexpected PDU's, rather than die.
252 # Revision 1.2 2001/12/03 00:31:06 adam
253 # Towards 1.4. Configure updates.
255 # Revision 1.1 1999/09/10 10:02:29 adam
256 # Added MS NMAKE files - removed project files.