From b54979aa74578034be69be4a58429810e6e635ff Mon Sep 17 00:00:00 2001 From: Mario Fink Date: Tue, 11 Jul 2023 13:41:34 +0200 Subject: [PATCH] restructure includes and headers --- lib/{ => 3rdparty}/half.hpp | 0 lib/{ => 3rdparty}/half_precision_floating_point.hpp | 0 makefile | 9 ++++++--- 3 files changed, 6 insertions(+), 3 deletions(-) rename lib/{ => 3rdparty}/half.hpp (100%) rename lib/{ => 3rdparty}/half_precision_floating_point.hpp (100%) diff --git a/lib/half.hpp b/lib/3rdparty/half.hpp similarity index 100% rename from lib/half.hpp rename to lib/3rdparty/half.hpp diff --git a/lib/half_precision_floating_point.hpp b/lib/3rdparty/half_precision_floating_point.hpp similarity index 100% rename from lib/half_precision_floating_point.hpp rename to lib/3rdparty/half_precision_floating_point.hpp diff --git a/makefile b/makefile index b53cc2b..72d8cdd 100644 --- a/makefile +++ b/makefile @@ -10,8 +10,11 @@ SRC = src/ LIB = lib/ PYT = python/ -# list headers +# list headers and include directories HPP = $(wildcard $(LIB)/*.hpp) +IPP = $(shell find $(LIB) -type f -name '*.hpp') +KIB = $(shell find $(LIB) -type d) +MIB = $(foreach dir,$(KIB),-I $(dir)) # choose compiler and its options CC = g++ -std=c++17 @@ -36,12 +39,12 @@ $(EXE): check-tags $(GVSN) main.o $(CC) $(OPT) main.o -o $@ # build main.cpp and include git version/commit tag -main.o: src/main.cpp $(HPP) +main.o: src/main.cpp $(IPP) @cp $< $<.cpp @sed -i 's/TAGSTRING/$(GTAG)/g' $<.cpp @sed -i 's/HASHSTRING/$(GHSH)/g' $<.cpp @sed -i 's/TIMESTAMPSTRING/$(TMS)/g' $<.cpp - $(CC) -c $(OPT) -I $(LIB) $<.cpp -o $@ + $(CC) -c $(OPT) $(MIB) $<.cpp -o $@ @rm $<.cpp install: $(EXE)