summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-21 19:56:41 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-21 19:56:41 -0400
commitef375d2a484fd0c3dced72174f0dc39694de433a (patch)
treedc322fafc9447ebf0d10f91ee62807d3beb5f8e1 /Makefile
parent2999bd3b9466617938f2f7ceb689cfbe33b46cd9 (diff)
feat: Encoded Assembly InstructionsHEADmain
Initial Encoding of assembly instructions in C++ structs.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 19 insertions, 5 deletions
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