From 10f61f1285190986498221cfa82b2d3b9fe9f391 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 21 Sep 2016 12:56:11 -0600 Subject: Accumulated changes. --- c++-libbu++/Makefile | 21 +++++++++++++++++++++ c++-libbu++/src/boolean.cpp | 1 + c++-libbu++/src/gatsc/main.cpp | 11 ++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 c++-libbu++/Makefile (limited to 'c++-libbu++') diff --git a/c++-libbu++/Makefile b/c++-libbu++/Makefile new file mode 100644 index 0000000..5ff9292 --- /dev/null +++ b/c++-libbu++/Makefile @@ -0,0 +1,21 @@ +OBJECTS := $(patsubst %.cpp,%.o,$(wildcard src/*.cpp)) + +.PHONY: default all headers clean tests install + +default: libgats.a + +all: default tests + +clean: + -rm ${HEADERS} ${OBJECTS} libgats.a ${TOOLS} ${UNITS} ${TESTS} + +$(foreach fn,$(wildcard src/*.h),bu/$(notdir ${fn})): bu/%: src/% + ln -s ../$< $@ + +${OBJECTS}: %.o: %.cpp + ${CXX} -ggdb -W -Wall -I. -I../../libbu++ ${CXXFLAGS} $< -c -o $@ + +libgats.a: ${HEADERS} ${OBJECTS} + ar -r libgats.a ${OBJECTS} + + diff --git a/c++-libbu++/src/boolean.cpp b/c++-libbu++/src/boolean.cpp index 2ee0227..e442c2c 100644 --- a/c++-libbu++/src/boolean.cpp +++ b/c++-libbu++/src/boolean.cpp @@ -8,6 +8,7 @@ #include "gats/boolean.h" #include +#include #include Gats::Boolean::Boolean() : diff --git a/c++-libbu++/src/gatsc/main.cpp b/c++-libbu++/src/gatsc/main.cpp index 5291a33..c95b914 100644 --- a/c++-libbu++/src/gatsc/main.cpp +++ b/c++-libbu++/src/gatsc/main.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "gats/types.h" #include "gats/gatsstream.h" @@ -22,7 +23,8 @@ class Options : public OptParser public: Options( int argc, char *argv[] ) : bCompile( true ), - bCompress( false ) + bCompress( false ), + bHex( false ) { addHelpBanner("Gats Compiler\nUsage: gatsc [options] [input]\n"); @@ -33,6 +35,7 @@ public: "Convert binary gats to text gats."); addOption( bCompress, 'z', "compress", "Compress with deflate."); + addOption( bHex, 'x', "hex", "Encode output as hex."); addHelpOption('h', "help", "This Help"); @@ -40,6 +43,7 @@ public: setOverride("decompile", false ); setOverride("compress", true ); + setOverride("hex", true ); parse( argc, argv ); } @@ -52,6 +56,7 @@ public: bool bCompile; bool bCompress; + bool bHex; String sInput; String sOutput; }; @@ -83,6 +88,10 @@ int main( int argc, char *argv[] ) { ssOut.pushFilter(); } + if( opt.bHex ) + { + ssOut.pushFilter(); + } Gats::GatsStream gs( ssOut ); Gats::Object *pObj = Gats::Object::strToGats( fIn.readAll() ); gs.writeObject( pObj ); -- cgit v1.2.3