mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
fix(tests): correctly handle dependencies in test makefile
This commit is contained in:
parent
71a4df1bb0
commit
e877b8dbd5
1 changed files with 7 additions and 3 deletions
|
|
@ -4,9 +4,16 @@ rawtests = \
|
|||
tests = $(addprefix test_,$(rawtests))
|
||||
test_objs = $(addsuffix .o,$(tests))
|
||||
objs := $(addprefix ../,$(objs))
|
||||
all_objs = $(objs) $(test_objs)
|
||||
deps = $(all_objs:.o=.d)
|
||||
|
||||
.PHONY: run
|
||||
|
||||
run: $(tests)
|
||||
$(addprefix ./,$(addsuffix &&,$(tests))) echo "Finished running C tests"
|
||||
|
||||
-include $(deps)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS) $(LDFLAGS) -o $*.o $*.c
|
||||
$(CC) -MM $(CFLAGS) $(LDFLAGS) $*.c > $*.d
|
||||
|
|
@ -14,8 +21,5 @@ objs := $(addprefix ../,$(objs))
|
|||
test_%: %.o $(objs)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $*.o $(objs) $(LDLIBS)
|
||||
|
||||
run: $(tests)
|
||||
$(addprefix ./,$(addsuffix &&,$(tests))) echo "Finished running C tests"
|
||||
|
||||
fclean:
|
||||
rm -f $(tests)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue