First commit!
This is a from the ground rework of an old project of the same name. I'm hoping to be more concerned with runtime efficiency, bytecode size and all those things that should actually matter for something that may host time/space critical code.
This commit is contained in:
35
Makefile
Normal file
35
Makefile
Normal file
@@ -0,0 +1,35 @@
|
||||
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)/, 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)/*
|
||||
Reference in New Issue
Block a user