This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
2016-05-30 16:30:05 +02:00
|
|
|
CC=gcc
|
2016-12-20 23:36:00 +01:00
|
|
|
CFLAGS=-Wall -g -Wextra
|
2016-09-15 23:08:08 +02:00
|
|
|
LDFLAGS= -pthread
|
2016-05-30 16:30:05 +02:00
|
|
|
CFILES=$(wildcard *.c) # CFILES => recompiles everything on a C file change
|
|
|
|
EXEC=$(basename $(wildcard *.c))
|
2016-12-20 23:36:00 +01:00
|
|
|
SOURCES=$(wildcard ../lib/*.c ../../core/*.c)
|
2016-05-30 16:30:05 +02:00
|
|
|
OBJECTS=$(SOURCES:.c=.o)
|
|
|
|
TESTS=$(addsuffix .test, $(EXEC))
|
|
|
|
|
|
|
|
all: $(SOURCES) $(EXEC)
|
|
|
|
|
2016-12-23 01:33:52 +01:00
|
|
|
test:
|
|
|
|
rm /tmp/ipc/pongd-0-0
|
|
|
|
./pongd.bin
|
|
|
|
|
2016-05-30 16:30:05 +02:00
|
|
|
$(EXEC): $(OBJECTS) $(CFILES)
|
2016-12-20 23:36:00 +01:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) $@.c -lcbor -o $@.bin
|
2016-05-30 16:30:05 +02:00
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(CC) -c $(CFLAGS) $< -o $@
|
|
|
|
|
2016-10-14 17:47:08 +02:00
|
|
|
$(TESTS):
|
|
|
|
valgrind --show-leak-kinds=all --leak-check=full -v --track-origins=yes ./$(basename $@).bin
|
|
|
|
|
2016-05-30 16:30:05 +02:00
|
|
|
clean:
|
2016-09-15 23:08:08 +02:00
|
|
|
@-rm $(OBJECTS)
|
2016-05-30 16:30:05 +02:00
|
|
|
|
|
|
|
mrproper: clean
|
2016-09-15 23:08:08 +02:00
|
|
|
@-rm *.bin
|