Obsolete
/
libipc-old
Archived
3
0
Fork 0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
libipc-old/pubsub/app/Makefile

26 lines
568 B
Makefile
Raw Normal View History

2016-06-04 20:33:44 +02:00
CC=gcc
CFLAGS=-Wall -g -Wextra
2016-06-08 17:57:05 +02:00
LDFLAGS= -pthread
2016-06-04 20:33:44 +02:00
CFILES=$(wildcard *.c) # CFILES => recompiles everything on a C file change
EXEC=$(basename $(wildcard *.c))
2017-01-19 22:07:52 +01:00
SOURCES=$(wildcard ../lib/*.c ../../core/*.c)
2016-06-04 20:33:44 +02:00
OBJECTS=$(SOURCES:.c=.o)
TESTS=$(addsuffix .test, $(EXEC))
all: $(SOURCES) $(EXEC)
$(EXEC): $(OBJECTS) $(CFILES)
2017-01-19 22:07:52 +01:00
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) $@.c -o $@.bin
2016-06-04 20:33:44 +02:00
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
$(TESTS):
2017-01-19 22:07:52 +01:00
valgrind --show-leak-kinds=all --leak-check=full -v --track-origins=yes ./$(basename $@).bin
2016-06-04 20:33:44 +02:00
clean:
2016-09-13 22:08:35 +02:00
@-rm $(OBJECTS)
2016-06-04 20:33:44 +02:00
mrproper: clean
2016-09-15 23:08:08 +02:00
@-rm *.bin