-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·38 lines (30 loc) · 1.01 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
# g++ (clang works too with -stdlib=libc++)
# C++20 minimum for branching prediction hints: [[likely]], otherwise C++11
CC = g++ --std=c++20
# Compiler flags:
# -Ofast Safe as no floating point arithmetic is done
# -march=native Add optimization flags specific to the host platform
# -flto Link Time Optimizations
# -pendatic Comply with the standards
# -DHIGHLIGHT Enable syntax highlighting
# -lncursesw Links to ncurses library for wide characters (unicode)
OPTIM = -Ofast -flto -march=native
DEBUG = -g #-DDEBUG
#CXXFLAGS = -Wall -Wextra -pedantic-errors $(DEBUG) -DHIGHLIGHT -lncursesw # Debug only
CXXFLAGS = -Wall -Wextra -pedantic $(OPTIM) -DHIGHLIGHT -lncursesw
# the build target executable:
TARGET = yocto
PATHT = /usr/bin/
# root is not required to install
#PATHT = ~/.local/bin/
all:
$(CC) main.cpp -o $(TARGET) $(CXXFLAGS)
cp $(TARGET) $(PATHT)$(TARGET)
build:
$(CC) main.cpp -o $(TARGET) $(CXXFLAGS)
install:
cp $(TARGET) $(PATHT)$(TARGET)
uninstall:
rm $(PATHT)$(TARGET)
clean:
$(RM) $(TARGET)