minishell/tests/Makefile
2025-02-07 15:29:43 +01:00

21 lines
444 B
Makefile

rawtests = \
metacharacters \
tests = $(addprefix test_,$(rawtests))
test_objs = $(addsuffix .o,$(tests))
objs := $(addprefix ../,$(objs))
.PHONY: run
%.o: %.c
$(CC) -c $(CFLAGS) $(LDFLAGS) -o $*.o $*.c
$(CC) -MM $(CFLAGS) $(LDFLAGS) $*.c > $*.d
test_%: %.o $(objs)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $*.o $(objs) $(LDLIBS)
run: $(tests)
$(addprefix ./,$(addsuffix &&,$(tests))) echo "Finished running C tests"
fclean:
rm -f $(tests)