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.
30 lines
551 B
30 lines
551 B
4 years ago
|
# Makefile inspired by:
|
||
|
# https://spin.atomicobject.com/2016/08/26/makefile-c-projects/
|
||
|
|
||
|
EXEC := bogofilter-smtpd
|
||
|
|
||
|
CXX=/usr/local/Cellar/gcc/9.3.0_1/bin/g++-9
|
||
|
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)
|
||
|
|
||
|
$(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)
|