# One Makefile for every one-file program in this folder.
#   make prog        builds prog from prog.c, if prog.c changed
#   make run-prog    builds it the same way, then runs it
#   make entr-prog   runs it again every time you save prog.c; Ctrl-C stops it

CC = gcc
CFLAGS = -Wall -g -fsanitize=address

run-%: %.c
	@$(MAKE) --no-print-directory $*
	./$*

entr-%: %.c
	ls $< | entr -c $(MAKE) --no-print-directory run-$*
