You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
526 B
31 lines
526 B
# Makefile inspired by:
|
|
# https://spin.atomicobject.com/2016/08/26/makefile-c-projects/
|
|
|
|
EXEC := bogofilter-smtpd
|
|
|
|
CXXFLAGS=-std=gnu++17 -Iinclude
|
|
CPPFLAGS=-MMD -MP
|
|
|
|
SRCDIR := src
|
|
BUILDDIR := build
|
|
|
|
SRCS := $(shell find src -name '*.cpp')
|
|
OBJS := $(SRCS:%=$(BUILDDIR)/%.o)
|
|
DEPS := $(OBJS:.o=.d)
|
|
|
|
-include local.mk
|
|
|
|
$(BUILDDIR)/$(EXEC) : $(OBJS)
|
|
$(CXX) -o $@ $^
|
|
|
|
run : $(BUILDDIR)/$(EXEC)
|
|
$<
|
|
|
|
clean :
|
|
rm -R $(BUILDDIR)
|
|
|
|
$(BUILDDIR)/%.cpp.o: %.cpp
|
|
mkdir -p $(@D)
|
|
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
|
|
|
|
-include $(DEPS) |