Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (27 sloc) 786 Bytes
# Based on a Makefile by Curtis McEnroe (@programble)
CC := clang
OUTPUT := enfin
CFLAGS := -std=gnu99 -MMD -Iinclude/ -Wall -Wextra \
$(shell pkg-config --cflags talloc)
LDFLAGS := $(shell pkg-config --libs talloc)
# Find sources
SOURCES := $(shell find src/ -name '*.c')
OBJECTS := $(SOURCES:%.c=%.o)
DFILES := $(SOURCES:%.c=%.d)
all: $(OUTPUT)
@echo -e " [\033[32;1mLD\033[0m] $@"
@$(CC) $(LDFLAGS) $^ -o $@
# Dependency files from -MMD
-include $(DFILES)
%.o: %.c
@echo -e " [\033[34;1mCC\033[0m] $<"
@$(CC) -c $(CFLAGS) $< -o $@
@echo -e " [\033[31;1mRM\033[0m] $(OBJECTS)"
@rm -f $(OBJECTS)
@echo -e " [\033[31;1mRM\033[0m] $(DFILES)"
@rm -f $(DFILES)
@echo -e " [\033[31;1mRM\033[0m] $(OUTPUT)"
@rm -f $(OUTPUT)
.PHONY: all clean
Jump to Line
Something went wrong with that request. Please try again.