-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
49 lines (39 loc) · 1.26 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
# Makefile
TARGET = formatted_output
DOXYGEN_DIR = doxygen
# Choose the compiler.
# CC = clang++
CC = g++-13
# CC = llvm-g++
# Choose the C++ standard.
# C++20 - Includes the <format> library.
# CFLAGS = -Wall -Wextra -std=c++20
# C++23 - Includes the <format> and <print> libraries.
# CFLAGS = -Wall -Wextra -std=c++23
# C++2B - Includes the latest C++ draft specification.
CFLAGS = -Wall -Wextra -std=c++2b
LIBS =
all: $(TARGET)
help:
@echo "The following targets are available:"
@echo " 'make' or 'make all' - build program"
@echo " 'make help' - print help message"
@echo " 'make run' - run program"
@echo " 'make docs' - create documentation"
@echo " 'make clean' - remove program, documentation, and clean up directory"
$(TARGET): $(TARGET).cpp
@echo 'Building target: $@ ...'
$(CC) $(CFLAGS) -o $@ $< $(LIBS)
run: $(TARGET)
@echo 'Running target: $(TARGET) ...'
./$(TARGET)
docs:
@echo 'Generating Doxygen documentation ...'
cd $(DOXYGEN_DIR) && doxygen &> doxygen.log
cd $(DOXYGEN_DIR)/latex && $(MAKE) pdf &> make_pdf.output
clean:
@echo 'Cleaning target: $(TARGET) ...'
$(RM) $(TARGET)
@echo 'Cleaning Doxygen documentation ...'
$(RM) $(DOXYGEN_DIR)/doxygen.log
$(RM) -r $(DOXYGEN_DIR)/html $(DOXYGEN_DIR)/latex