Added Make recipes for examples
This commit is contained in:
13
Makefile
13
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
|
||||
|
||||
Reference in New Issue
Block a user