arabica/SAX/Makefile

144 lines
3.7 KiB
Makefile
Raw Normal View History

2002-06-21 13:16:28 +02:00
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Utilities
REMOVE = rm -rf
LINK = ln -sf
# 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.
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
ifeq ($(OS_VER),SunOS)
CXXFLAGS = -Wall -pthreads -fpic
else
2003-04-03 16:01:44 +02:00
CXXFLAGS = -Wall
endif
2002-06-21 13:16:28 +02:00
LDFLAGS = -shared -Wl,"-hlibArabica.so.1"
CCDEPFLAGS = -E -M
2002-06-21 13:16:28 +02:00
# Uncomment for optimisations
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..
#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 \
helpers/InputSourceResolver.cpp \
../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
all : libArabica.so.1 libArabica.a
libArabica.so.1 : $(OBJS)
$(LINK.cc) -o $@ $(OBJS)
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
# $(LINK) $@ libArabica.so
2002-06-21 13:16:28 +02:00
libArabica.a : $(OBJS)
2002-06-21 13:16:28 +02:00
ar r $@ $(OBJS)
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
2002-06-21 13:16:28 +02:00
%.o : %.cpp
$(COMPILE.cc) -o $@ $<
2002-06-21 13:16:28 +02:00
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Dependencies
depend : .depend
.depend ::
$(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