2024-04-16 11:11:01 +00:00
|
|
|
COMMON_CXXFLAGS = -Wall -Wextra -Wpedantic -std=c++20 \
|
|
|
|
-Wformat -Wformat=2 -Wconversion -Wimplicit-fallthrough \
|
|
|
|
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 \
|
|
|
|
-D_GLIBCXX_ASSERTIONS \
|
|
|
|
-fstrict-flex-arrays=3 \
|
|
|
|
-fstack-clash-protection -fstack-protector-strong \
|
|
|
|
-Wl,-z,nodlopen -Wl,-z,noexecstack \
|
2024-04-23 06:55:48 +00:00
|
|
|
-Wl,-z,relro -Wl,-z,now -fPIE
|
2020-10-29 04:22:26 +00:00
|
|
|
ifdef DEBUG
|
2024-04-16 09:42:16 +00:00
|
|
|
CXXFLAGS = -Og -g ${COMMON_CXXFLAGS}
|
2020-10-29 04:22:26 +00:00
|
|
|
else
|
2024-04-16 11:11:01 +00:00
|
|
|
CXXFLAGS = -O2 ${COMMON_CXXFLAGS}
|
2020-10-29 04:22:26 +00:00
|
|
|
endif
|
|
|
|
|
2024-04-16 11:11:01 +00:00
|
|
|
OBJDIR = objects
|
|
|
|
|
|
|
|
SOURCES = src/main.cpp
|
|
|
|
|
|
|
|
OBJECTS = $(addprefix ${OBJDIR}/,$(patsubst %.cpp,%.cpp.o,${SOURCES}))
|
|
|
|
|
2020-10-29 04:22:26 +00:00
|
|
|
all: KoreanNumbers
|
|
|
|
|
2024-04-16 11:11:01 +00:00
|
|
|
KoreanNumbers: ${OBJECTS}
|
2024-04-23 06:55:48 +00:00
|
|
|
$(CXX) $(CXXFLAGS) -pie -o KoreanNumbers $^
|
2020-10-29 04:22:26 +00:00
|
|
|
|
2024-04-16 11:11:01 +00:00
|
|
|
${OBJDIR}/%.cpp.o: %.cpp
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
|
2020-10-29 04:22:26 +00:00
|
|
|
.PHONY:
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f KoreanNumbers
|
2024-04-16 11:11:01 +00:00
|
|
|
rm -rf ${OBJDIR}
|