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
|
|
|
|
|
|
|
# C/C++ shortcuts
|
2002-11-23 20:53:46 +01:00
|
|
|
CXX = c++
|
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
|
|
|
|
CXXFLAGS = -Wall -pthread -fpic
|
|
|
|
endif
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2002-11-23 20:53:46 +01:00
|
|
|
LDFLAGS =
|
|
|
|
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 -L../../bin -lstlport_gcc -lSAX -lArabicaUtils -lxml2
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
# Uncomment for debug version
|
2002-11-23 20:53:46 +01:00
|
|
|
# CXXFLAGS += -g -D__DEBUG__
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Includes and library directories
|
2002-11-23 20:53:46 +01:00
|
|
|
INCS_DIRS = -I../.. -I/usr/local/include/stlport -I/opt/gnome2/include/libxml2
|
|
|
|
#INCS_DIRS = -I..
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2002-11-23 20:53:46 +01:00
|
|
|
LIBS_DIRS =
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2002-11-23 20:53:46 +01:00
|
|
|
STATIC_LIBS =
|
|
|
|
DYNAMIC_LIBS = -L../../bin -L/opt/gnome2/lib -lstlport_gcc -lSAX -lxml2
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2002-11-23 20:53:46 +01:00
|
|
|
CXXFLAGS += ${INCS_DIRS}
|
|
|
|
LDFLAGS += ${DYNAMIC_LIBS}
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
|
|
|
PYX_SRCS = pyx.cpp
|
|
|
|
PYX_HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(PYX_SRCS)))
|
|
|
|
PYX_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(PYX_SRCS)))
|
|
|
|
|
|
|
|
SIMPLE_SRCS = wrapper.cpp SimpleHandler.cpp
|
|
|
|
SIMPLE_HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(SIMPLE_SRCS)))
|
|
|
|
SIMPLE_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SIMPLE_SRCS)))
|
|
|
|
|
|
|
|
WRITER_SRCS = writer.cpp
|
|
|
|
WRITER_HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(WRITER_SRCS)))
|
|
|
|
WRITER_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(WRITER_SRCS)))
|
|
|
|
|
2002-11-23 20:53:46 +01:00
|
|
|
|
2002-06-21 13:16:28 +02:00
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
|
|
|
# High level rules
|
|
|
|
|
|
|
|
all : pyx simple_handler writer
|
|
|
|
|
|
|
|
pyx : $(PYX_OBJS)
|
2002-11-23 20:53:46 +01:00
|
|
|
$(LINK.cc) -o $@ $(PYX_OBJS)
|
2002-06-21 13:16:28 +02:00
|
|
|
cp pyx ../../bin
|
|
|
|
|
|
|
|
simple_handler : $(SIMPLE_OBJS)
|
2002-11-23 20:53:46 +01:00
|
|
|
$(LINK.cc) -o $@ $(SIMPLE_OBJS)
|
2002-06-21 13:16:28 +02:00
|
|
|
cp simple_handler ../../bin
|
|
|
|
|
|
|
|
writer : $(WRITER_OBJS)
|
2002-11-23 20:53:46 +01:00
|
|
|
$(LINK.cc) -o $@ $(WRITER_OBJS)
|
2002-06-21 13:16:28 +02:00
|
|
|
cp writer ../../bin
|
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
|
|
|
# Compile rules
|
|
|
|
|
|
|
|
%.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) ${PYX_SRCS} $(WRITER_SRCS) ${SIMPLE_SRCS} > .depend
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
-include .depend
|
|
|
|
|
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
|
|
|
# Cleaning up
|
|
|
|
|
|
|
|
clean :
|
2002-11-23 20:53:46 +01:00
|
|
|
$(REMOVE) .depend *.o core pyx writer simple_handler ../../bin/pyx ../../bin/writer ../../bin/simple_handler
|
|
|
|
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
#/////////////////////////////////////////////////////////////////////////
|
|
|
|
#//////////////////////////////////////////////
|
|
|
|
|
|
|
|
# End of File
|