-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile_linux
More file actions
41 lines (30 loc) · 988 Bytes
/
Makefile_linux
File metadata and controls
41 lines (30 loc) · 988 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
# variables
COMPILATEUR_C := g++
FLAGS_C := -O3 -std=c++11 -fopenmp
FLAGS_AR := cru
HOME = .
# folders executable and sources
main := $(HOME)/main
src := $(HOME)/src
# objects
obj_main := $(patsubst %.cpp,%.o,$(wildcard $(main)/*.cpp))
obj_src := $(patsubst %.cpp,%.o,$(wildcard $(src)/*.cpp))
# include directories and external libraries
INCLUDE = -I./src -I./include
# standard library
LINK_LIBS = -lblas -llapack
# Define the target directories.
TARGETDIR=.
all: dns
dns: $(obj_src) $(obj_main)
@echo "Building main:"
$(COMPILATEUR_C) $(FLAGS_C) $(INCLUDE) -o $(main)/ftle.bin $(obj_main) $(obj_src) $(LINK_LIBS)
# Compile all source files .cpp into .o files
$(TARGETDIR)/%.o: $(TARGETDIR)/%.cpp $(TARGETDIR)/%.h
$(COMPILATEUR_C) $(FLAGS_C) $(INCLUDE) -c $< -o $@
# Compile all source files .cpp into .o files
$(TARGETDIR)/%.o: $(TARGETDIR)/%.cpp
$(COMPILATEUR_C) $(FLAGS_C) $(INCLUDE) -c $< -o $@
clean:
cd $(main); rm -f *.o *.bin *.app;
cd $(src); rm -f *.o *.a;