Project restucture with IR and CG

This commit is contained in:
Scarlett
2025-04-25 19:29:05 -04:00
parent bac8cb53bb
commit 086c8ba170
15 changed files with 1262 additions and 1270 deletions

View File

@ -10,8 +10,7 @@ LEX := src/lexicalStructure.lex
YACC := src/grammar.y
EXE := alpha
OBJS := tmp/runner.o tmp/symbol_table.o tmp/grammar.tab.o tmp/lex.yy.o
# tmp/intermediate_code.o codegen.o <--- Add to line above
OBJS := tmp/runner.o tmp/symbol_table.o tmp/grammar.tab.o tmp/lex.yy.o tmp/intermediate_code.o tmp/codegen.o
TESTS-S1 := $(wildcard tests/sprint1/test/*.alpha)
TESTS-S2 := $(wildcard tests/sprint2/test/*.alpha)
@ -31,6 +30,7 @@ clean:
rm -f $(EXE)
rm -rf out
rm -rf tmp
rm -f *.s
tmp:
mkdir -p tmp
@ -55,13 +55,11 @@ tmp/lex.yy.o: tmp/lex.yy.c
tmp/symbol_table.o: src/symbol_table.c src/symbol_table.h
$(CC) $(CFLAGS) -c src/symbol_table.c -o tmp/symbol_table.o
# Uncomment rules when ready
tmp/intermediate_code.o: src/intermediate_code.c src/intermediate_code.h
$(CC) $(CFLAGS) -c src/intermediate_code.c -o tmp/intermediate_code.o
# tmp/intermediate_code.o: src/intermediate_code.c src/intermediate_code.h
# $(CC) $(CFLAGS) -c src/intermediate_code.c -o tmp/intermediate_code.o
# tmp/codegen.o: src/codegen.c src/codegen.h
# $(CC) $(CFLAGS) -c src/codegen.c -o tmp/codegen.o
tmp/codegen.o: src/codegen.c src/codegen.h
$(CC) $(CFLAGS) -c src/codegen.c -o tmp/codegen.o
tmp/runner.o: src/runner.c src/runner.h tmp/flex.h tmp/grammar.tab.h
$(CC) $(CFLAGS) -c src/runner.c -o tmp/runner.o
@ -102,7 +100,4 @@ test-s4:
chmod +x ./test.sh
./test.sh sp4
./check.sh sp4
# Temprorary test ~ Scarlett
test-make: clean tmp tmp/grammar.tab.c tmp/grammar.tab.h tmp/lex.yy.c tmp/flex.h tmp/grammar.tab.o tmp/lex.yy.o tmp/symbol_table.o tmp/runner.o
# -----------