This repository has been archived on 2025-11-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
avm/Makefile
Aryadev Chavali 6038363d2f Added functionality to read and write instruction bytecode
Uses some bit hacks to quickly check what data type an opcode may have
by shifting down to units then casting it to a data_type_t.
Not very well tested yet, we'll need to see now.
2023-10-16 01:18:05 +01:00

36 lines
564 B
Makefile

CC=gcc
CFLAGS=-Wall -Wextra -Werror -Wswitch-enum -ggdb -fsanitize=address -std=c11
LIBS=
ARGS=
OUT=ovm.out
SRC=src
DIST=build
CODE=$(addprefix $(SRC)/, darr.c inst.c runtime.c main.c)
OBJECTS=$(CODE:$(SRC)/%.c=$(DIST)/%.o)
DEPS=$(OBJECTS:%.o=%.d)
.PHONY: all
all: $(OUT)
$(OUT): $(DIST)/$(OUT)
$(DIST)/$(OUT): $(OBJECTS)
mkdir -p $(DIST)
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
-include $(DEPS)
$(DIST)/%.o: $(SRC)/%.c
mkdir -p $(DIST)
$(CC) $(CFLAGS) -MMD -c $< -o $@ $(LIBS)
.PHONY: run
run: $(DIST)/$(OUT)
./$^ $(ARGS)
.PHONY:
clean:
rm -rfv $(DIST)/*