Initial commit.

This first sketch of the memory layout isn't working because I'm
not succeeding in packing the bitfields, so I intend to rip it up
and start again.
This commit is contained in:
Simon Brooke 2026-04-05 12:22:48 +01:00
parent d743b6787e
commit 7e9dc12766
4 changed files with 155 additions and 0 deletions

33
Makefile Normal file
View file

@ -0,0 +1,33 @@
PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
OBJS = grendel.o
ifeq ($(BUILD_MODE),debug)
CFLAGS += -g -O0
else ifeq ($(BUILD_MODE),run)
CFLAGS += -O2
else ifeq ($(BUILD_MODE),profile)
CFLAGS += -g -pg -fprofile-arcs -ftest-coverage
LDFLAGS += -pg -fprofile-arcs -ftest-coverage
EXTRA_CLEAN += grendel.gcda grendel.gcno $(PROJECT_ROOT)gmon.out
EXTRA_CMDS = rm -rf grendel.gcda
else
$(error Build mode $(BUILD_MODE) not supported by this Makefile)
endif
SRC_DIR=$(PROJECT_ROOT)/src
all: grendel
grendel: $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $^
$(EXTRA_CMDS)
# %.o: $(SRC_DIR)/%.cpp
# $(CXX) -c $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) -o $@ $<
%.o: $(SRC_DIR)/%.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
clean:
rm -fr grendel $(OBJS) $(EXTRA_CLEAN)