Prepare code for publication

This commit is contained in:
Jonas Kellerer
2022-11-11 13:48:04 +01:00
parent 71dc3f4ada
commit b7a65dd8fe
25 changed files with 2030 additions and 731 deletions
+1 -35
View File
@@ -53,14 +53,10 @@ ifeq ($(DO_DEBUGGING),true)
CXXFLAGS += -Ddebug_level$(DEBUG_LEVEL)
endif
# Catch2
CXXFLAGS += $(CATCH_INCLUDES)
ifeq ($(USE_TIMER),true)
CXXFLAGS += -DTIMER
endif
CXXFLAGS_TEST = $(CXXFLAGS)
# Sources
SRC_SUBDIRS = $(foreach sdir, $(SUB_DIRS), $(wildcard $(sdir)/*.cpp))
@@ -68,20 +64,16 @@ SRC_SUBDIRS = $(foreach sdir, $(SUB_DIRS), $(wildcard $(sdir)/*.cpp))
SOURCES = $(SRC_DIR)/main.cpp
SOURCES += $(SRC_SUBDIRS)
SOURCES_TEST = $(wildcard $(TEST_DIR)/*.cpp) $(SRC_SUBDIRS)
# Objects
OBJECTS=$(addprefix $(BUILD_DIR)/, $(notdir $(SOURCES:.cpp=.o)) )
OBJECTS_TEST=$(addprefix $(BUILD_DIR)/, $(notdir $(SOURCES_TEST:.cpp=.o)) )
# Target
# put the exe file in bin/
TARGET=$(BIN_DIR)/karl
TARGET_TEST=$(BIN_DIR)/karl_test
# Compile logic
all: blitz hdf5 jansson karl
all: karl
check_homebase:
ifeq ($(HOMEBASE),)
@@ -96,25 +88,8 @@ ifneq ($(IS_ABSPATH), yes)
@exit 1
endif
blitz: check_homebase
ifeq ($(MAKE_BLITZ), true)
$(MAKE) -C external/blitz
$(MAKE) -C external/blitz install
endif
hdf5: check_homebase
ifeq ($(MAKE_H5), true)
$(MAKE) -C external/h5
endif
jansson: check_homebase
ifeq ($(MAKE_JANSSON), true)
$(MAKE) -C external/jansson
endif
karl: check_abspath check_homebase $(TARGET)
test: check_abspath check_homebase $(TARGET_TEST)
$(TARGET): $(BUILD_DIR) $(BIN_DIR) $(OBJECTS)
$(CXX) $(OBJECTS) $(LIBS) -o $(TARGET)
@@ -122,12 +97,6 @@ $(TARGET): $(BUILD_DIR) $(BIN_DIR) $(OBJECTS)
@echo "Linking done"
@echo
$(TARGET_TEST): $(BUILD_DIR) $(BIN_DIR) $(OBJECTS_TEST)
@echo "Start linking"
$(CXX) $(OBJECTS_TEST) $(LIBS) -o $(TARGET_TEST)
@echo
@echo "Linking done"
@echo
$(BIN_DIR):
@mkdir -p $(BIN_DIR)
@@ -176,9 +145,6 @@ $(BUILD_DIR)/%.o : $(SRC_DIR)/tools/%.cpp
@echo
$(CXX) $(CXXFLAGS) $< -c -o $@
$(BUILD_DIR)/%.o : $(TEST_DIR)/%.cpp
@echo "Create $@ from $<"
$(CXX) $(CXXFLAGS_TEST) $< -c -o $@
# All build instructions for all src cpp are put here
$(BUILD_DIR)/main.o : $(SRC_DIR)/main.cpp