added messages about what the makefile is currently compiling
added new debug target for getting line nums with valgrind
heavily revamped help message
added @ infront of most target commands to prevent echoing commands
instead of specifying `-Ilib` in the actual command, prepend it to $CC_FLAGS
#guess we gotta define this if it no exist, but imagine not needing custom cxx flags
CC_FLAGS:=
endif
CC_FLAGS:= -Ilib ${CC_FLAGS}
ifndefPROGS
PROGS:= whoami arch ls pwd basename uname yes
endif
all:
mkdir -p bin
for prog in ${PROGS};do${CC} -o bin/$$prog -Ilib${CC_FLAGS} src/$$prog.c;done
@mkdir -p bin
@for prog in ${PROGS};doecho Building $$prog... &&${CC} -o bin/$$prog ${CC_FLAGS} src/$$prog.c;done
verbose:
mkdir -p bin
for prog in ${PROGS};do${CC} -v -o bin/$$prog ${CC_FLAGS} src/$$prog.c;done
@mkdir -p bin
@for prog in ${PROGS};doecho Building $$prog... &&${CC} -v -o bin/$$prog ${CC_FLAGS} src/$$prog.c;done
debug:
@mkdir -p bin
@for prog in ${PROGS};doecho Building $$prog... &&${CC} -g -O0 -v -o bin/$$prog ${CC_FLAGS} src/$$prog.c;done
clean:
@rm -rf bin
help:
@echo 'make' - Build normal version
@echo 'make verbose' - Build normal version with verbose compilation for debugging
@echo 'make help' - Display this help message
@echo "Drake's Epic Coreutils Makefile Help Page™"
@echo 'make' - build normal version.
@echo 'make debug' - build verbosly, and with \`-g -O0\`for the lowest amount of compiler optimization, so that valgrind and such can report line numbers, and have more information in general
@echo 'make verbose' - build normal version with verbose compilation for debugging.