KoreanNumbers/Makefile

35 lines
766 B
Makefile
Raw Normal View History

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 \
-Wl,-z,relro -Wl,-z,now
2020-10-29 04:22:26 +00:00
ifdef DEBUG
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-16 11:38:34 +00:00
$(CXX) $(CXXFLAGS) -fPIE -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}