Build two executables: obi and obc
The names stand for Oreo's Brainfuck Interpreter and Oreo's Brainfuck Compiler, separate tasks that shouldn't be packaged in one executable.
This commit is contained in:
11
Makefile
11
Makefile
@@ -1,5 +1,4 @@
|
|||||||
CC=gcc
|
CC=gcc
|
||||||
OUT=obf.out
|
|
||||||
LIBS=
|
LIBS=
|
||||||
ARGS=
|
ARGS=
|
||||||
|
|
||||||
@@ -14,15 +13,19 @@ CFLAGS=$(GFLAGS) $(DFLAGS)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: $(OUT)
|
all: obi.out obc.out
|
||||||
|
|
||||||
$(OUT): lib.c parser.c main.c
|
obi.out: lib.c parser.c obi.c
|
||||||
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
|
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
|
||||||
|
|
||||||
|
obc.out: lib.c parser.c assembler.c obc.c
|
||||||
|
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
|
||||||
|
|
||||||
|
OUT=
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run: $(OUT)
|
run: $(OUT)
|
||||||
./$^ $(ARGS)
|
./$^ $(ARGS)
|
||||||
|
|
||||||
.PHONY:
|
.PHONY:
|
||||||
clean:
|
clean:
|
||||||
rm -v $(OUT)
|
rm -v *.out *.o
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* main.c
|
/* obi.c
|
||||||
* Created: 2023-09-02
|
* Created: 2023-09-02
|
||||||
* Author: Aryadev Chavali
|
* Author: Aryadev Chavali
|
||||||
* Description: Entrypoint of compiler
|
* Description: Entrypoint of interpreter
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
Reference in New Issue
Block a user