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

Revision 19875, 3.4 KB (checked in by kjdon, 11 years ago)

making common-src compile independently of gsdl or gs2build (for gs3) so modified makefiles to look for things in common-src dir rather than one level up

  • 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
27COMMON_DIR = ..\..
28
29INDEXERS_DIR = $(COMMON_DIR)\indexers
30COMMON_PACKAGES_DIR = $(COMMON_DIR)\packages
31
32
33GSDL_VC4 = 0
34LOCAL_LIBRARY = 0
35DEBUG = 0
36DLL = 0
37DLLDEBUG = 0
38USE_SQLITE = 1
39USE_MSSQL = 0
40
41!IF $(DEBUG)
42CXXFLAGS = -DEBUG -Z7 /errorReport:prompt
43!ELSE
44CXXFLAGS =
45!ENDIF
46
47
48!IF $(GSDL_VC4)
49CXXFLAGS = $(CXXFLAGS) -GX
50!ELSE
51CXXFLAGS = $(CXXFLAGS) -EHsc
52!ENDIF
53
54!IF $(DLL)
55CXXFLAGS = $(CXXFLAGS) -MD
56!ELSE
57!IF ($(DLLDEBUG))
58CXXFLAGS = $(CXXFLAGS) -MDd
59!ENDIF
60!ENDIF
61
62!IF $(USE_MSSQL)
63MSSQL_OBJECTS = mssqldbclass.obj
64MSSQL_SOURCES = mssqldbclass.cpp
65!ELSE
66MSSQL_OBJECTS =
67MSSQL_SOURCES =
68!ENDIF
69
70!IF $(USE_SQLITE)
71SQLITE_INCLUDES = -I"$(COMMON_PACKAGES_DIR)\sqlite\include"
72SQLITE_OBJECTS = sqlitedbclass.obj
73SQLITE_SOURCES = sqlitedbclass.cpp
74!ELSE
75SQLITE_INCLUDES =
76SQLITE_OBJECTS =
77SQLITE_SOURCES =
78!ENDIF
79
80
81AR = lib
82CC = cl
83DEFS = -D__WIN32__ -DHAVE_CONFIG_H -DPARADOCNUM -D_LITTLE_ENDIAN -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE
84INCLUDES = -I"$(COMMON_DIR)" -I"$(INDEXERS_DIR)\mg\lib" \
85    -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3" -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3\windows" \
86    $(SQLITE_INCLUDES)
87
88!IF $(GSDL_VC4)
89DEFS = $(DEFS) -DGSDL_NAMESPACE_BROKEN -DGSDL_USE_IOS_H -D__STL_NO_NEW_IOSTREAMS
90INCLUDES = $(INCLUDES) -I"$(COMMON_PACKAGES_DIR)\windows\stlport\stlport"
91!ENDIF
92!IF $(LOCAL_LIBRARY)
93DEFS = $(DEFS) -DGSDL_LOCAL_LIBRARY
94!ENDIF
95
96
97COMPILE = $(CC) -nologo -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
98
99
100.SUFFIXES:
101.SUFFIXES: .cpp .obj
102.cpp.obj:
103    $(COMPILE) $<
104
105
106SOURCES = \
107    cfgread.cpp \
108    cnfgable.cpp \
109    cnfgator.cpp \
110    dbclass.cpp \
111    display.cpp \
112    fileutil.cpp \
113    gdbmclass.cpp \
114    gsdlsitecfg.cpp \
115    gsdltimes.cpp \
116    gsdltools.cpp \
117    gsdlunicode.cpp \
118    infodbclass.cpp \
119    md5.cpp \
120    OIDtools.cpp \
121    phrases.cpp \
122    text_t.cpp \
123    $(SQLITE_SOURCES) \
124    $(MSSQL_SOURCES)
125
126OBJECTS = \
127    cfgread.obj \
128    cnfgable.obj \
129    cnfgator.obj \
130    dbclass.obj \
131    display.obj \
132    fileutil.obj \
133    gdbmclass.obj \
134    gsdlsitecfg.obj \
135    gsdltimes.obj \
136    gsdltools.obj \
137    gsdlunicode.obj \
138    infodbclass.obj \
139    md5.obj \
140    OIDtools.obj \
141    phrases.obj \
142    text_t.obj \
143    $(SQLITE_OBJECTS) \
144        $(MSSQL_OBJECTS)
145
146LIBRARY = gsdllib.lib   
147
148
149# Default target: make gsdllib.lib
150all: $(LIBRARY)
151
152gsdllib.lib : $(OBJECTS)
153    if EXIST $(LIBRARY) del $(LIBRARY)
154    $(AR) -nologo /out:$(LIBRARY) $(OBJECTS)
155
156install:
157
158clean:
159    del *.obj
160    del $(LIBRARY)
161
162
163# Always recompile gsdltools in case GSDL_LOCAL_LIBRARY has changed
164gsdltools.obj: FORCE
165
166FORCE:
Note: See TracBrowser for help on using the browser.