2002-06-21 13:16:28 +02:00
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
|
|
|
# Utilities
|
|
|
|
|
|
|
|
REMOVE = rm -rf
|
|
|
|
LINK = ln -sf
|
|
|
|
|
2002-11-23 20:53:46 +01:00
|
|
|
# For GNU make:
|
|
|
|
OS_VER := $(shell uname -s | sed -e s/\[\.\ \]/_/g)
|
|
|
|
# For other make (like Sun's) you can try:
|
|
|
|
# OS_VER:sh =uname -sr | sed -e s/\[\.\ \]/_/g
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2003-09-09 23:40:23 +02:00
|
|
|
# C++ compiler
|
|
|
|
CXX = gcc
|
|
|
|
# preprocessor
|
|
|
|
CPP = gcc -E
|
|
|
|
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
# Compile and link flags...
|
|
|
|
#
|
|
|
|
# -c Produce object code.
|
|
|
|
# -Wall Max warning level.
|
|
|
|
# -Werror Treat warnings as errors.
|
|
|
|
# -O2 Turn on medium optimisations.
|
|
|
|
# -g Add debug information.
|
|
|
|
# -D Define symbolic constant.
|
|
|
|
# -fPIC Generate position independent code.
|
|
|
|
# -shared Produce a sharable object.
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
2002-11-23 20:53:46 +01:00
|
|
|
ifeq ($(OS_VER),SunOS)
|
|
|
|
CXXFLAGS = -Wall -pthreads -fpic
|
|
|
|
else
|
2003-04-03 16:01:44 +02:00
|
|
|
CXXFLAGS = -Wall
|
2002-11-23 20:53:46 +01:00
|
|
|
endif
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2003-08-25 17:13:47 +02:00
|
|
|
LDFLAGS = -shared -Wl,"-hlibArabica.so.1"
|
2002-11-23 20:53:46 +01:00
|
|
|
CCDEPFLAGS = -E -M
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
# Uncomment for optimisations
|
2002-11-23 20:53:46 +01:00
|
|
|
CXXFLAGS += -O2
|
|
|
|
LDFLAGS += -O2
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2003-04-03 15:18:27 +02:00
|
|
|
# edit for your parser choice - may include more than one
|
2003-09-09 13:14:48 +02:00
|
|
|
PARSER_CONFIG = -DUSE_EXPAT -DARABICA_NO_WCHAR_T
|
2003-04-03 16:01:44 +02:00
|
|
|
#PARSER_CONFIG = -DUSE_EXPAT -DUSE_LIBXML2 -DUSE_XERCES -DUSE_GARDEN
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
# Includes and library directories
|
2003-04-03 15:18:27 +02:00
|
|
|
INCS_DIRS = -I..
|
2002-11-23 20:53:46 +01:00
|
|
|
#INCS_DIRS = -I..
|
2002-06-21 13:16:28 +02:00
|
|
|
LIBS_DIRS =
|
|
|
|
|
|
|
|
STATIC_LIBS =
|
2003-04-03 15:18:27 +02:00
|
|
|
DYNAMIC_LIBS = -lstdc++
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2003-09-09 23:40:23 +02:00
|
|
|
CXXFLAGS += $(INCS_DIRS)
|
|
|
|
LDFLAGS += $(DYNAMIC_LIBS)
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
2003-04-03 15:18:27 +02:00
|
|
|
SRCS = saxlib.cpp \
|
2002-11-23 20:53:46 +01:00
|
|
|
helpers/InputSourceResolver.cpp \
|
2003-09-08 18:03:57 +02:00
|
|
|
../Utils/base64codecvt.cpp \
|
|
|
|
../Utils/iso88591utf8codecvt.cpp \
|
|
|
|
../Utils/rot13codecvt.cpp \
|
|
|
|
../Utils/utf16beucs2codecvt.cpp \
|
|
|
|
../Utils/utf16leucs2codecvt.cpp \
|
|
|
|
../Utils/utf16utf8codecvt.cpp \
|
|
|
|
../Utils/utf8iso88591codecvt.cpp \
|
|
|
|
../Utils/utf8ucs2codecvt.cpp \
|
|
|
|
../Utils/impl/iso88591_utf8.cpp \
|
|
|
|
../Utils/impl/ucs2_utf16.cpp \
|
|
|
|
../Utils/impl/ucs2_utf8.cpp \
|
|
|
|
../XML/XMLCharacterClasses.cpp
|
|
|
|
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(SRCS)))
|
|
|
|
OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SRCS)))
|
|
|
|
|
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
|
|
|
# High level rules
|
|
|
|
|
2003-08-25 17:13:47 +02:00
|
|
|
all : libArabica.so.1 libArabica.a
|
2002-11-23 20:53:46 +01:00
|
|
|
|
2003-08-25 17:13:47 +02:00
|
|
|
libArabica.so.1 : $(OBJS)
|
2002-11-23 20:53:46 +01:00
|
|
|
$(LINK.cc) -o $@ $(OBJS)
|
2003-08-25 17:13:47 +02:00
|
|
|
cp -f libArabica.so.1 ../bin
|
|
|
|
(cd ../bin; rm -f libArabica.so; ln -s libArabica.so.1 libArabica.so)
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2003-08-25 17:13:47 +02:00
|
|
|
# $(LINK) $@ libArabica.so
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2003-08-25 17:13:47 +02:00
|
|
|
libArabica.a : $(OBJS)
|
2002-06-21 13:16:28 +02:00
|
|
|
ar r $@ $(OBJS)
|
2003-08-25 17:13:47 +02:00
|
|
|
cp -f libArabica.a ../bin
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
|
|
|
# Compile rules
|
2003-09-09 13:14:48 +02:00
|
|
|
saxlib.cpp : ParserConfig.S saxlib.S ArabicaConfig.S
|
2003-09-09 23:40:23 +02:00
|
|
|
$(CPP) $(PARSER_CONFIG) -o ArabicaConfig.h ArabicaConfig.S
|
|
|
|
$(CPP) $(PARSER_CONFIG) -o ParserConfig.h ParserConfig.S
|
|
|
|
$(CPP) $(PARSER_CONFIG) -o saxlib.cpp saxlib.S
|
2003-09-08 18:03:57 +02:00
|
|
|
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
%.o : %.cpp
|
2002-11-23 20:53:46 +01:00
|
|
|
$(COMPILE.cc) -o $@ $<
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
|
|
|
|
depend : .depend
|
|
|
|
|
|
|
|
.depend ::
|
2002-11-23 20:53:46 +01:00
|
|
|
$(COMPILE.cc) $(CCDEPFLAGS) $(SRCS) > .depend
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
-include .depend
|
|
|
|
|
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
|
|
|
# Cleaning up
|
|
|
|
|
|
|
|
clean :
|
2003-09-09 13:14:48 +02:00
|
|
|
$(REMOVE) .depend *.o helpers/*.o wrappers/*.o ../Utils/*.o ../Utils/impl/*.o ../XML/*.o libArabica* *~ helpers/*~ core ../bin/libArabica* saxlib.cpp ParserConfig.h ArabicaConfig.h
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
|
|
|
# End of File
|