fix: write phony variable properly
This commit is contained in:
parent
7a1ab1415a
commit
0639823009
28
Makefile
28
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user