mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
tests: tests can now use libft
This commit is contained in:
parent
da447a2491
commit
c7a86eecfd
2 changed files with 11 additions and 4 deletions
2
Makefile
2
Makefile
|
|
@ -76,5 +76,5 @@ tests:
|
||||||
|
|
||||||
@echo "All tests passed!"
|
@echo "All tests passed!"
|
||||||
|
|
||||||
ctests:
|
ctests: $(LIBFT)
|
||||||
+make -C tests
|
+make -C tests
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,13 @@ test_objs = $(addsuffix .o,$(tests))
|
||||||
objs := $(addprefix ../,$(objs))
|
objs := $(addprefix ../,$(objs))
|
||||||
all_objs = $(objs) $(test_objs)
|
all_objs = $(objs) $(test_objs)
|
||||||
deps = $(all_objs:.o=.d)
|
deps = $(all_objs:.o=.d)
|
||||||
|
LDLIBS = \
|
||||||
|
-lreadline \
|
||||||
|
-lft
|
||||||
|
LIBFTDIR = ../libft/
|
||||||
|
LIBFT = $(LIBFTDIR)libft.a
|
||||||
|
IFLAGS = -I$(LIBFTDIR)
|
||||||
|
LINCLUDE = -L$(LIBFTDIR)
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
|
|
||||||
|
|
@ -15,11 +22,11 @@ run: $(tests)
|
||||||
-include $(deps)
|
-include $(deps)
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) -c $(CFLAGS) $(LDFLAGS) -o $*.o $*.c
|
$(CC) -c $(CFLAGS) $(IFLAGS) -o $*.o $*.c
|
||||||
$(CC) -MM $(CFLAGS) $(LDFLAGS) $*.c > $*.d
|
$(CC) -MM $(CFLAGS) $(IFLAGS) $*.c > $*.d
|
||||||
|
|
||||||
test_%: %.o $(objs)
|
test_%: %.o $(objs)
|
||||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $*.o $(objs) $(LDLIBS)
|
$(CC) $(CFLAGS) -o $@ $*.o $(objs) $(LINCLUDE) $(LDLIBS)
|
||||||
|
|
||||||
fclean:
|
fclean:
|
||||||
rm -f $(tests)
|
rm -f $(tests)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue