arabica/examples/SAX2DOM/Makefile

123 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 -lArabica
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../..
#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 -lArabica -lxml
2002-06-21 13:16:28 +02:00
CXXFLAGS += ${INCS_DIRS}
LDFLAGS += ${DYNAMIC_LIBS}
2002-06-21 13:16:28 +02:00
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Source files
SAXDOM_SRCS = main.cpp test_Attribute.cpp test_Document.cpp test_DocumentFragment.cpp test_DocumentType.cpp test_DOMImplementation.cpp test_Element.cpp test_ProcessingInstruction.cpp test_Siblings.cpp test_SAX.cpp
2002-06-21 13:16:28 +02:00
SAXDOM_HDRS = $(patsubst %.cpp,%.h,$(SAXDOM_SRCS))
SAXDOM_OBJS = $(patsubst %.cpp,%.o,$(SAXDOM_SRCS))
CPPUNITFW_FILES = TestCase.cpp TestFailure.cpp TestResult.cpp TestSuite.cpp
CPPUNITFW_SRCS = $(patsubst Test%,CppUnit/framework/Test%,$(CPPUNITFW_FILES))
CPPUNITFW_OBJS = $(patsubst %.cpp,%.o,$(CPPUNITFW_SRCS))
CPPUNITUI_FILES = TextTestResult.cpp
CPPUNITUI_SRCS = $(patsubst Text%,CppUnit/textui/Text%,$(CPPUNITUI_FILES))
CPPUNITUI_OBJS = $(patsubst %.cpp,%.o,$(CPPUNITUI_SRCS))
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# High level rules
all : sax2dom_test
2002-06-21 13:16:28 +02:00
sax2dom_test : $(SAXDOM_OBJS) $(CPPUNITFW_OBJS) $(CPPUNITUI_OBJS)
$(LINK.cc) -o $@ $(SAXDOM_OBJS) $(CPPUNITFW_OBJS) $(CPPUNITUI_OBJS)
2002-06-21 13:16:28 +02:00
cp sax2dom_test ../../bin
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Compile rules
%.o : %.cpp
$(COMPILE.cc) -o $@ $<
2002-06-21 13:16:28 +02:00
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Dependencies
depend : .depend
.depend ::
$(COMPILE.cc) $(CCDEPFLAGS) $(SAXDOM_SRCS) $(CPPUNITFW_SRCS) $(CPPUNITUI_SRCS) > .depend
2002-06-21 13:16:28 +02:00
-include .depend
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Cleaning up
clean :
$(REMOVE) .depend $(CPPUNITUI_OBJS) $(CPPUNITFW_OBJS) $(SAXDOM_OBJS) core sax2dom_test ../../bin/sax2dom_test
2002-06-21 13:16:28 +02:00
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# End of File