From 0f0862245f0a73c589116eb401b0eeaab5c5e780 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 3 Dec 2024 03:40:41 +0000 Subject: [PATCH] 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. --- Makefile | 11 +++++++---- main.c => obi.c | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) rename main.c => obi.c (98%) diff --git a/Makefile b/Makefile index b96aaa9..c805acf 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ CC=gcc -OUT=obf.out LIBS= ARGS= @@ -14,15 +13,19 @@ CFLAGS=$(GFLAGS) $(DFLAGS) endif .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) +obc.out: lib.c parser.c assembler.c obc.c + $(CC) $(CFLAGS) $^ -o $@ $(LIBS) + +OUT= .PHONY: run run: $(OUT) ./$^ $(ARGS) .PHONY: clean: - rm -v $(OUT) + rm -v *.out *.o diff --git a/main.c b/obi.c similarity index 98% rename from main.c rename to obi.c index 0a198de..72cff00 100644 --- a/main.c +++ b/obi.c @@ -1,7 +1,7 @@ -/* main.c +/* obi.c * Created: 2023-09-02 * Author: Aryadev Chavali - * Description: Entrypoint of compiler + * Description: Entrypoint of interpreter */ #include