summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2025-08-11 01:17:19 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2025-08-11 01:17:19 +0200
commitbf3a748fcdccdcc8d4a7d170c22db1b13c8bd7b9 (patch)
tree91a0fadd69ca51b76d64f94bbf70fe6247baba85 /Makefile
parent4db1b6bc1dc6b880014ea0546ba30c73fea54643 (diff)
Makefile: Make tests cleaner and report better
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 8 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 3fe334f..fc9d6d4 100644
--- a/Makefile
+++ b/Makefile
@@ -20,18 +20,19 @@ $(TARGET): $(OBJ) src/main.c
@$(CC) $(CFLAGS) $(OBJ) src/main.c -o $(TARGET)
$(OBJ): $(OBJDIR)/%.o: src/%.c $(HEADERS)
- @mkdir -p out
- @$(CC) $(CFLAGS) -o $@ -c $<
+ mkdir -p out
+ $(CC) $(CFLAGS) -o $@ -c $<
clean:
- @rm -f $(TARGET)
- @rm -f out/*
- @rm -rf out/
- @rm -f $(TEST_FILES)
+ rm -f $(TARGET)
+ rm -f out/*
+ rm -rf out/
+ rm -f $(TEST_FILES)
$(TEST_FILES): $(TARGET) $(TEST_SOURCES) $(HEADERS)
+ @printf "Running '%s'..." $@
@$(CC) $(CFLAGS) -o $@ $(addsuffix .c, $@) $(OBJ)
- @if ./$@ ; then echo "PASS: $@";else echo "FAIL: $@ exit value: $$?"; fi
+ @if ./$@ ; then printf "\t\tPASS\n";else printf "\t\tFAIL: exit value: %d\n" $$?; fi
check: test
test: $(TEST_FILES)