-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
51 lines (41 loc) · 939 Bytes
/
makefile
File metadata and controls
51 lines (41 loc) · 939 Bytes
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
GCC ?= 0
DEBUG ?= 0
OS := $(shell uname)
ifeq ($(DEBUG), 1)
CXXFLAGS = -std=c++11 -march=native -g -Wall
else
CXXFLAGS = -std=c++11 -march=native -O3
endif
# Mitigate "stack_not_16_byte_aligned_error" on macOS
ifeq ($(OS), Darwin)
ifeq ($(DEBUG), 0)
CXXFLAGS += -fno-stack-check
endif
endif
# Define program name, directories and objects:
TARGET = ./bin
SRCDIR = ./src
OBJDIR = ./objs
OBJ = main.o ModalAnalysis.o Mesh.o Util.o NodeComponents.o
VPATH = $(SRCDIR):$(OBJDIR)
# Define compiler and suffixes
ifeq ($(GCC), 1)
CC = g++
else
CC = clang++
endif
# Compile rule
.cc.o:
@mkdir -p $(OBJDIR)
$(CC) $(CXXFLAGS) -c -o $(OBJDIR)/$@ $<
# Link rule:
$(TARGET): $(OBJ)
$(CC) $(CXXFLAGS) -o $(TARGET) $(addprefix $(OBJDIR)/, $(OBJ))
chmod go+rx $(TARGET)
# Dependencies:
ModalAnalysis.o: NodeComponents.o Util.o
main.o: Mesh.o ModalAnalysis.o NodeComponents.o Util.o
.PHONY: clean
# Clean-up rule:
clean:
rm -rf $(OBJDIR)