From 87d2d065d3b82e21b4196fab7eb378af435e2cb0 Mon Sep 17 00:00:00 2001 From: Charles Mita Date: Mon, 13 Aug 2018 13:15:45 +0100 Subject: [PATCH] Add Fortran test framework to Makefile --- .gitignore | 1 + Makefile | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0336de6..9b7dd22 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ build/ *.o +*.mod *.so diff --git a/Makefile b/Makefile index 07abb3a..9222a9a 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ BUILD_DIR ?= ./build SRC_DIR = ./src +TEST_DIR = ./test INC_DIR = $(SRC_DIR) CC=h5cc CFLAGS=-Wall -g -O2 -fpic -I$(INC_DIR) .PHONY: all -all: plugin example +all: plugin example test_plugin .PHONY: plugin plugin: $(BUILD_DIR)/durin-plugin.so @@ -14,6 +15,13 @@ plugin: $(BUILD_DIR)/durin-plugin.so .PHONY: example example: $(BUILD_DIR)/example +.PHONY: test_plugin +test_plugin: $(BUILD_DIR)/test_plugin + +$(BUILD_DIR)/test_plugin: $(TEST_DIR)/generic_data_plugin.f90 $(TEST_DIR)/test_generic_host.f90 + mkdir -p $(BUILD_DIR) + gfortran -O -g -fopenmp -ldl $(TEST_DIR)/generic_data_plugin.f90 $(TEST_DIR)/test_generic_host.f90 -o $@ -J$(BUILD_DIR) + $(BUILD_DIR)/%.o: $(SRC_DIR)/%.c mkdir -p $(BUILD_DIR) $(CC) $(CFLAGS) -c $< -o $@