-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
executable file
·60 lines (42 loc) · 1.13 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
52
53
54
55
56
57
58
59
60
##
# papi-wrapper makefile
# Copyright (c) 2016
# Sean Chester ([email protected])
##
RM = rm -rf
MV = mv
CP = cp -rf
CC = g++
TARGET = $(OUT)/papi-wrapper-mwe
SRC = $(wildcard src/*.cpp)
OBJ = $(addprefix $(OUT)/,$(notdir $(SRC:.cpp=.o)))
OUT = bin
LIB_DIR = # used as -L$(LIB_DIR)
INCLUDES = -I ./src/
LIB =
# Forces make to look these directories
VPATH = src
# By default compiling for performance (optimal)
CXXFLAGS = -O3 -m64 -Wno-deprecated -Wno-write-strings -nostdlib -Wpointer-arith \
-Wcast-qual -Wcast-align -std=c++0x -fopenmp -mavx -march=native
LDFLAGS=-m64 -lrt -fopenmp -lpapi
# All Target
all: $(TARGET)
# Tool invocations
$(TARGET): $(OBJ) $(LIB_DIR)$(LIB)
@echo 'Building target: $@ (GCC C++ Linker)'
$(CC) -o $(TARGET) $(OBJ) $(LDFLAGS)
@echo 'Finished building target: $@'
@echo ' '
$(OUT)/%.o: %.cpp
@echo 'Building file: $< (GCC C++ Compiler)'
$(CC) $(CXXFLAGS) $(INCLUDES) -c -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '
clean:
-$(RM) $(OBJ) $(TARGET) $(addprefix $(OUT)/,$(notdir $(SRC:.cpp=.d)))
-@echo ' '
deepclean:
-$(RM) bin/*
-@echo ' '
.PHONY: all clean deepclean