-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 702 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (27 loc) · 702 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
### Compiler & flags
CC=g++
CFLAGS=-std=c++17 -c -O3
LFLAGS=-lstdc++fs
### Directories
SRC_DIR=src
OBJ_DIR=build
HEAD_DIR=include
### Executable name
EXEC=EGB
### Sources (in src directory)
SOURCES=$(addprefix $(SRC_DIR)/, \
main.cpp keh_cst.cpp eos.cpp constants.cpp savgol.cpp )
### Objects (in build directory)
OBJECTS=$(SOURCES:$(SRC_DIR)%.cpp=$(OBJ_DIR)%.o)
### Rules: #######################################
### General target (executable):
all: $(EXEC)
### How to make the executable:
$(EXEC): $(OBJECTS)
$(CC) $^ -o $@ -lm $(LFLAGS)
### How to make every object:
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CC) $(CFLAGS) $< -o $@ $(LFLAGS)
### How to clean up:
clean:
rm $(OBJECTS) $(EXEC)