mirror of
https://github.com/jezhiggins/arabica
synced 2024-12-28 22:23:21 +01:00
13d4953da9
library, and it is no longer necessary for client application to specify it.
123 lines
3 KiB
Makefile
123 lines
3 KiB
Makefile
#/////////////////////////////////////////////////////////////////////////
|
|
#//////////////////////////////////////////////
|
|
|
|
# Utilities
|
|
|
|
REMOVE = rm -rf
|
|
LINK = ln -sf
|
|
|
|
|
|
# C/C++ shortcuts
|
|
CPP = /usr/local/bin/gcc
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
#//////////////////////////////////////////////
|
|
# 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.
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
#//////////////////////////////////////////////
|
|
|
|
COMPILE_FLAGS = -Wall -c -shared
|
|
|
|
LINK_FLAGS = -Wall -Werror -shared -Wl,-soname,libSAX.so.1
|
|
|
|
# Uncomment for optimisations
|
|
# COMPILE_FLAGS += -02
|
|
# LINK_FLAGS += -02
|
|
|
|
# Uncomment for debug version
|
|
# COMPILE_FLAGS += -g -D__DEBUG__
|
|
# LINK_FLAGS += -g -D__DEBUG__
|
|
|
|
|
|
# Includes and library directories
|
|
#INCS_DIRS = -I.. -I/usr/local/include/stlport
|
|
INCS_DIRS = -I..
|
|
|
|
LIBS_DIRS =
|
|
|
|
STATIC_LIBS =
|
|
DYNAMIC_LIBS =
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
#//////////////////////////////////////////////
|
|
|
|
# Source files
|
|
PARSER_OPTS = -DUSE_EXPAT
|
|
# define any or all of USE_EXPAT, USE_XERCES, USE_LIBXML2, USE_GARDEN to pull in support
|
|
# for those parsers.
|
|
|
|
|
|
SRCS = saxlib.cpp helpers/InputSourceResolver.cpp ../Utils/utf16utf8_codecvt.cpp
|
|
|
|
HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(SRCS)))
|
|
OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SRCS)))
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
#//////////////////////////////////////////////
|
|
|
|
# High level rules
|
|
|
|
all : libSAX.a
|
|
|
|
libSAX.so : $(OBJS)
|
|
$(CPP) $(LIB_DIRS) $(LINK_FLAGS) -o $@ $(OBJS)
|
|
$(LINK) $@ $@.1
|
|
|
|
libSAX.a : $(OBJS)
|
|
ar r $@ $(OBJS)
|
|
cp libSAX.a ../bin
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
#//////////////////////////////////////////////
|
|
|
|
# Compile rules
|
|
|
|
%.o : %.cpp
|
|
$(CPP) $(COMPILE_FLAGS) $(INCS_DIRS) -o $@ $<
|
|
|
|
saxlib.cpp : saxlib.tpl ParserConfig.h
|
|
$(CPP) -x c++ -E $(PARSER_OPTS) saxlib.tpl -o saxlib.cpp
|
|
|
|
ParserConfig.h: ParserConfig.tpl
|
|
$(CPP) -x c++ -E $(PARSER_OPTS) ParserConfig.tpl -o ParserConfig.h
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
#//////////////////////////////////////////////
|
|
|
|
# Dependencies
|
|
|
|
depend : .depend
|
|
|
|
.depend ::
|
|
$(CPP) $(COMPILE_FLAGS) $(INCS_DIRS) -MM $(SRCS) > .depend
|
|
|
|
-include .depend
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
#//////////////////////////////////////////////
|
|
|
|
# Cleaning up
|
|
|
|
clean :
|
|
$(REMOVE) .depend *.o helpers/*.o wrappers/*.o ../Utils/*.o libSAX* *~ helpers/*~ core ../bin/libSAX* saxlib.cpp ParserConfig.h
|
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
#//////////////////////////////////////////////
|
|
|
|
# End of File
|