programs := $(patsubst %.c, bin/%, $(wildcard *.c)) all: bin $(programs) bin: mkdir bin bin/% : %.c gcc -o $@ $< clean : rm $(programs)