Working on refactoring, read more

The main program segfaults, but right now I'm working on the tests, mainly.
This commit is contained in:
2022-08-29 10:21:25 +10:00
parent 4fb2dea1b4
commit 1937d727bb
18 changed files with 142 additions and 141 deletions

View File

@@ -9,11 +9,17 @@ TARGETS = $(filter-out $(wildcard ../source/*main.c),$(wildcard ../source/*.c))
TESTS = $(wildcard *.c)
OBJ = $(addprefix $(ODIR)/,$(TARGETS:../source/%.c=%.o)) $(addprefix $(ODIR)/,$(TESTS:.c=.o))
.PRECIOUS: $(TESTS:%.c=../$(OUTDIR)/%.exe)
all: $(OBJ) $(TESTS:%.c=../$(OUTDIR)/%.exe)
../$(OUTDIR)/%.exe: $(ODIR)/%.o
@$(CC) -o $@ $< $(TARGETS:../source/%.c=$(ODIR)/%.o) $(CFLAGS) $(LIBS)
$@
ifeq ($(shell uname),Linux)
valgrind $@
else
@echo please run these tests with valgrind on linux
endif
$(OBJ): | $(ODIR)
@@ -29,4 +35,4 @@ $(ODIR)/%.o: ../source/%.c
.PHONY: clean
clean:
$(RM) $(ODIR)
$(RM) $(ODIR)