-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile0
67 lines (51 loc) · 1.44 KB
/
makefile0
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
61
62
63
64
65
66
67
## Developer: Babak Poursartip
## Latest update: July 12, 2019
## variables ==================================================================
## Name of the executable
NAME = Geriatrix
## Complier
CC = g++
## Source extension
SEXT = cpp
## Source directory
SDIR = .
## Output directory
ODIR = .
## Library directory
LIBS = -L/usr/local/lib
## Include directory
INC = -I./
## compile option
CFLAGS = -Wall -Wextra -pedantic -std=c++17
## Release option
RFLAGS = -O2
## DO NOT CHANGE ################################################
.PHONY: all clean dep test help
TARGET = $(ODIR)/$(NAME)
SRCS = $(wildcard $(SDIR)/*.$(SEXT))
OBJS = $(SRCS:.$(SEXT)=.o)
all : $(TARGET)
@echo "creaing the object files ..."
$(TARGET): $(OBJS)
$(CC) $(LIBS) $(OBJS) -o $(TARGET)
# rm $(OBJS) # uncomment if you want to remove the object files
@echo "compiling the code ..."
$(OBJS): $(SRCS)
mkdir -p $(ODIR)
$(CC) $(CFLAGS) $(RFLAGS) $(INC) -c $(SRCS)
cln:
@echo "cleaning the folder ..."
rm $(TARGET)
rm *.o
test:
@echo "Sources are: " $(SRCS)
@echo "Objects are: " $(OBJS)
help:
@echo "usage:"
@echo " make -> build"
@echo " make dep -> generates dependencies using gccmakedep"
@echo " make cln -> removes objects, executable"
@echo " make test -> lists source files"
dep :
gccmakedep $(INC) $(SRCS)
#################################################################