Reworked Makefiles again

This commit is contained in:
jez_higgins 2003-09-10 08:48:31 +00:00
parent 357f5188f5
commit 1984e09c68
7 changed files with 141 additions and 348 deletions

View file

@ -1,19 +1,12 @@
#///////////////////////////////////////////////////////////////////////// -include Makefile.header
#//////////////////////////////////////////////
######################################
# High level rules # High level rules
all :
all : SAX, examples
SAX: dummy
cd SAX; ${MAKE} cd SAX; ${MAKE}
examples: dummy
cd examples; ${MAKE} cd examples; ${MAKE}
# Cleaning up
clean : clean :
cd SAX; ${MAKE} clean cd SAX; ${MAKE} clean
cd examples; ${MAKE} clean cd examples; ${MAKE} clean
@ -29,8 +22,10 @@ tar: clean
zip: clean zip: clean
cd ..; zip -rv9 arabica/arabica.zip arabica -x arabica/arabica.tar.gz -x \*/CVS/\* cd ..; zip -rv9 arabica/arabica.zip arabica -x arabica/arabica.tar.gz -x \*/CVS/\*
dummy:
#///////////////////////////////////////////////////////////////////////// #/////////////////////////////////////////////////////////////////////////
#////////////////////////////////////////////// #//////////////////////////////////////////////
# End of File # End of File

44
Makefile.header Normal file
View file

@ -0,0 +1,44 @@
####################################
# ARABICA CONFIG
# edit for your parser choice - may include more than one USE_*
PARSER_CONFIG = -DUSE_EXPAT
#PARSER_CONFIG = -DUSE_EXPAT -DUSE_LIBXML2 -DUSE_XERCES -DUSE_GARDEN
####################################
# TOOLS
#####
MAKE = make
# C++ compiler
CXX = gcc
# preprocessor
CPP = gcc -E
# linker
LD = gcc
# archiver
AR = ar r
###########
# Utilities
REMOVE = rm -rf
LINK = ln -sf
COPY = cp -f
######################################
# BUILD FLAGS
# you probably want to set some these according to
# your parser choice
# eg DYNAMIC_LIBS = -lexpat
CXXFLAGS = -Wall
LDFLAGS =
# Includes and library directories
INCS_DIRS = -I..
LIBS_DIRS =
STATIC_LIBS =
DYNAMIC_LIBS = -lexpat -lstdc++

View file

@ -9,47 +9,20 @@
# $Id$ # $Id$
#################################### ####################################
-include ../Makefile.header
####################################
# ARABICA CONFIG
# edit for your parser choice - may include more than one USE_*
PARSER_CONFIG = -DUSE_EXPAT -DARABICA_NO_WCHAR_T
#PARSER_CONFIG = -DUSE_EXPAT -DUSE_LIBXML2 -DUSE_XERCES -DUSE_GARDEN
####################################
# TOOLS
#####
# C++ compiler
CXX = gcc
# preprocessor
CPP = gcc -E
# linker
LD = gcc
# archiver
AR = ar r
###########
# Utilities
REMOVE = rm -rf
LINK = ln -sf
COPY = cp -f
###################################### ######################################
# BUILD FLAGS # ADDITIONAL BUILD FLAGS
CXXFLAGS += -Wall CXXFLAGS +=
LDFLAGS += -shared LDFLAGS += -shared
# Uncomment for optimisations INC_DIRS +=
CXXFLAGS += -O2 LIBS_DIRS +=
LDFLAGS +=
# Includes and library directories STATIC_LIBS +=
INCS_DIRS = -I.. DYNAMIC_LIBS +=
LIBS_DIRS =
STATIC_LIBS =
DYNAMIC_LIBS =
############
CXXFLAGS += $(INCS_DIRS) CXXFLAGS += $(INCS_DIRS)
LDFLAGS += $(LIBS_DIRS) LDFLAGS += $(LIBS_DIRS)
LDFLAGS += $(STATIC_LIBS) LDFLAGS += $(STATIC_LIBS)
@ -59,18 +32,19 @@ LDFLAGS += $(DYNAMIC_LIBS)
# SOURCE FILES # SOURCE FILES
SRCS = saxlib.cpp \ SRCS = saxlib.cpp \
helpers/InputSourceResolver.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/utf8ucs2codecvt.cpp \
../Utils/impl/iso88591_utf8.cpp \
../Utils/impl/ucs2_utf16.cpp \
../Utils/impl/ucs2_utf8.cpp \ ../Utils/impl/ucs2_utf8.cpp \
../XML/XMLCharacterClasses.cpp ../XML/XMLCharacterClasses.cpp
# ../Utils/base64codecvt.cpp \
# ../Utils/iso88591utf8codecvt.cpp \
# ../Utils/rot13codecvt.cpp \
# ../Utils/utf16beucs2codecvt.cpp \
# ../Utils/utf16leucs2codecvt.cpp \
# ../Utils/utf16utf8codecvt.cpp \
# ../Utils/utf8iso88591codecvt.cpp \
# ../Utils/impl/iso88591_utf8.cpp \
# ../Utils/impl/ucs2_utf16.cpp \
HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(SRCS))) HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(SRCS)))
OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SRCS))) OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SRCS)))

View file

@ -1,9 +1,6 @@
-include Makefile.header
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# High level rules # High level rules
all : all :
cd SAX; ${MAKE} cd SAX; ${MAKE}
cd SAX2DOM; ${MAKE} cd SAX2DOM; ${MAKE}
@ -16,8 +13,4 @@ clean :
cd SAX2DOM; ${MAKE} clean cd SAX2DOM; ${MAKE} clean
cd Utils; ${MAKE} clean cd Utils; ${MAKE} clean
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# End of File # End of File

View file

@ -1,67 +1,22 @@
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Utilities -include ../../Makefile.header
REMOVE = rm -rf ######################################
LINK = ln -sf # ADDITIONAL BUILD FLAGS
INCS_DIRS += -I../..
LIBS_DIRS += -L../../bin
# For GNU make: STATIC_LIBS +=
OS_VER := $(shell uname -s | sed -e s/\[\.\ \]/_/g) DYNAMIC_LIBS += -lArabica
# For other make (like Sun's) you can try:
# OS_VER:sh =uname -sr | sed -e s/\[\.\ \]/_/g
# C/C++ shortcuts ############
CXX = c++ CXXFLAGS += $(INCS_DIRS)
LDFLAGS += $(LIBS_DIRS)
#///////////////////////////////////////////////////////////////////////// LDFLAGS += $(STATIC_LIBS)
#////////////////////////////////////////////// LDFLAGS += $(DYNAMIC_LIBS)
# 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
endif
LDFLAGS =
CCDEPFLAGS = -E -M
# Uncomment for optimisations
CXXFLAGS += -O2
LDFLAGS += -O2
# Uncomment for debug version
# CXXFLAGS += -g -D__DEBUG__
# Includes and library directories
INCS_DIRS = -I../..
#INCS_DIRS = -I..
LIBS_DIRS = -L../../bin
STATIC_LIBS =
DYNAMIC_LIBS = -lArabica -lexpat
CXXFLAGS += ${INCS_DIRS}
LDFLAGS += ${LIBS_DIRS}
LDFLAGS += ${DYNAMIC_LIBS}
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
######################################
# SOURCE FILES
PYX_SRCS = pyx.cpp PYX_SRCS = pyx.cpp
PYX_HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(PYX_SRCS))) PYX_HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(PYX_SRCS)))
PYX_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(PYX_SRCS))) PYX_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(PYX_SRCS)))
@ -74,58 +29,31 @@ WRITER_SRCS = writer.cpp
WRITER_HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(WRITER_SRCS))) WRITER_HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(WRITER_SRCS)))
WRITER_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(WRITER_SRCS))) WRITER_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(WRITER_SRCS)))
######################################
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# High level rules # High level rules
all : pyx simple_handler writer all : pyx simple_handler writer
pyx : $(PYX_OBJS) pyx : $(PYX_OBJS)
$(LINK.cc) -o $@ $(PYX_OBJS) $(LD) $(LDFLAGS) -o $@ $(PYX_OBJS)
cp pyx ../../bin $(COPY) pyx ../../bin
simple_handler : $(SIMPLE_OBJS) simple_handler : $(SIMPLE_OBJS)
$(LINK.cc) -o $@ $(SIMPLE_OBJS) $(LD) $(LDFLAGS) -o $@ $(SIMPLE_OBJS)
cp simple_handler ../../bin $(COPY) simple_handler ../../bin
writer : $(WRITER_OBJS) writer : $(WRITER_OBJS)
$(LINK.cc) -o $@ $(WRITER_OBJS) $(LD) $(LDFLAGS) -o $@ $(WRITER_OBJS)
cp writer ../../bin $(COPY) writer ../../bin
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
######################
# Compile rules # Compile rules
####
%.o : %.cpp %.o : %.cpp
$(COMPILE.cc) -o $@ $< $(CXX) $(CXXFLAGS) -c -o $@ $<
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Dependencies
depend : .depend
.depend ::
$(COMPILE.cc) $(CCDEPFLAGS) ${PYX_SRCS} $(WRITER_SRCS) ${SIMPLE_SRCS} > .depend
-include .depend
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
######################
# Cleaning up # Cleaning up
clean : clean :
$(REMOVE) .depend *.o core pyx writer simple_handler ../../bin/pyx ../../bin/writer ../../bin/simple_handler $(REMOVE) *.o core pyx writer simple_handler ../../bin/pyx ../../bin/writer ../../bin/simple_handler
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# End of File # End of File

View file

@ -1,68 +1,22 @@
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Utilities -include ../../Makefile.header
REMOVE = rm -rf ######################################
LINK = ln -sf # ADDITIONAL BUILD FLAGS
INCS_DIRS += -I../..
LIBS_DIRS += -L../../bin
# For GNU make: STATIC_LIBS +=
OS_VER := $(shell uname -s | sed -e s/\[\.\ \]/_/g) DYNAMIC_LIBS += -lArabica
# For other make (like Sun's) you can try:
# OS_VER:sh =uname -sr | sed -e s/\[\.\ \]/_/g
# C/C++ shortcuts ############
CXX = c++ CXXFLAGS += $(INCS_DIRS)
LDFLAGS += $(LIBS_DIRS)
LDFLAGS += $(STATIC_LIBS)
LDFLAGS += $(DYNAMIC_LIBS)
#///////////////////////////////////////////////////////////////////////// ######################################
#////////////////////////////////////////////// # SOURCE FILES
# 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
endif
LDFLAGS =
CCDEPFLAGS = -E -M
# Uncomment for optimisations
CXXFLAGS += -O2
LDFLAGS += -O2 -L../../bin
# Uncomment for debug version
CXXFLAGS += -g
# Includes and library directories
INCS_DIRS = -I../..
#INCS_DIRS = -I..
LIBS_DIRS = -L../../bin
STATIC_LIBS =
DYNAMIC_LIBS = -lArabica -lstdc++
CXXFLAGS += ${INCS_DIRS}
LDFLAGS += ${LIBS_DIRS}
LDFLAGS += ${DYNAMIC_LIBS}
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# 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 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
SAXDOM_HDRS = $(patsubst %.cpp,%.h,$(SAXDOM_SRCS)) SAXDOM_HDRS = $(patsubst %.cpp,%.h,$(SAXDOM_SRCS))
SAXDOM_OBJS = $(patsubst %.cpp,%.o,$(SAXDOM_SRCS)) SAXDOM_OBJS = $(patsubst %.cpp,%.o,$(SAXDOM_SRCS))
@ -79,53 +33,27 @@ DOMWRITER_SRCS = DOMWriter.cpp
DOMWRITER_HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(DOMWRITER_SRCS))) DOMWRITER_HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(DOMWRITER_SRCS)))
DOMWRITER_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(DOMWRITER_SRCS))) DOMWRITER_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(DOMWRITER_SRCS)))
#///////////////////////////////////////////////////////////////////////// ######################################
#//////////////////////////////////////////////
# High level rules # High level rules
all : sax2dom_test domwriter all : sax2dom_test domwriter
sax2dom_test : $(SAXDOM_OBJS) $(CPPUNITFW_OBJS) $(CPPUNITUI_OBJS) sax2dom_test : $(SAXDOM_OBJS) $(CPPUNITFW_OBJS) $(CPPUNITUI_OBJS)
$(LINK.cc) -o $@ $(SAXDOM_OBJS) $(CPPUNITFW_OBJS) $(CPPUNITUI_OBJS) $(LD) $(LDFLAGS) -o $@ $(SAXDOM_OBJS) $(CPPUNITFW_OBJS) $(CPPUNITUI_OBJS)
cp sax2dom_test ../../bin $(COPY) sax2dom_test ../../bin
domwriter : $(DOMWRITER_OBJS) domwriter : $(DOMWRITER_OBJS)
$(LINK.cc) -o $@ $(DOMWRITER_OBJS) $(LD) $(LDFLAGS) -o $@ $(DOMWRITER_OBJS)
cp domwriter ../../bin $(COPY) domwriter ../../bin
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
######################
# Compile rules # Compile rules
####
%.o : %.cpp %.o : %.cpp
$(COMPILE.cc) -o $@ $< $(CXX) $(CXXFLAGS) -c -o $@ $<
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Dependencies
depend : .depend
.depend ::
$(COMPILE.cc) $(CCDEPFLAGS) $(SAXDOM_SRCS) $(CPPUNITFW_SRCS) $(CPPUNITUI_SRCS) > .depend
-include .depend
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
######################
# Cleaning up # Cleaning up
clean : clean :
$(REMOVE) .depend $(CPPUNITUI_OBJS) $(CPPUNITFW_OBJS) $(SAXDOM_OBJS) $(DOMWRITER_OBJS) core sax2dom_test domwriter ../../bin/sax2dom_test ../../bin/domwriter $(REMOVE) $(CPPUNITUI_OBJS) $(CPPUNITFW_OBJS) $(SAXDOM_OBJS) $(DOMWRITER_OBJS) core sax2dom_test domwriter ../../bin/sax2dom_test ../../bin/domwriter
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# End of File # End of File

View file

@ -1,115 +1,46 @@
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Utilities -include ../../Makefile.header
REMOVE = rm -rf ######################################
LINK = ln -sf # ADDITIONAL BUILD FLAGS
INCS_DIRS += -I../..
LIBS_DIRS += -L../../bin
# For GNU make: STATIC_LIBS +=
OS_VER := $(shell uname -s | sed -e s/\[\.\ \]/_/g) DYNAMIC_LIBS += -lArabica
# For other make (like Sun's) you can try:
# OS_VER:sh =uname -sr | sed -e s/\[\.\ \]/_/g
# C/C++ shortcuts ############
CXX = c++ CXXFLAGS += $(INCS_DIRS)
LDFLAGS += $(LIBS_DIRS)
#///////////////////////////////////////////////////////////////////////// LDFLAGS += $(STATIC_LIBS)
#////////////////////////////////////////////// LDFLAGS += $(DYNAMIC_LIBS)
# 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
endif
LDFLAGS =
CCDEPFLAGS = -E -M
# Uncomment for optimisations
CXXFLAGS += -O2
LDFLAGS += -O2
# Uncomment for debug version
# CXXFLAGS += -g
# Includes and library directories
INCS_DIRS = -I../..
#INCS_DIRS = -I..
LIBS_DIRS = -L../../bin
STATIC_LIBS =
DYNAMIC_LIBS = -lArabica
CXXFLAGS += ${INCS_DIRS}
LDFLAGS += ${LIBS_DIRS}
LDFLAGS += ${DYNAMIC_LIBS}
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
######################################
# SOURCE FILES
TRANSCODE_SRCS = transcode.cpp TRANSCODE_SRCS = transcode.cpp
TRANSCODE_HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(TRANSCODE_SRCS))) TRANSCODE_HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(TRANSCODE_SRCS)))
TRANSCODE_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(TRANSCODE_SRCS))) TRANSCODE_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(TRANSCODE_SRCS)))
#///////////////////////////////////////////////////////////////////////// ######################################
#//////////////////////////////////////////////
# High level rules # High level rules
all : transcode all : transcode
transcode : $(TRANSCODE_OBJS) transcode : $(TRANSCODE_OBJS)
$(LINK.cc) -o $@ $(TRANSCODE_OBJS) $(LD) $(LDFLAGS) -o $@ $(TRANSCODE_OBJS)
cp transcode ../../bin $(COPY) transcode ../../bin
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
######################
# Compile rules # Compile rules
####
%.o : %.cpp %.o : %.cpp
$(COMPILE.cc) -o $@ $< $(CXX) $(CXXFLAGS) -c -o $@ $<
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# Dependencies
depend : .depend
.depend ::
$(COMPILE.cc) $(CCDEPFLAGS) ${PYX_SRCS} $(WRITER_SRCS) ${SIMPLE_SRCS} > .depend
-include .depend
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
######################
# Cleaning up # Cleaning up
clean : clean :
$(REMOVE) .depend *.o core transcode ../../bin/transcode $(REMOVE) $(TRANSCODE_OBJS) core transcode ../../bin/transcode
#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////
# End of File # End of File