1 # IRTCL makefile for MS NMAKE
2 # $Id: makefile,v 1.2 2001-12-03 00:31:06 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.
25 TCLINCL="c:\program files\tcl\include"
26 TCLLIB="c:\program files\tcl\lib\tcl82.lib"
28 # YAZ include files, libraries, etc.
29 YAZDIR=$(ROOTDIR)\..\YAZ
30 YAZLIB=$(YAZDIR)\lib\yaz.lib
31 YAZINCL=$(YAZDIR)\include
33 # IRTCL Include files, libraries, programs, etc.
34 INCLDIR=$(ROOTDIR) # our includes
35 LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there
36 BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there
37 WINDIR=$(ROOTDIR)\win # all these Win make things
38 OBJDIR=$(WINDIR)\obj # where we store intermediate files
39 UNIXDIR=$(ROOTDIR)\unix # corresponding unix things
40 SRCDIR=$(ROOTDIR) # for the case we move them under src
42 # Force temp files in a local temp, easier to clean
43 # when nmake crashes and leaves a lot of rubbish behind
44 TMPDIR=$(ROOTDIR)\win\tmp
48 ###########################################################
49 ############### Targets - what to make
50 ###########################################################
52 IRTCLDLL=$(BINDIR)\irtcl.dll
55 ###########################################################
56 ############### Compiler and linker options
57 ###########################################################
60 ### C and CPP compiler (the same thing)
61 # Note: $(CPP) has already been defined in the environment
62 # (if you set things up right!)
65 /nologo /W3 /GX /FD /c \
66 /D "WIN32" /D "IR_TCL_VERSION=\"$(VERSION)\"" \
85 # /GX = Enable exception handling
86 # /FD = Generate file dependencies (what ever they are)
87 # /c = compile without linking
88 # /FR = Generate browse info (.sbr file that gets combined into .bsc)
89 # /Fo = object file name (or at least path)
90 # /Fd = debug database name (or path)
91 # /MD = Runtime library: Multithread DLL
92 # /MDd = Runtime library: Multithread DLL (debug)
93 # /Od = Disable optimising (debug)
94 # /O2 = Optimize for speed
95 # /YX = Automatic use of precomipled headers
96 # /Gm = Minimal rebuild (some cpp class stuff)
97 # /Zi = Program database for debuggers
98 # /ZI = Pgm database with special "edit&continue" stuff - not available in C5
104 LINK_LIBS= kernel32.lib user32.lib gdi32.lib winspool.lib \
105 comdlg32.lib advapi32.lib shell32.lib ole32.lib \
106 oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
107 wsock32.lib advapi32.lib
109 COMMON_LNK_OPTIONS= \
114 DEBUG_LNK_OPTIONS= /debug
116 RELEASE_LNK_OPTIONS= /pdb:none
118 IRTCL_LINK_OPTIONS = /dll
120 # Final opt variables
122 COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES)
123 MTLOPT= $(COMMON_MTL_OPTIONS) $(DEBUG_MTL_OPTIONS)
124 RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS)
125 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS)
128 COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES)
129 MTLOPT= $(COMMON_MTL_OPTIONS) $(RELEASE_MTL_OPTIONS)
130 RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS)
131 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
134 ###########################################################
135 ############### Source and object modules
136 ###########################################################
138 # Note: Ordinary source files are not specified here at
139 # all, make finds them in suitable dirs. The object modules
140 # need to be specified, though
143 $(OBJDIR)\ir-tcl.obj \
145 $(OBJDIR)\explain.obj \
148 $(OBJDIR)\queue.obj \
151 ALL_OBJS=$(IRTCL_OBJS)
153 ###########################################################
154 ############### Compiling
155 ###########################################################
157 # Note: This defines where to look for the necessary
158 # source files. Funny way of doing it, but it works.
160 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
163 {$(SRCDIR)}.c{$(OBJDIR)}.obj:
166 ###########################################################
167 ############### Linking
168 ###########################################################
170 $(IRTCLDLL) : "$(BINDIR)" $(IRTCL_OBJS)
171 @echo Linking irtcl DLL $(IRTCLDLL)
172 $(LINK) $(IRTCL_LINK_OPTIONS) @<<
181 ###########################################################
182 ############### Special operations
183 ###########################################################
193 # Because DOS del will only accept one file name to delete,
194 # the _H_ files work only on sets that have just one file.
195 # Z3950_H_FILES had to be spelled out. One more point for MS!
197 ########### check directories and create if needed
198 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR)
200 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR):
201 if not exist "$@/$(NUL)" mkdir "$@"
203 ###########################################################
204 ############### Explicit dependencies
205 ###########################################################
207 $(ALL_OBJS): makefile
209 # force recompilation of everything, if makefile changed
211 ###########################################################
213 ###########################################################
216 # Revision 1.2 2001-12-03 00:31:06 adam
217 # Towards 1.4. Configure updates.
219 # Revision 1.1 1999/09/10 10:02:29 adam
220 # Added MS NMAKE files - removed project files.