From 66ef566c9a0f3f9a2f725fc071a391adbdaf6c44 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sun, 26 May 2019 18:47:53 +0300 Subject: [PATCH] Makefile: on/off WITH_* options --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c2e840a..025a51e 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,13 @@ LIBS = -lm -ljpeg -pthread -levent -levent_pthreads -luuid override CFLAGS += -c -std=c11 -Wall -Wextra -D_GNU_SOURCE SOURCES = $(shell ls src/*.c src/http/*.c src/encoders/cpu/*.c src/encoders/hw/*.c) -ifeq ($(WITH_OMX_ENCODER),) -else + +define optbool +$(filter $(shell echo $(1) | tr A-Z a-z), yes on 1) +endef + + +ifneq ($(call optbool,$(WITH_OMX_ENCODER)),) LIBS += -lbcm_host -lvcos -lopenmaxil -L$(RPI_VC_LIBS) override CFLAGS += -DWITH_OMX_ENCODER -DOMX_SKIP64BIT -I$(RPI_VC_HEADERS) SOURCES += $(shell ls src/encoders/omx/*.c)