minor adjustments to Makefile
This commit is contained in:
22
Makefile
22
Makefile
@ -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
0
bin/.keep_dir
Normal file
Reference in New Issue
Block a user