1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
CFLAGS = -Wall LDFLAGS = -lpthread -lrt CC = gcc SOURCES = $(wildcard *.c) BINARIES = $(patsubst %.c,%,$(SOURCES)) all: $(BINARIES) %: %.c $(CC) $(CFLAGS) $(LDFLAGS) $< -o $(patsubst %.c,%,$<) clean: rm -f $(BINARIES) .PHONY: all install clean