-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·45 lines (34 loc) · 1014 Bytes
/
Copy pathMakefile
File metadata and controls
executable file
·45 lines (34 loc) · 1014 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
# Makefile for Backup program
## Constants
CXX = g++
CXXFLAGS = -std=c++14
CPPFLAGS = -Wall -pedantic -Wextra -g -Wno-long-long -O2
SRC_DIR = ./src/
APP_NAME = provaja6
### All cpp file and object files
SRCS = $(wildcard $(SRC_DIR)*.cpp)
OBJS = $(SRCS:.cpp=.o)
## Commands
all: doc compile
compile: $(OBJS)
@$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OBJS) -o $(APP_NAME)
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
@$(CXX) $(CXXFLAGS) -MM -MT $*.o $*.cpp > $*.d
doc:
doxygen Doxyfile
### 'opt' specifies parameters eg. make run opt="--show"
run:
@./$(APP_NAME) $(opt)
count: clean
@wc -l src/*
clean:
@$(RM) -r $(SRC_DIR)*.o ./doc $(APP_NAME) $(SRC_DIR)*.d
help:
@printf "%s\n" "Help for make:"
@printf "%s\n" " all Build documentation and executable file"
@printf "%s\n" " compile Create executable binary file"
@printf "%s\n" " clean Remove all generated files"
@printf "%s\n" " doc Build documentation"
@printf "%s\n" " count Characters counter"
-include $(SRCS:.cpp=.d)