arabica/examples/SAX/Makefile

131 lines
3.4 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
# C/C++ shortcuts
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.
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
ifeq ($(OS_VER),SunOS)
CXXFLAGS = -Wall -pthreads -fpic
else
CXXFLAGS = -Wall -pthread -fpic
endif
2002-06-21 13:16:28 +02:00
LDFLAGS =
CCDEPFLAGS = -E -M
2002-06-21 13:16:28 +02:00
# Uncomment for optimisations
CXXFLAGS += -O2
LDFLAGS += -O2 -L../../bin -lstlport_gcc -lSAX -lArabicaUtils -lxml2
2002-06-21 13:16:28 +02:00
# Uncomment for debug version
# CXXFLAGS += -g -D__DEBUG__
2002-06-21 13:16:28 +02:00
# Includes and library directories
INCS_DIRS = -I../.. -I/usr/local/include/stlport -I/opt/gnome2/include/libxml2
#INCS_DIRS = -I..
2002-06-21 13:16:28 +02:00
LIBS_DIRS =
2002-06-21 13:16:28 +02:00
STATIC_LIBS =
DYNAMIC_LIBS = -L../../bin -L/opt/gnome2/lib -lstlport_gcc -lSAX -lxml2
2002-06-21 13:16:28 +02: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-06-21 13:16:28 +02:00
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# High level rules
all : pyx simple_handler writer
pyx : $(PYX_OBJS)
$(LINK.cc) -o $@ $(PYX_OBJS)
2002-06-21 13:16:28 +02:00
cp pyx ../../bin
simple_handler : $(SIMPLE_OBJS)
$(LINK.cc) -o $@ $(SIMPLE_OBJS)
2002-06-21 13:16:28 +02:00
cp simple_handler ../../bin
writer : $(WRITER_OBJS)
$(LINK.cc) -o $@ $(WRITER_OBJS)
2002-06-21 13:16:28 +02:00
cp writer ../../bin
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Compile rules
%.o : %.cpp
$(COMPILE.cc) -o $@ $<
2002-06-21 13:16:28 +02:00
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Dependencies
depend : .depend
.depend ::
$(COMPILE.cc) $(CCDEPFLAGS) ${PYX_SRCS} $(WRITER_SRCS) ${SIMPLE_SRCS} > .depend
2002-06-21 13:16:28 +02:00
-include .depend
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Cleaning up
clean :
$(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