Commit 48d06cbf authored by Sebastian Ramacher's avatar Sebastian Ramacher

Use wildcard and filter-out instead of find.

parent b1893b47
......@@ -4,14 +4,16 @@ include config.mk
include common.mk
PROJECT = zathura
OSOURCE = $(shell find . -maxdepth 1 -iname "*.c" -a ! -iname "database-sqlite.c")
HEADER = $(shell find . -maxdepth 1 -iname "*.h")
OSOURCE = $(wildcard *.c)
HEADER = $(wildcard *.h)
ifneq (${WITH_SQLITE},0)
INCS += $(SQLITE_INC)
LIBS += $(SQLITE_LIB)
SOURCE = $(OSOURCE) database-sqlite.c
SOURCE = $(OSOURCE)
CPPFLAGS += -DWITH_SQLITE
else
SOURCE = $(filter-out database-sqlite.c,$(OSOURCE))
endif
ifneq ($(wildcard ${VALGRIND_SUPPRESSION_FILE}),)
......@@ -91,7 +93,7 @@ dist: clean
$(QUIET)mkdir -p ${PROJECT}-${VERSION}/po
$(QUIET)cp LICENSE Makefile config.mk common.mk README AUTHORS Doxyfile \
${PROJECT}.1.rst ${PROJECT}rc.5.rst ${OSOURCE} ${HEADER} ${PROJECT}.pc.in \
${PROJECT}.desktop version.h.in database-sqlite.c \
${PROJECT}.desktop version.h.in \
${PROJECT}-${VERSION}
$(QUIET)cp tests/Makefile tests/config.mk tests/*.c \
${PROJECT}-${VERSION}/tests
......
......@@ -8,18 +8,21 @@ PROJECT = tests
SOURCE = tests.c $(wildcard test_*.c)
OBJECTS = ${SOURCE:.c=.o}
ZSOURCE = $(shell find ../ -maxdepth 1 -iname "*.c" -a ! -iname "database-sqlite.c" ! -iname "main.c")
ZOBJECTS = ${ZSOURCE:.c=.o}
ZOSOURCE = $(filter-out ../main.c,$(wildcard ../*.c))
ifneq (${WITH_SQLITE},0)
INCS += $(SQLITE_INC)
LIBS += $(SQLITE_LIB)
ZSOURCE += ../database-sqlite.c
ZSOURCE += $(ZOSOURCE)
ifeq (,$(findstring -DWITH_SQLITE,${CPPFLAGS}))
CPPFLAGS += -DWITH_SQLITE
endif
else
ZSOURCE = $(filter-out database-sqlite.c,$(ZOSOURCE))
endif
ZOBJECTS = ${ZSOURCE:.c=.o}
all: ${PROJECT}
run: ${PROJECT}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment