diff --git a/Makefile b/Makefile index f353dc8..5ea5f5c 100644 --- a/Makefile +++ b/Makefile @@ -45,11 +45,11 @@ srcs+=$(wildcard ${src_dir}/*.c ${src_dir}/**/*.c) headers+=$(wildcard ${src_dir}/*.h ${src_dir}/**/*.h) objs+=$(patsubst %.c,${build_dir}/%.o,${srcs}) -.PHONY: all +PHONY += all all: ${all_targets} ${RM} .lastpthread # Set that the last build was without pthread -.PHONY: install +PHONY += install install: build ${install_bins_targets} ${install_dir}/lib/libthread.so ${install_dir}/lib/libthread.a ${install_dir}/lib/libthread.so: ${build_dir}/libthread.so @@ -64,21 +64,11 @@ ${install_bins_targets}: ${install_dir}/bin/%: ${build_dir}/${tst_dir}/% @mkdir -p $(dir $@) install $^ $@ -.PHONY: graphs -graphs: - cd graphs && bash generate_graphs.sh -.PHONY: valgrind -valgrind: ${valgrind_targets} - -.PHONY: ${valgrind_targets} -${valgrind_targets}: valgrind_%: ${build_dir}/${tst_dir}/% - valgrind $^ ${check_argv} --leak-check=full --show-reachable=yes --track-origins=yes - -.PHONY: build +PHONY += build build: ${bins_target} ${build_dir}/libthread.so ${build_dir}/libthread.a ${build_dir}/${tst_dir}/51-fibonacci ${build_dir}/${tst_dir}/71-preemption -.PHONY: debug +PHONY += debug debug: $(MAKE) USE_DEBUG=. build @@ -121,18 +111,20 @@ ${build_dir}/%.o: %.c @mkdir -p $(dir $@) ${CC} -o $@ -c $^ ${CFLAGS} -.PHONY: compile_flags.txt +PHONY += compile_flags.txt compile_flags.txt: (echo "${CFLAGS} ${LDFLAGS}" | sed 's/ /\n/g') > compile_flags.txt -.PHONY: format +PHONY += format format: clang-format -i ${srcs} ${headers} -.PHONY: check_format +PHONY += check_format check_format: clang-format --dry-run --Werror ${srcs} ${headers} -.PHONY: clean +PHONY += clean clean: ${RM} -r build install + +.PHONY: $(PHONY)