PROGRAMS_SRC = $(wildcard *.pas)
PROGRAMS_O = $(patsubst %.pas,%.o,$(PROGRAMS_SRC))
PROGRAMS = $(patsubst %.pas,%,$(PROGRAMS_SRC))

all:
	$(foreach file, $(PROGRAMS), fpc -v0 ${file};)

clean:
	rm -f $(PROGRAMS_O)
	rm -f $(PROGRAMS)

.PHONY: all clean