aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-04-14 16:52:58 +0630
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-04-14 16:52:58 +0630
commite7a09c0de457b8cc3512687b406137b8a471c3c4 (patch)
tree70abc9d28ca6987be6b4f2560d05e7cf9ab63f20 /Makefile
parent1e6f60a869e578bdd390029da71d5dc920ef1b70 (diff)
downloadovm-e7a09c0de457b8cc3512687b406137b8a471c3c4.tar.gz
ovm-e7a09c0de457b8cc3512687b406137b8a471c3c4.tar.bz2
ovm-e7a09c0de457b8cc3512687b406137b8a471c3c4.zip
Wrote a new lexer API in C++
Essentially a refactor of the C formed lexer into C++ style. I can already see some benefits from doing this, in particular speed of prototyping.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 5 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 3fc42a8..e0c076b 100644
--- a/Makefile
+++ b/Makefile
@@ -2,11 +2,11 @@ CC=gcc
CPP=g++
VERBOSE=0
-GENERAL-FLAGS=-Wall -Wextra -Werror -Wswitch-enum -I.
+GENERAL-FLAGS=-Wall -Wextra -Werror -Wswitch-enum -I$(shell pwd)
DEBUG-FLAGS=-ggdb -fsanitize=address
RELEASE-FLAGS=-O3
CFLAGS:=$(GENERAL-FLAGS) -std=c11 $(DEBUG-FLAGS) -D VERBOSE=$(VERBOSE)
-CPPFLAGS:=$(GENERAL_FLAGS) $(DEBUG-FLAGS) -D VERBOSE=$(VERBOSE)
+CPPFLAGS:=$(GENERAL-FLAGS) -std=c++17 $(DEBUG-FLAGS) -D VERBOSE=$(VERBOSE)
LIBS=-lm
DIST=build
@@ -35,7 +35,7 @@ VM_OUT=$(DIST)/ovm.out
## ASSEMBLY setup
ASM_DIST=$(DIST)/asm
ASM_SRC=asm
-ASM_CODE:=$(addprefix $(ASM_SRC)/, )
+ASM_CODE:=$(addprefix $(ASM_SRC)/, lexer.cpp)
ASM_OBJECTS:=$(ASM_CODE:$(ASM_SRC)/%.cpp=$(ASM_DIST)/%.o)
ASM_DEPS:=$(ASM_OBJECTS:%.o=%.d) $(ASM_DIST)/main.d
ASM_CFLAGS=$(CPPFLAGS)
@@ -81,8 +81,8 @@ $(ASM_OUT): $(LIB_OBJECTS) $(ASM_OBJECTS) $(ASM_DIST)/main.o
-include $(ASM_DEPS)
$(ASM_DIST)/%.o: $(ASM_SRC)/%.cpp
- @$(CPP) $(ASM_CFLAGS) -MMD -c $< -o $@ $(LIBS)
- @echo "$(TERM_YELLOW)$@$(TERM_RESET): $<"
+ $(CPP) $(ASM_CFLAGS) -MMD -c $< -o $@ $(LIBS)
+ echo "$(TERM_YELLOW)$@$(TERM_RESET): $<"
## EXAMPLES recipes
$(EXAMPLES_DIST)/%.out: $(EXAMPLES_SRC)/%.asm $(ASM_OUT)