added: namespace PT, global Makefile file

git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@374 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2012-01-12 02:46:16 +00:00
parent f2ba48a10e
commit d0ffdd336c
16 changed files with 165 additions and 89 deletions

39
Makefile Executable file
View File

@ -0,0 +1,39 @@
# Makefile for GNU make
ifndef CXX
CXX = g++
endif
ifndef CXXFLAGS
CXXFLAGS = -Wall -pedantic -O2 -I/usr/local/include -I.. -L/usr/local/lib
endif
export CXX
export CXXFLAGS
all: confparser mainparser utf8
confparser: FORCE
@cd confparser ; $(MAKE) -e
mainparser: FORCE
@cd mainparser ; $(MAKE) -e
utf8: FORCE
@cd utf8 ; $(MAKE) -e
FORCE:
clean:
@cd confparser ; $(MAKE) -e clean
@cd mainparser ; $(MAKE) -e clean
@cd utf8 ; $(MAKE) -e clean
depend:
@cd confparser ; $(MAKE) -e depend
@cd mainparser ; $(MAKE) -e depend
@cd utf8 ; $(MAKE) -e depend

View File

@ -8,9 +8,7 @@ $(libname): $(o)
ar rcs $(libname) $(o)
.SUFFIXES: .cpp .o
.cpp.o:
%.o: %.cpp
$(CXX) -c $(CXXFLAGS) $<

View File

@ -1,4 +1,4 @@
# DO NOT DELETE
confparser.o: confparser.h ../utf8/utf8.h
space.o: confparser.h ../utf8/utf8.h
confparser.o: confparser.h space.h ../utf8/utf8.h
space.o: space.h ../utf8/utf8.h

View File

@ -1,5 +1,5 @@
/*
* This file is a part of PicoTools
* This file is a part of PikoTools
* and is distributed under the (new) BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/

View File

@ -1,5 +1,5 @@
/*
* This file is a part of PicoTools
* This file is a part of PikoTools
* and is distributed under the (new) BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
@ -39,10 +39,6 @@
#define headerfile_picotools_confparser_confparser
#include <fstream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include "space.h"

View File

@ -1,5 +1,5 @@
/*
* This file is a part of PicoTools
* This file is a part of PikoTools
* and is distributed under the (new) BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
@ -35,9 +35,9 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cstdlib>
//#include <cstdlib>
#include <wchar.h>
#include "confparser.h"
#include "space.h"
#include "utf8/utf8.h"

View File

@ -1,5 +1,5 @@
/*
* This file is a part of PicoTools
* This file is a part of PikoTools
* and is distributed under the (new) BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
@ -38,10 +38,8 @@
#ifndef headerfile_picotools_confparser_space
#define headerfile_picotools_confparser_space
#include <fstream>
#include <string>
#include <vector>
#include <list>
#include <map>

View File

@ -8,15 +8,13 @@ $(libname): $(o)
ar rcs $(libname) $(o)
.SUFFIXES: .cpp .o
.cpp.o:
%.o: %.cpp
$(CXX) -c $(CXXFLAGS) $<
depend:
makedepend $(CXXFLAGS) -Y. -f- *.cpp > Makefile.dep
makedepend -Y. -I.. -f- *.cpp > Makefile.dep
echo -n "o = " > Makefile.o.dep
ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep

View File

@ -1,11 +1,11 @@
/*
* This file is a part of MainParser -- simple parser for main() parameters
* This file is a part of PikoTools
* and is distributed under the (new) BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2011, Tomasz Sowa
* Copyright (c) 2011-2012, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -40,6 +40,9 @@
#include <string.h>
namespace PT
{
MainParser::MainParser()
{
@ -227,3 +230,8 @@ bool was_incremented = false;
return was_incremented;
}
} // namespace

View File

@ -1,11 +1,11 @@
/*
* This file is a part of MainParser -- simple parser for main() parameters
* This file is a part of PikoTools
* and is distributed under the (new) BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2011, Tomasz Sowa
* Copyright (c) 2011-2012, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -35,8 +35,12 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef headerfile_mainparser_mainparser
#define headerfile_mainparser_mainparser
#ifndef headerfile_picotools_mainparser_mainparser
#define headerfile_picotools_mainparser_mainparser
namespace PT
{
/*
@ -121,4 +125,8 @@ private:
const char * last_double_param;
};
} // namespace
#endif

27
utf8/Makefile Executable file
View File

@ -0,0 +1,27 @@
include Makefile.o.dep
libname=utf8.a
all: $(libname)
$(libname): $(o)
ar rcs $(libname) $(o)
%.o: %.cpp
$(CXX) -c $(CXXFLAGS) $<
depend:
makedepend -Y. -I.. -f- *.cpp > Makefile.dep
echo -n "o = " > Makefile.o.dep
ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep
clean:
rm -f *.o
rm -f $(libname)
include Makefile.dep

3
utf8/Makefile.dep Executable file
View File

@ -0,0 +1,3 @@
# DO NOT DELETE
utf8.o: utf8.h

1
utf8/Makefile.o.dep Executable file
View File

@ -0,0 +1 @@
o = utf8.o

View File

@ -1,11 +1,11 @@
/*
* This file is a part of EZC -- Easy templating in C++
* This file is a part of PikoTools
* and is distributed under the (new) BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2010-2011, Tomasz Sowa
* Copyright (c) 2010-2012, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -38,7 +38,7 @@
#include "utf8.h"
namespace Ezc
namespace PT
{
@ -890,7 +890,7 @@ bool WideToUTF8(const std::wstring & wide_string, std::ostream & utf8, int mode)
} // namespace Ezc
} // namespace

View File

@ -1,11 +1,11 @@
/*
* This file is a part of EZC -- Easy templating in C++
* This file is a part of PikoTools
* and is distributed under the (new) BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2010-2011, Tomasz Sowa
* Copyright (c) 2010-2012, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -35,14 +35,14 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef headerfile_ezc_utf8
#define headerfile_ezc_utf8
#ifndef headerfile_picotools_utf8_utf8
#define headerfile_picotools_utf8_utf8
#include <fstream>
#include <string>
namespace Ezc
namespace PT
{
/*!
@ -104,7 +104,7 @@ bool WideToUTF8(const std::wstring & wide_string, std::ostream & u
} // namespace Ezc
} // namespace
#endif