Use wildcard and filter-out instead of find.

This commit is contained in:
Sebastian Ramacher 2012-03-08 17:50:54 +01:00
parent b1893b47a2
commit 48d06cbf36
2 changed files with 12 additions and 7 deletions

View file

@ -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

View file

@ -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}