mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
21 lines
444 B
Makefile
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)
|