diff --git a/alib2/makefile b/alib2/makefile index 819b1046f9ad363102d10c9da31251a462ba7732..4ddb917b0cd72cce85d09a47f081f8156958bb17 100644 --- a/alib2/makefile +++ b/alib2/makefile @@ -12,7 +12,10 @@ OBJECTS=$(patsubst src/%.cpp, obj/%.o, $(SOURCES)) TEST_SOURCES=$(shell find test-src/ -name *cpp) TEST_OBJECTS=$(patsubst test-src/%.cpp, test-obj/%.o, $(TEST_SOURCES)) -all: lib/$(LIBRARY) test-bin/$(TESTBIN) test +.PHONY: all +.PHONY: test + +all: build test lib/$(LIBRARY): $(OBJECTS) mkdir -p lib @@ -22,6 +25,8 @@ obj/%.o: src/%.cpp mkdir -p $(dir $@) $(CC) $(CCFLAGS) $< -o $@ +build: lib/$(LIBRARY) + test-bin/$(TESTBIN): $(TEST_OBJECTS) lib/$(LIBRARY) mkdir -p test-bin $(CC) $(TEST_OBJECTS) -o $@ $(TEST_LDFLAGS) diff --git a/alib2/src/AlibException.cpp b/alib2/src/AlibException.cpp index b347cffdaeb627ee1954a370fc5fc35be7fdf0a5..51da97bbfb83298449089c41e03cc6bc30dc1fd5 100644 --- a/alib2/src/AlibException.cpp +++ b/alib2/src/AlibException.cpp @@ -1,34 +1,32 @@ /* * AlibException.cpp * - * Created on: Apr 1, 2013 - * Author: Martin Zak + * Created on: Apr 1, 2013 + * Author: Martin Zak */ #include "AlibException.h" namespace alib { -AlibException::AlibException() { +AlibException::AlibException ( ) { } -AlibException::AlibException(const std::string& cause) { +AlibException::AlibException ( const std::string & cause ) { this->cause = cause; } -AlibException::~AlibException() throw () { +AlibException::~AlibException ( ) { } -const char* AlibException::what() const throw() { - return cause.c_str(); +const char * AlibException::what ( ) const noexcept { + return cause.c_str ( ); } -const std::string& AlibException::getCause() const { +const std::string & AlibException::getCause ( ) const { return cause; } } /* namespace alib */ - - diff --git a/alib2/src/AlibException.h b/alib2/src/AlibException.h index 5cef527fd5d039cd34d6d03609a599e4aacf48dc..e8aaa61046c3693755b404cade23978330ec8a32 100644 --- a/alib2/src/AlibException.h +++ b/alib2/src/AlibException.h @@ -1,8 +1,8 @@ /* * AlibException.h * - * Created on: Apr 1, 2013 - * Author: Martin Zak + * Created on: Apr 1, 2013 + * Author: Martin Zak */ #ifndef ALIB_EXCEPTION_H_ @@ -19,21 +19,24 @@ namespace alib { */ class AlibException : public std::exception { protected: + std::string cause; public: - AlibException(); - AlibException(const std::string& cause); - virtual ~AlibException() throw (); + + AlibException ( ); + AlibException ( const std::string & cause ); + virtual ~AlibException ( ); /** * @return reason why the exception occured */ - const char* what() const throw (); + const char * what ( ) const noexcept; /** * @return reason why the exception occured */ - const std::string& getCause() const; + const std::string & getCause ( ) const; + }; } /* namespace alib */