root/gsdl/trunk/common-src/src/lib/win32.mak @ 18076

Revision 18076, 3.3 KB (checked in by oranfry, 12 years ago)

use sqlite by default

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1###########################################################################
2#
3# win32 makefile -- lib
4# A component of the Greenstone digital library software
5# from the New Zealand Digital Library Project at the
6# University of Waikato, New Zealand.
7#
8# Copyright (C) 1999-2008  The New Zealand Digital Library Project
9#
10#
11# This program is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24#
25###########################################################################
26
27GSDL_DIR = ..\..\..
28INDEXERS_DIR = $(GSDL_DIR)\common-src\indexers
29PACKAGES_DIR = $(GSDL_DIR)\common-src\packages
30
31
32GSDL_VC4 = 0
33LOCAL_LIBRARY = 0
34DLL = 0
35DLLDEBUG = 0
36USE_SQLITE = 1
37USE_MSSQL = 0
38
39
40!IF $(GSDL_VC4)
41CPPFLAGS = -GX
42!ELSE
43CPPFLAGS = -EHsc
44!ENDIF
45
46!IF $(DLL)
47CPPFLAGS = $(CPPFLAGS) -MD
48!ELSE
49!IF ($(DLLDEBUG))
50CPPFLAGS = $(CPPFLAGS) -MDd
51!ENDIF
52!ENDIF
53
54!IF $(USE_MSSQL)
55MSSQL_OBJECTS = mssqldbclass.obj
56MSSQL_SOURCES = mssqldbclass.cpp
57!ELSE
58MSSQL_OBJECTS =
59MSSQL_SOURCES =
60!ENDIF
61
62!IF $(USE_SQLITE)
63SQLITE_INCLUDES = -I"$(PACKAGES_DIR)\sqlite\include"
64SQLITE_OBJECTS = sqlitedbclass.obj
65SQLITE_SOURCES = sqlitedbclass.cpp
66!ELSE
67SQLITE_INCLUDES =
68SQLITE_OBJECTS =
69SQLITE_SOURCES =
70!ENDIF
71
72
73AR = lib
74CC = cl
75DEFS = -D__WIN32__ -DHAVE_CONFIG_H -DPARADOCNUM -D_LITTLE_ENDIAN -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE
76INCLUDES = -I"$(GSDL_DIR)" -I"$(INDEXERS_DIR)\mg\lib" -I"$(PACKAGES_DIR)\windows\gdbm\gdbm" $(SQLITE_INCLUDES)
77
78!IF $(GSDL_VC4)
79DEFS = $(DEFS) -DGSDL_NAMESPACE_BROKEN -DGSDL_USE_IOS_H -D__STL_NO_NEW_IOSTREAMS
80INCLUDES = $(INCLUDES) -I"$(PACKAGES_DIR)\windows\stlport\stlport"
81!ENDIF
82!IF $(LOCAL_LIBRARY)
83DEFS = $(DEFS) -DGSDL_LOCAL_LIBRARY
84!ENDIF
85
86
87COMPILE = $(CC) -nologo -c $(CPPFLAGS) $(DEFS) $(INCLUDES)
88
89
90.SUFFIXES:
91.SUFFIXES: .cpp .obj
92.cpp.obj:
93    $(COMPILE) $<
94
95
96SOURCES = \
97    cfgread.cpp \
98    cnfgable.cpp \
99    cnfgator.cpp \
100    dbclass.cpp \
101    display.cpp \
102    fileutil.cpp \
103    gdbmclass.cpp \
104    gsdlsitecfg.cpp \
105    gsdltimes.cpp \
106    gsdltools.cpp \
107    gsdlunicode.cpp \
108    infodbclass.cpp \
109    md5.cpp \
110    OIDtools.cpp \
111    phrases.cpp \
112    text_t.cpp \
113    $(SQLITE_SOURCES) \
114    $(MSSQL_SOURCES)
115
116OBJECTS = \
117    cfgread.obj \
118    cnfgable.obj \
119    cnfgator.obj \
120    dbclass.obj \
121    display.obj \
122    fileutil.obj \
123    gdbmclass.obj \
124    gsdlsitecfg.obj \
125    gsdltimes.obj \
126    gsdltools.obj \
127    gsdlunicode.obj \
128    infodbclass.obj \
129    md5.obj \
130    OIDtools.obj \
131    phrases.obj \
132    text_t.obj \
133    $(SQLITE_OBJECTS) \
134        $(MSSQL_OBJECTS)
135
136LIBRARY = gsdllib.lib   
137
138
139# Default target: make gsdllib.lib
140all: $(LIBRARY)
141
142gsdllib.lib : $(OBJECTS)
143    if EXIST $(LIBRARY) del $(LIBRARY)
144    $(AR) -nologo /out:$(LIBRARY) $(OBJECTS)
145
146install:
147
148clean:
149    del *.obj
150    del $(LIBRARY)
151
152
153# Always recompile gsdltools in case GSDL_LOCAL_LIBRARY has changed
154gsdltools.obj: FORCE
155
156FORCE:
Note: See TracBrowser for help on using the browser.