From 423f34ba457f41f01a8cda470b8e15e2d7089bb1 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 3 Dec 2024 04:30:26 +0000 Subject: Added Make recipes for examples --- Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index fd00f7e..e1d5c54 100644 --- a/Makefile +++ b/Makefile @@ -22,10 +22,19 @@ obc.out: lib.c parser.c assembler.c obc.c $(CC) $(CFLAGS) $^ -o $@ $(LIBS) OUT= -.PHONY: run +.PHONY: run clean examples-interpreter examples-compiler run: $(OUT) ./$^ $(ARGS) -.PHONY: +EXAMPLES=$(wildcard examples/*.bf) + +examples: examples-interpreter examples-compiler + +examples-interpreter: + $(foreach x, $(EXAMPLES), $(MAKE) run OUT=obi.out ARGS=$(x);) + +examples-compiler: + $(foreach x, $(EXAMPLES), $(MAKE) run OUT=obc.out ARGS=$(x) && ./a.out;) + clean: rm -v *.out *.o *.asm -- cgit v1.2.3-13-gbd6f