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