1 # Copyright (C) 1999-2006, Index Data ApS
3 # $Id: makefile,v 1.18 2007-01-11 12:18:55 adam Exp $
7 DEBUG=0 # 0 for release, 1 for debug
14 all: dirs generated dll myclient zclient yaz
16 NSIS="c:\program files\nsis\makensis-bz2.exe"
25 # The current directory is supposed to be something like
26 # ..../yaz/win, everything is relative to that
27 ROOTDIR=.. # The home of yazpp
29 INCLDIR=$(ROOTDIR)\include # our includes
30 LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there
31 BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there
32 WINDIR=$(ROOTDIR)\win # all these Win make things
33 SRCDIR=$(ROOTDIR)\src # for the case we move them under src
34 ZOOMDIR=$(ROOTDIR)\zoom
37 OBJDIR=$(WINDIR)\dobj # where we store intermediate files
39 OBJDIR=$(WINDIR)\obj # where we store intermediate files
42 TMPDIR=$(ROOTDIR)\win\tmp
45 # Targets - what to make
48 YAZPP_DLL=$(BINDIR)\yazpp_1_d.dll
49 YAZPP_IMPLIB=$(LIBDIR)\yazpp_1_d.lib
52 YAZPP_DLL=$(BINDIR)\yazpp_1.dll
53 YAZPP_IMPLIB=$(LIBDIR)\yazpp_1.lib
57 ZCLIENT=$(BINDIR)\zclient.exe
58 MY_CLIENT=$(BINDIR)\yaz-my-client.exe
60 # shortcut names defined here
63 myclient: $(MY_CLIENT)
65 # Compiler and linker options
68 YAZ_LIB="$(YAZ_DIR)\lib\$(YAZD).lib"
69 YAZ_DEF=/I"$(YAZ_DIR)\include"
70 yaz: $(BINDIR)\$(YAZD).dll
72 $(BINDIR)\$(YAZD).dll: "$(YAZ_DIR)\bin\$(YAZD).dll"
73 copy "$(YAZ_DIR)\bin\$(YAZD).dll" $(BINDIR)
76 /nologo /W3 /EHsc /FD /c \
77 /D "_CRT_SECURE_NO_DEPRECATE" \
87 /I"$(ROOTDIR)\include"
98 # /GX = Enable exception handling
99 # /FD = Generate file dependencies (what ever they are)
100 # /c = compile without linking
101 # /FR = Generate browse info (.sbr file that gets combined into .bsc)
102 # /Fo = object file name (or at least path)
103 # /Fd = debug database name (or path)
104 # /MD = Runtime library: Multithread DLL
105 # /MDd = Runtime library: Multithread DLL (debug)
106 # /Od = Disable optimising (debug)
107 # /O2 = Optimize for speed
108 # /Gm = Minimal rebuild (some cpp class stuff)
109 # /Zi = Program database for debuggers
110 # /ZI = Pgm database with special "edit&continue" stuff - not available in C5
116 LINK_LIBS= kernel32.lib user32.lib gdi32.lib advapi32.lib uuid.lib \
117 wsock32.lib advapi32.lib \
120 COMMON_LNK_OPTIONS= /nologo /subsystem:windows /machine:i386 /incremental:no
122 DEBUG_LNK_OPTIONS= /debug
126 DLL_LINK_OPTIONS= /dll
127 CLIENT_LINK_OPTIONS = /subsystem:console
129 # Final opt variables
131 COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES)
132 RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS)
133 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS)
136 COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES)
137 RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS)
138 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
141 # Source and object modules
144 "$(OBJDIR)\gdu.obj" \
145 "$(OBJDIR)\gduqueue.obj" \
146 "$(OBJDIR)\pdu-observer.obj" \
147 "$(OBJDIR)\query.obj" \
148 "$(OBJDIR)\socket-observer.obj" \
149 "$(OBJDIR)\z-server.obj" \
150 "$(OBJDIR)\yaz-socket-manager.obj" \
151 "$(OBJDIR)\yaz-pdu-assoc.obj" \
152 "$(OBJDIR)\yaz-z-assoc.obj" \
153 "$(OBJDIR)\yaz-z-query.obj" \
154 "$(OBJDIR)\yaz-ir-assoc.obj" \
155 "$(OBJDIR)\yaz-z-server.obj" \
156 "$(OBJDIR)\yaz-pdu-assoc-thread.obj" \
157 "$(OBJDIR)\yaz-z-server-sr.obj" \
158 "$(OBJDIR)\yaz-z-server-ill.obj" \
159 "$(OBJDIR)\yaz-z-server-update.obj" \
160 "$(OBJDIR)\yaz-z-databases.obj" \
161 "$(OBJDIR)\yaz-z-cache.obj" \
162 "$(OBJDIR)\yaz-cql2rpn.obj" \
163 "$(OBJDIR)\zexcept.obj" \
164 "$(OBJDIR)\zconn.obj" \
165 "$(OBJDIR)\zquery.obj" \
166 "$(OBJDIR)\zrs.obj" \
170 "$(OBJDIR)\yaz-my-client.obj"
173 "$(OBJDIR)\zclient.obj"
175 # Note: This defines where to look for the necessary
176 # source files. Funny way of doing it, but it works.
178 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
181 {$(ZOOMDIR)}.cpp{$(OBJDIR)}.obj:
184 ### The RC compiler (resource files)
186 COMMON_RC_OPTIONS= /l 0x406 /i"$(ROOTDIR)"
187 DEBUG_RC_OPTIONS=/d "_DEBUG"
188 RELEASE_RC_OPTIONS=/d "NDEBUG"
196 $(YAZPP_DLL) $(YAZPP_IMPLIB): "$(BINDIR)" $(YAZPP_DLL_OBJS)
200 $(DLL_LINK_OPTIONS) \
202 /out:"$(YAZPP_DLL)" \
203 /implib:"$(YAZPP_IMPLIB)"
205 $(MY_CLIENT) : "$(BINDIR)" $(MY_CLIENT_OBJS) $(YAZPP_IMPLIB)
208 $(CLIENT_LINK_OPTIONS) \
214 $(ZCLIENT) : "$(BINDIR)" $(ZCLIENT_OBJS) $(YAZPP_IMPLIB)
217 $(CLIENT_LINK_OPTIONS) \
223 generated: $(ZOOMDIR)\zoom.h
225 "$(ZOOMDIR)\zoom.h": "$(ZOOMDIR)\master-header"
226 sed "s/^* / /; s/^*/ /" "$(ZOOMDIR)\master-header" >"$(ZOOMDIR)\zoom.h"
236 -del $(ZOOMDIR)\zoom.h
238 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR)
240 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR):
241 if not exist "$@/$(NUL)" mkdir "$@"