minor adjustments to Makefile

This commit is contained in:
2024-07-06 01:59:20 -04:00
parent eb773405a6
commit 255a49111d
2 changed files with 33 additions and 33 deletions

View File

@ -7,27 +7,27 @@
########## Variables ##########
CXX = g++ # compiler
CXX = g++ # compiler
CXXFLAGS = -std=c++20 -g -Wall -MMD -O0 # compiler flags
MAKEFILE_NAME = ${firstword ${MAKEFILE_LIST}} # makefile name
MAKEFILE_NAME = ${firstword ${MAKEFILE_LIST}} # makefile name
SOURCES = $(wildcard src/*.cc) # source files (*.cc)
OBJECTS = ${SOURCES:.cc=.o} # object files forming executable
DEPENDS = ${OBJECTS:.o=.d} # substitute ".o" with ".d"
SOURCES = $(wildcard src/*.cc) # source files (*.cc)
OBJECTS = ${SOURCES:.cc=.o} # object files forming executable
DEPENDS = ${OBJECTS:.o=.d} # substitute ".o" with ".d"
EXEC = bin/cc3k # executable name
########## Targets ##########
.PHONY : clean # not file names
.PHONY : clean # not file names
${EXEC} : ${OBJECTS} # link step
${CXX} ${CXXFLAGS} $^ -o $@ -lncurses # additional object files before $^
${EXEC} : ${OBJECTS} # link step
${CXX} ${CXXFLAGS} -O0 $^ -o $@ -lncurses # additional object files before $^
${OBJECTS} : ${MAKEFILE_NAME} # OPTIONAL : changes to this file => recompile
${OBJECTS} : ${MAKEFILE_NAME} # OPTIONAL : changes to this file => recompile
# make implicitly generates rules to compile C++ files that generate .o files
-include ${DEPENDS} # include *.d files containing program dependences
-include ${DEPENDS} # include *.d files containing program dependences
clean : # remove files that can be regenerated
clean : # remove files that can be regenerated
rm -f ${DEPENDS} ${OBJECTS} ${EXEC}

0
bin/.keep_dir Normal file
View File