blob: a8b0e294b3c5355e427d67c27a23e1bd516bc21f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
CFLAGS = -Wall -g
LDFLAGS = -lpthread -lrt -lncurses
CC = gcc
SOURCES = $(wildcard *.c)
BINARIES = $(patsubst %.c,%,$(SOURCES))
DEPS = $(patsubst %.c,%.d,$(SOURCES))
all: $(BINARIES)
%: %.c
$(CC) $(CFLAGS) $(LDFLAGS) $< -o $(patsubst %.c,%,$<)
clean:
rm -f $(DEPS)
rm -f $(BINARIES)
run: all
@echo "* running tests"
for test in $(patsubst %.c,%,$(SOURCES)); do \
echo -n "* running $${test}"; \
./$${test} >/dev/null; \
if [ $$? -ne 0 ]; then \
echo " FAILED!"; \
else \
echo " OK!"; \
fi; \
done
.PHONY: all install clean
|