summaryrefslogtreecommitdiff
path: root/OASIS/c/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'OASIS/c/Makefile')
-rw-r--r--OASIS/c/Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/OASIS/c/Makefile b/OASIS/c/Makefile
new file mode 100644
index 0000000..7de5117
--- /dev/null
+++ b/OASIS/c/Makefile
@@ -0,0 +1,34 @@
+CC = gcc
+CFLAGS = -g -Wall -rdynamic -ggdb -O3 -fno-omit-frame-pointer -fopenmp -I/usr/include/gnu
+SRC_DIR = src
+OBJ_DIR = build
+TARGET = $(OBJ_DIR)/model
+SRCS = $(wildcard $(SRC_DIR)/*.c)
+OBJS = $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SRCS))
+DEPS = $(wildcard $(SRC_DIR)/*.h)
+
+all: ulimit $(TARGET)
+
+ulimit:
+ ulimit -c unlimited
+
+$(TARGET): $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $^ -lm -lopenblas
+
+$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(DEPS)
+ mkdir -p $(OBJ_DIR)
+ $(CC) $(CFLAGS) -c -o $@ $< -I$(SRC_DIR)
+
+run: $(TARGET)
+ ./$(TARGET)
+
+debug: ulimit $(TARGET)
+ gdb -c /tmp/core $(TARGET)
+
+valgrind: $(TARGET)
+ valgrind --leak-check=full --track-origins=yes ./$(TARGET)
+
+clean:
+ rm -rf $(OBJ_DIR)/*.o $(TARGET) core*
+
+.PHONY: all ulimit run debug valgrind clean