CCOPTS = -O2 --std=gnu18 -Wall -Werror all: if [ ! -d obj ]; then mkdir obj; fi cc $(CCOPTS) -o obj/meminfo.o -c src/meminfo.c cc $(CCOPTS) -o obj/netinfo.o -c src/netinfo.c cc $(CCOPTS) -o obj/cpuinfo.o -c src/cpuinfo.c cc $(CCOPTS) -o obj/diskinfo.o -c src/diskinfo.c cc $(CCOPTS) -o obj/proc.o -c src/proc.c cc $(CCOPTS) -o obj/status.o -c src/status.c cc $(CCOPTS) -o cmon obj/*.o src/main.c valgrind: all $(info Running memory leak check) valgrind \ --leak-check=full \ --show-leak-kinds=all \ --error-exitcode=1 \ ./cmon