From ef375d2a484fd0c3dced72174f0dc39694de433a Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Tue, 21 Apr 2026 19:56:41 -0400 Subject: feat: Encoded Assembly Instructions Initial Encoding of assembly instructions in C++ structs. --- Makefile | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c10ffc6..daaad16 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,26 @@ CC = gcc-15 +CFLAGS = -Wall \ + -Wextra \ + -Wpedantic \ + -std=c23 +CXX = g++-15 +CXXFLAGS = -Wall \ + -Werror \ + -Wextra \ + -Wpedantic \ + -std=c++17 SRC_DIR = src -SRCS = $(SRC_DIR)/lex.yy.c \ +SRCS = $(SRC_DIR)/asm.cpp +GENERATED = $(SRC_DIR)/lex.yy.c \ $(SRC_DIR)/parser.tab.c PROG = jas OBJS = $(patsubst %.c, %.o, \ $(patsubst %.cpp, %.o, \ $(patsubst %.cxx, %.o, \ - $(patsubst %.cc, %.o, $(SRCS))))) + $(patsubst %.cc, %.o, $(SRCS) $(GENERATED))))) $(PROG): $(OBJS) - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) $(SRC_DIR)/parser.tab.c: $(SRC_DIR)/parser.y bison $(BISONFLAGS) -d $< -o $@ @@ -29,8 +40,11 @@ $(SRC_DIR)/lex.yy.c: $(SRC_DIR)/lexer.l $(SRC_DIR)/parser.tab.c %.o: %.cc $(CXX) $(CXXFLAGS) -c $< -o $@ +format: $(SRCS) + clang-format -i $^ + clean: - rm -rf $(PROG) $(OBJS) $(SRC_DIR)/lex.yy.c $(SRC_DIR)/parser.tab.c $(SRC_DIR)/parser.tab.h + rm -rf $(PROG) $(OBJS) $(GENERATED) -.PHONY: all clean +.PHONY: all clean format -- cgit v1.2.3