From 90253f819a508744dab7f73ad54815d643f86cb5 Mon Sep 17 00:00:00 2001 From: Mario Fink Date: Fri, 22 Jan 2021 12:24:55 +0100 Subject: [PATCH] virtual destructor for tdmdatatype, makefile: compile on Darwin --- lib/tdm_datatype.hpp | 1 + makefile | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/tdm_datatype.hpp b/lib/tdm_datatype.hpp index a4bb3ee..21b11bc 100644 --- a/lib/tdm_datatype.hpp +++ b/lib/tdm_datatype.hpp @@ -41,6 +41,7 @@ public: tdmdatatype(): sint16_(0), sint32_(0), uint8_(0), uint16_(0), uint32_(0), float32_(0.0), float64_(0.0) {}; + virtual ~tdmdatatype() = default; friend std::ostream& operator<<(std::ostream& out, const tdmdatatype& num) { return num.print(out); diff --git a/makefile b/makefile index 59b04bc..f5d6023 100644 --- a/makefile +++ b/makefile @@ -22,6 +22,9 @@ GHSH := $(shell git rev-parse HEAD | head -c8) # define install location INST := /usr/local/bin +# platform +OST := $(shell uname) + # --------------------------------------------------------------------------- # # CLI tool @@ -37,8 +40,14 @@ uninstall : $(INST)/$(EXE) # build main.cpp object file and include git version/commit tag main.o : src/main.cpp lib/$(SRC).hpp lib/tdm_datamodel.hpp @cp $< $<.cpp - @sed -i 's/TAGSTRING/$(GTAG)/g' $<.cpp - @sed -i 's/HASHSTRING/$(GHSH)/g' $<.cpp + @if [ $(OST) = "Linux" ]; then\ + sed -i 's/TAGSTRING/$(GTAG)/g' $<.cpp; \ + sed -i 's/HASHSTRING/$(GHSH)/g' $<.cpp; \ + fi + @if [ $(OST) = "Darwin" ]; then\ + sed -i '' 's/TAGSTRING/$(GTAG)/g' $<.cpp; \ + sed -i '' 's/HASHSTRING/$(GHSH)/g' $<.cpp; \ + fi $(CC) -c $(OPT) -I $(LIB) -I lib/ $<.cpp -o $@ @rm $<.cpp @@ -46,7 +55,7 @@ $(SRC).o : lib/$(SRC).cpp lib/$(SRC).hpp lib/tdm_datamodel.hpp $(CC) -c $(OPT) -I $(LIB) $< -o $@ clean : - rm -f $(EXE) *.o + rm -f $(EXE) *.o src/main.cpp.cpp # --------------------------------------------------------------------------- # # check process