From 2498d5cf81fa507f8c5ca70a923c55df4f42c747 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 24 Jan 2017 23:43:18 +0100 Subject: [PATCH] Simplify source file filtering --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7e891f0..af5d2a9 100644 --- a/Makefile +++ b/Makefile @@ -5,16 +5,16 @@ include colors.mk include common.mk # source files -OSOURCE = $(sort $(wildcard ${PROJECT}/*.c) \ - ${PROJECT}/css-definitions.c) +OSOURCE = $(sort $(wildcard ${PROJECT}/*.c) \ + ${PROJECT}/css-definitions.c) +SOURCE_FILTER = ifneq (${WITH_SQLITE},0) INCS += $(SQLITE_INC) LIBS += $(SQLITE_LIB) -SOURCE = $(OSOURCE) CPPFLAGS += -DWITH_SQLITE else -SOURCE = $(filter-out ${PROJECT}/database-sqlite.c,$(OSOURCE)) +SOURCE_FILTER += ${PROJECT}/database-sqlite.c endif ifneq ($(WITH_MAGIC),0) @@ -50,6 +50,7 @@ CPPFLAGS += -DDBUSINTERFACEDIR=\"${DBUSINTERFACEDIR}\" endif endif +SOURCE = $(filter-out $(SOURCE_FILTER),$(OSOURCE)) OBJECTS = $(addprefix ${BUILDDIR_RELEASE}/,${SOURCE:.c=.o}) OBJECTS_DEBUG = $(addprefix ${BUILDDIR_DEBUG}/,${SOURCE:.c=.o}) OBJECTS_GCOV = $(addprefix ${BUILDDIR_GCOV}/,${SOURCE:.c=.o})