diff --git a/Arabica.sln b/Arabica.sln index 17d87095..e5723f76 100644 --- a/Arabica.sln +++ b/Arabica.sln @@ -1,8 +1,4 @@ Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DOM", "DOM\DOM.vcproj", "{AFD0FD18-3D55-4CEC-A242-EA290EBBF171}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_SAX2DOMTests", "EXAMPLES\SAX2DOM\SAX2DOM_test.vcproj", "{E5157BA4-96A1-4D7F-B895-8C9A32F26BB5}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ArabicaLib", "SAX\SAX.vcproj", "{884490E3-E4B3-43BE-A88B-7FA9EA4E16AB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_SAXSimpleHandler", "examples\SAX\SimpleHandler.vcproj", "{16475ED0-2906-429B-9E73-F2BF2929F6E9}" @@ -21,7 +17,6 @@ Global ConfigName.1 = Release EndGlobalSection GlobalSection(ProjectDependencies) = postSolution - {E5157BA4-96A1-4D7F-B895-8C9A32F26BB5}.0 = {884490E3-E4B3-43BE-A88B-7FA9EA4E16AB} {16475ED0-2906-429B-9E73-F2BF2929F6E9}.0 = {884490E3-E4B3-43BE-A88B-7FA9EA4E16AB} {3C6CBC24-07D4-4DE8-A1DF-592C3BC77C56}.0 = {884490E3-E4B3-43BE-A88B-7FA9EA4E16AB} {AE33D6D1-0F57-4E97-90AE-696854C5AE71}.0 = {884490E3-E4B3-43BE-A88B-7FA9EA4E16AB} @@ -29,14 +24,6 @@ Global {436B423B-BF20-4B2E-A187-604AF391FBE2}.0 = {884490E3-E4B3-43BE-A88B-7FA9EA4E16AB} EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution - {AFD0FD18-3D55-4CEC-A242-EA290EBBF171}.Debug.ActiveCfg = Debug|Win32 - {AFD0FD18-3D55-4CEC-A242-EA290EBBF171}.Debug.Build.0 = Debug|Win32 - {AFD0FD18-3D55-4CEC-A242-EA290EBBF171}.Release.ActiveCfg = Release|Win32 - {AFD0FD18-3D55-4CEC-A242-EA290EBBF171}.Release.Build.0 = Release|Win32 - {E5157BA4-96A1-4D7F-B895-8C9A32F26BB5}.Debug.ActiveCfg = Debug|Win32 - {E5157BA4-96A1-4D7F-B895-8C9A32F26BB5}.Debug.Build.0 = Debug|Win32 - {E5157BA4-96A1-4D7F-B895-8C9A32F26BB5}.Release.ActiveCfg = Release|Win32 - {E5157BA4-96A1-4D7F-B895-8C9A32F26BB5}.Release.Build.0 = Release|Win32 {884490E3-E4B3-43BE-A88B-7FA9EA4E16AB}.Debug.ActiveCfg = Debug|Win32 {884490E3-E4B3-43BE-A88B-7FA9EA4E16AB}.Debug.Build.0 = Debug|Win32 {884490E3-E4B3-43BE-A88B-7FA9EA4E16AB}.Release.ActiveCfg = Release|Win32 diff --git a/Makefile.header b/Makefile.header index 1be7038a..0220524d 100644 --- a/Makefile.header +++ b/Makefile.header @@ -1,7 +1,7 @@ #################################### # ARABICA CONFIG # edit for your parser choice - may include more than one USE_* -PARSER_CONFIG = -DUSE_EXPAT +PARSER_CONFIG = -DUSE_EXPAT -DARABICA_NO_WCHAR_T #PARSER_CONFIG = -DUSE_EXPAT -DUSE_LIBXML2 -DUSE_XERCES -DUSE_GARDEN #################################### @@ -13,7 +13,7 @@ CXX = gcc # preprocessor CPP = gcc -E # linker -LD = gcc +LD = gcc # archiver AR = ar r @@ -39,6 +39,9 @@ LIBS_DIRS = STATIC_LIBS = DYNAMIC_LIBS = -lexpat -lstdc++ +# you'll only need to change these if you use Cygwin +EXESUFFIX = .exe +LIBSUFFIX = .dll diff --git a/Makefile.rules b/Makefile.rules new file mode 100644 index 00000000..4d22daa3 --- /dev/null +++ b/Makefile.rules @@ -0,0 +1,5 @@ +########################################## +# Basic rules +%.o : %.cpp + $(CXX) $(CXXFLAGS) $(INCS_DIRS) -c -o $@ $< + diff --git a/SAX/Makefile b/SAX/Makefile index 592cc4ba..82325050 100644 --- a/SAX/Makefile +++ b/SAX/Makefile @@ -13,8 +13,8 @@ ###################################### # ADDITIONAL BUILD FLAGS -CXXFLAGS += -LDFLAGS += -shared +CXXFLAGS += -I.. +LDFLAGS += -shared INC_DIRS += LIBS_DIRS += @@ -22,12 +22,6 @@ LIBS_DIRS += STATIC_LIBS += DYNAMIC_LIBS += -############ -CXXFLAGS += $(INCS_DIRS) -LDFLAGS += $(LIBS_DIRS) -LDFLAGS += $(STATIC_LIBS) -LDFLAGS += $(DYNAMIC_LIBS) - ###################################### # SOURCE FILES SRCS = saxlib.cpp \ @@ -45,26 +39,16 @@ SRCS = saxlib.cpp \ ../Utils/base64codecvt.cpp \ ../XML/XMLCharacterClasses.cpp - - - - - HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(SRCS))) OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SRCS))) ########################## # High level rules -all : libArabica.so.1 libArabica.a +all : libArabica($LIBSUFFIX) -libArabica.so.1 : $(OBJS) - $(LD) $(LDFLAGS) -o $@ $(OBJS) - $(COPY) libArabica.so.1 ../bin - (cd ../bin; $(REMOVE) libArabica.so; $(LINK) libArabica.so.1 libArabica.so) - -libArabica.a : $(OBJS) - $(AR) $@ $(OBJS) - $(COPY) libArabica.a ../bin +libArabica($LIBSUFFIX) : $(OBJS) + $(LD) $(LDFLAGS) -o libArabica$(LIBSUFFIX) $(OBJS) $(LIBS_DIRS) $(STATIC_LIBS) $(DYNAMIC_LIBS) + $(COPY) libArabica$(LIBSUFFIX) ../bin ###################### # Compile rules @@ -80,11 +64,12 @@ ParserConfig.h : Makefile ArabicaConfig.h : Makefile $(CPP) $(PARSER_CONFIG) -o ArabicaConfig.h ArabicaConfig.S -%.o : %.cpp - $(CXX) $(CXXFLAGS) -c -o $@ $< - %.cpp : ArabicaConfig.h ParserConfig.h +Makefile : + +-include ../Makefile.rules + ############################################# # Cleaning up clean : diff --git a/examples/SAX/Makefile b/examples/SAX/Makefile index 48b1765c..429f0c1c 100644 --- a/examples/SAX/Makefile +++ b/examples/SAX/Makefile @@ -9,12 +9,6 @@ LIBS_DIRS += -L../../bin STATIC_LIBS += DYNAMIC_LIBS += -lArabica -############ -CXXFLAGS += $(INCS_DIRS) -LDFLAGS += $(LIBS_DIRS) -LDFLAGS += $(STATIC_LIBS) -LDFLAGS += $(DYNAMIC_LIBS) - ###################################### # SOURCE FILES PYX_SRCS = pyx.cpp @@ -33,27 +27,33 @@ WRITER_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(WRITER_SRCS))) # High level rules all : pyx simple_handler writer -pyx : $(PYX_OBJS) - $(LD) $(LDFLAGS) -o $@ $(PYX_OBJS) - $(COPY) pyx ../../bin +pyx$ : $(PYX_OBJS) + $(LD) $(LDFLAGS) -o $@ $(PYX_OBJS) $(LIBS_DIRS) $(STATIC_LIBS) $(DYNAMIC_LIBS) + $(COPY) pyx$(EXESUFFIX) ../../bin simple_handler : $(SIMPLE_OBJS) - $(LD) $(LDFLAGS) -o $@ $(SIMPLE_OBJS) - $(COPY) simple_handler ../../bin + $(LD) $(LDFLAGS) -o $@ $(SIMPLE_OBJS) $(LIBS_DIRS) $(STATIC_LIBS) $(DYNAMIC_LIBS) + $(COPY) simple_handler$(EXESUFFIX) ../../bin writer : $(WRITER_OBJS) - $(LD) $(LDFLAGS) -o $@ $(WRITER_OBJS) - $(COPY) writer ../../bin + $(LD) $(LDFLAGS) -o $@ $(WRITER_OBJS) $(LIBS_DIRS) $(STATIC_LIBS) $(DYNAMIC_LIBS) + $(COPY) writer$(EXESUFFIX) ../../bin ###################### # Compile rules #### -%.o : %.cpp - $(CXX) $(CXXFLAGS) -c -o $@ $< +-include ../../Makefile.rules ###################### # Cleaning up clean : - $(REMOVE) *.o core pyx writer simple_handler ../../bin/pyx ../../bin/writer ../../bin/simple_handler + $(REMOVE) *.o \ + core \ + pyx$(EXESUFFIX) \ + ../../bin/pyx$(EXESUFFIX) \ + writer$(EXESUFFIX) \ + ../../bin/writer$(EXESUFFIX) \ + simple_handler$(EXESUFFIX) \ + ../../bin/simple_handler$(EXESUFFIX) # End of File diff --git a/examples/SAX/writer.cpp b/examples/SAX/writer.cpp index ecf2bebe..5ea22257 100644 --- a/examples/SAX/writer.cpp +++ b/examples/SAX/writer.cpp @@ -41,19 +41,6 @@ int main(int argc, char* argv[]) } // for ... } - - { // wide - SAX::XMLReader parser; - SAX::wWriter writer(std::wcout); - writer.setParent(parser); - - SAX::wInputSource is; - is.setSystemId(L"stdin"); - is.setByteStream(std::cin); - - writer.parse(is); - } - return 0; } // main diff --git a/examples/SAX2DOM/Makefile b/examples/SAX2DOM/Makefile index b012b9c9..8ad2ef77 100644 --- a/examples/SAX2DOM/Makefile +++ b/examples/SAX2DOM/Makefile @@ -9,12 +9,6 @@ LIBS_DIRS += -L../../bin STATIC_LIBS += DYNAMIC_LIBS += -lArabica -############ -CXXFLAGS += $(INCS_DIRS) -LDFLAGS += $(LIBS_DIRS) -LDFLAGS += $(STATIC_LIBS) -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 @@ -38,22 +32,28 @@ DOMWRITER_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(DOMWRITER_SRCS))) all : sax2dom_test domwriter sax2dom_test : $(SAXDOM_OBJS) $(CPPUNITFW_OBJS) $(CPPUNITUI_OBJS) - $(LD) $(LDFLAGS) -o $@ $(SAXDOM_OBJS) $(CPPUNITFW_OBJS) $(CPPUNITUI_OBJS) - $(COPY) sax2dom_test ../../bin + $(LD) $(LDFLAGS) -o $@ $(SAXDOM_OBJS) $(CPPUNITFW_OBJS) $(CPPUNITUI_OBJS) $(LIBS_DIRS) $(STATIC_LIBS) $(DYNAMIC_LIBS) + $(COPY) sax2dom_test$(EXESUFFIX) ../../bin domwriter : $(DOMWRITER_OBJS) - $(LD) $(LDFLAGS) -o $@ $(DOMWRITER_OBJS) - $(COPY) domwriter ../../bin + $(LD) $(LDFLAGS) -o $@ $(DOMWRITER_OBJS) $(LIBS_DIRS) $(STATIC_LIBS) $(DYNAMIC_LIBS) + $(COPY) domwriter$(EXESUFFIX) ../../bin ###################### # Compile rules #### -%.o : %.cpp - $(CXX) $(CXXFLAGS) -c -o $@ $< +-include ../../Makefile.rules ###################### # Cleaning up clean : - $(REMOVE) $(CPPUNITUI_OBJS) $(CPPUNITFW_OBJS) $(SAXDOM_OBJS) $(DOMWRITER_OBJS) core sax2dom_test domwriter ../../bin/sax2dom_test ../../bin/domwriter + $(REMOVE) $(CPPUNITUI_OBJS) \ + $(CPPUNITFW_OBJS) \ + $(SAXDOM_OBJS) \ + sax2dom_test$(EXESUFFIX) \ + ../../bin/sax2dom_test$(EXESUFFIX) \ + $(DOMWRITER_OBJS) \ + domwriter$(EXESUFFIX) \ + ../../bin/domwriter # End of File diff --git a/examples/Utils/Makefile b/examples/Utils/Makefile index 71ba2686..1dddb9d1 100644 --- a/examples/Utils/Makefile +++ b/examples/Utils/Makefile @@ -9,12 +9,6 @@ LIBS_DIRS += -L../../bin STATIC_LIBS += DYNAMIC_LIBS += -lArabica -############ -CXXFLAGS += $(INCS_DIRS) -LDFLAGS += $(LIBS_DIRS) -LDFLAGS += $(STATIC_LIBS) -LDFLAGS += $(DYNAMIC_LIBS) - ###################################### # SOURCE FILES TRANSCODE_SRCS = transcode.cpp @@ -26,21 +20,22 @@ TRANSCODE_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(TRANSCODE_SRCS))) all : transcode transcode : $(TRANSCODE_OBJS) - $(LD) $(LDFLAGS) -o $@ $(TRANSCODE_OBJS) - $(COPY) transcode ../../bin + $(LD) $(LDFLAGS) -o $@ $(TRANSCODE_OBJS) $(LIBS_DIRS) $(STATIC_LIBS) $(DYNAMIC_LIBS) + $(COPY) transcode$(EXESUFFIX) ../../bin ###################### # Compile rules #### -%.o : %.cpp - $(CXX) $(CXXFLAGS) -c -o $@ $< +-include ../../Makefile.rules ###################### # Cleaning up clean : - $(REMOVE) $(TRANSCODE_OBJS) core transcode ../../bin/transcode + $(REMOVE) $(TRANSCODE_OBJS) \ + transcode$(EXESUFFIX) \ + ../../bin/transcode$(EXESUFFIX) # End of File diff --git a/examples/Utils/transcode.cpp b/examples/Utils/transcode.cpp index 6dbb8272..8a505301 100644 --- a/examples/Utils/transcode.cpp +++ b/examples/Utils/transcode.cpp @@ -17,7 +17,7 @@ int main(int argc, const char* argv[]) oconvert_adaptor oa(std::cout); ia.imbue(std::locale(ia.getloc(), new base64codecvt())); - + //oa.imbue(std::locale(oa.getloc(), new base64codecvt())); while(ia) { oa << static_cast(ia.get());