-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (42 loc) · 1.09 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
#######################################
# MAKEFILE #
# #
# AUTHOR: Daniel Gimenez Llorente #
# #
#######################################
# DIRECTORIES
IDIR = include
SDIR = src
ODIR = obj
BDIR = bin
# FILES
TARGET = aligners
SOURCES := $(wildcard $(SDIR)/*.cpp)
INCLUDES := $(wildcard $(IDIR)/*.h)
OBJECTS := $(SOURCES:$(SDIR)/%.cpp=$(ODIR)/%.o)
CHK_SOURCES := $(SOURCES) $(INCLUDES)
# VARIABLES
# Compiler
CC = g++ -c
CFLAGS = -Wall -I$(IDIR) -ansi -pedantic -std=c++11
# Linker
LINKER = g++ -o
LFLAGS = -Wall -I$(IDIR) -ansi -pedantic -std=c++11
# Others
rm = rm -f
# Compiles all programs in project
compile: $(BDIR)/$(TARGET)
@echo "INFO: All targets compiled"
$(BDIR)/$(TARGET): $(OBJECTS)
@$(LINKER) $@ $(LFLAGS) $(OBJECTS)
@echo "INFO: Linking completed"
$(OBJECTS):$(ODIR)/%.o: $(SDIR)/%.cpp
@$(CC) $(CFLAGS) $< -o $@
@echo "INFO: Compiled "$<" successfully"
# Displays the help for this makefile
help:
@echo "TODO: help"
.PHONEY: clean
clean:
@$(rm) $(OBJECTS)
@echo "INFO: Cleaning completed"