-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (43 loc) · 1.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
SHELL=/bin/bash
# When using make alone show the help message
.DEFAULT_GOAL:=help
##################################################
# Source files
##################################################
CWD := $(shell pwd)
.PHONY: all
all: clean MessageDisplay compile run
@echo "====COMPILE AND RUN DONE===="
.PHONY: compile
compile: MessageDisplay
mkdir bin
$(CC) -I./include -lm -O3 -fopenmp --offload-arch=native $(CWD)/openmp/$(DIR)/main.c -o bin/$(DIR).o
@echo "====COMPILE DONE===="
.PHONY: run
run:
./bin/$(DIR).o
.PHONY: MessageDisplay
MessageDisplay:
@echo " ==== SOLLVE PROJECT MAKEFILE ==== "
@echo "Running make with the following compilers"
@echo CC = $(CC)
.PHONY: clean
clean:
- rm -rf bin
.PHONY: help
help:
@echo "SOLLVE"
@echo ""
@echo " === USE ==="
@echo " make CC=ccompiler CXX=cppcompiler FC=fortrancompiler [OPTIONS] [RULE]"
@echo ""
@echo " === OPTIONS === "
@echo " === RULES ==="
@echo " all"
@echo " Build and run SOURCES. If none is specified build and run all the OpenMP test files"
@echo " run"
@echo " run tests previously build. Filter tests SOURCES list, or all the OpenMP tests that are available within bin/ directory"
@echo " compile"
@echo " Compile the specific SOURCES files. If none is specified compile all the OpenMP test files"
@echo " clean"
@echo " Remove all executables from bin/ directory"