feat: add install target to makefile

This commit is contained in:
Nemo D'ACREMONT 2025-03-14 17:57:50 +01:00
parent 91d6d55a74
commit 53b936555b
No known key found for this signature in database
GPG Key ID: 85F245EC3BB1E022

View File

@ -22,6 +22,7 @@ bins?= \
81-deadlock 81-deadlock
bins_target=$(addprefix ${build_dir}/,${bins}) bins_target=$(addprefix ${build_dir}/,${bins})
install_bins_targets=$(addprefix ${install_dir}/bin/,${bins})
src_dirs=$(sort $(dir $(wildcard ${src_dir}/**/))) src_dirs=$(sort $(dir $(wildcard ${src_dir}/**/)))
includes=$(patsubst %,-I%,${src_dirs}) includes=$(patsubst %,-I%,${src_dirs})
@ -35,8 +36,12 @@ objs+=$(patsubst %.c,${build_dir}/%.o,${srcs})
all: build all: build
.PHONY: install .PHONY: install
install: build install: build ${install_bins_targets}
true
.PHONY: ${install_bins_targets}
${install_bins_targets}: ${install_dir}/bin/%: ${build_dir}/%
@mkdir -p $(dir $@)
install $^ $@
.PHONY: graphs .PHONY: graphs
graphs: graphs: