Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Makefile: fix the ffmpeg dependencies (to not build ffmpeg for rules …
…like distclean)
  • Loading branch information
perexg committed Nov 23, 2015
1 parent 0770d29 commit 851aebb
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Makefile
Expand Up @@ -422,6 +422,9 @@ SRCS-$(CONFIG_BONJOUR) = $(SRCS-BONJOUR)
I18N-C += $(SRCS-BONJOUR)

# libav
DEPS-LIBAV = \
src/main.c \
src/tvhlog.c
SRCS-LIBAV = \
src/libav.c \
src/muxer/muxer_libav.c \
Expand Down Expand Up @@ -530,10 +533,10 @@ OBJS_EXTRA = $(SRCS_EXTRA:%.c=$(BUILDDIR)/%.so)
DEPS = ${OBJS:%.o=%.d}

ifeq ($(CONFIG_LIBFFMPEG_STATIC),yes)
DEPS += ${BUILDDIR}/libffmpeg_stamp
ALL-yes += ${BUILDDIR}/libffmpeg_stamp
endif
ifeq ($(CONFIG_HDHOMERUN_STATIC),yes)
DEPS += ${BUILDDIR}/libhdhomerun_stamp
ALL-yes += ${BUILDDIR}/libhdhomerun_stamp
endif

SRCS += build.c timestamp.c
Expand All @@ -543,17 +546,16 @@ SRCS += build.c timestamp.c
#

# Default
.PHONY: all
all: $(ALL-yes) ${PROG}

# Special
.PHONY: clean distclean reconfigure

# Check configure output is valid
.config.mk: configure
@echo "./configure output is old, please re-run"
@false

# Recreate configuration
.PHONY: reconfigure
reconfigure:
$(ROOTDIR)/configure $(CONFIGURE_ARGS)

Expand All @@ -572,12 +574,15 @@ ${BUILDDIR}/%.so: ${SRCS_EXTRA}
${CC} -O -fbuiltin -fomit-frame-pointer -fPIC -shared -o $@ $< -ldl

# Clean
.PHONY: clean
clean:
rm -rf ${BUILDDIR}/src ${BUILDDIR}/bundle* ${BUILDDIR}/build.o ${BUILDDIR}/timestamp.* \
src/tvh_locale_inc.c
find . -name "*~" | xargs rm -f
$(MAKE) -f Makefile.webui clean

# Distclean
.PHONY: distclean
distclean: clean
rm -rf ${ROOTDIR}/libav_static
rm -rf ${ROOTDIR}/libhdhomerun_static
Expand Down Expand Up @@ -673,8 +678,7 @@ make_webui:
# Static FFMPEG

ifeq ($(CONFIG_LIBFFMPEG_STATIC),yes)
${ROOTDIR}/src/libav.h: ${BUILDDIR}/libffmpeg_stamp
${SRCS_LIBAV}: ${BUILDDIR}/libffmpeg_stamp
src/libav.h ${SRCS-LIBAV} ${DEPS-LIBAV}: ${BUILDDIR}/libffmpeg_stamp
endif

${BUILDDIR}/libffmpeg_stamp: ${ROOTDIR}/libav_static/build/ffmpeg/lib/libavcodec.a
Expand All @@ -686,8 +690,7 @@ ${ROOTDIR}/libav_static/build/ffmpeg/lib/libavcodec.a: Makefile.ffmpeg
# Static HDHOMERUN library

ifeq ($(CONFIG_LIBHDHOMERUN_STATIC),yes)
${ROOTDIR}/src/input/mpegts/tvhdhomerun/tvhdhomerun_private.h: ${BUILDDIR}/libhdhomerun_stamp
${SRCS_HDHOMERUN}: ${BUILDDIR}/libhdhomerun_stamp
src/input/mpegts/tvhdhomerun/tvhdhomerun_private.h ${SRCS-HDHOMERUN}: ${BUILDDIR}/libhdhomerun_stamp
endif

${BUILDDIR}/libhdhomerun_stamp: ${ROOTDIR}/libhdhomerun_static/libhdhomerun/libhdhomerun.a
Expand Down

0 comments on commit 851aebb

Please sign in to comment.