Add Fortran test framework to Makefile

This commit is contained in:
Charles Mita
2018-08-13 13:15:45 +01:00
parent dc34262acc
commit 87d2d065d3
2 changed files with 10 additions and 1 deletions
+1
View File
@@ -5,4 +5,5 @@
build/
*.o
*.mod
*.so
+9 -1
View File
@@ -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 $@