From 53b5f5b5e7ab83d36f834b05335c90a0c2c83212 Mon Sep 17 00:00:00 2001 From: Yahweasel Date: Wed, 8 Nov 2023 09:22:26 -0500 Subject: [PATCH] Adding an install rule This is a convenience for those who want to build against libav.js's FFmpeg, and is not used to install it in any conventional sense --- mk/ffmpeg.mk | 19 +++++++++++++++++++ mk/ffmpeg.mk.m4 | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/mk/ffmpeg.mk b/mk/ffmpeg.mk index a41f888e..58572a94 100644 --- a/mk/ffmpeg.mk +++ b/mk/ffmpeg.mk @@ -47,6 +47,10 @@ build/ffmpeg-$(FFMPEG_VERSION)/build-base-%/ffbuild/config.mak: \ mv build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/config.h.tmp build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/config.h touch $(@) +part-install-base-%: build/ffmpeg-$(FFMPEG_VERSION)/build-base-%/libavformat/libavformat.a + cd build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*) ; \ + $(MAKE) install prefix="$(PWD)/build/inst/base" + # wasm + threads build/ffmpeg-$(FFMPEG_VERSION)/build-thr-%/ffbuild/config.mak: \ @@ -67,6 +71,10 @@ build/ffmpeg-$(FFMPEG_VERSION)/build-thr-%/ffbuild/config.mak: \ mv build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/config.h.tmp build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/config.h touch $(@) +part-install-thr-%: build/ffmpeg-$(FFMPEG_VERSION)/build-thr-%/libavformat/libavformat.a + cd build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*) ; \ + $(MAKE) install prefix="$(PWD)/build/inst/thr" + # wasm + simd build/ffmpeg-$(FFMPEG_VERSION)/build-simd-%/ffbuild/config.mak: \ @@ -87,6 +95,10 @@ build/ffmpeg-$(FFMPEG_VERSION)/build-simd-%/ffbuild/config.mak: \ mv build/ffmpeg-$(FFMPEG_VERSION)/build-simd-$(*)/config.h.tmp build/ffmpeg-$(FFMPEG_VERSION)/build-simd-$(*)/config.h touch $(@) +part-install-simd-%: build/ffmpeg-$(FFMPEG_VERSION)/build-simd-%/libavformat/libavformat.a + cd build/ffmpeg-$(FFMPEG_VERSION)/build-simd-$(*) ; \ + $(MAKE) install prefix="$(PWD)/build/inst/simd" + # wasm + threads + simd build/ffmpeg-$(FFMPEG_VERSION)/build-thrsimd-%/ffbuild/config.mak: \ @@ -107,6 +119,13 @@ build/ffmpeg-$(FFMPEG_VERSION)/build-thrsimd-%/ffbuild/config.mak: \ mv build/ffmpeg-$(FFMPEG_VERSION)/build-thrsimd-$(*)/config.h.tmp build/ffmpeg-$(FFMPEG_VERSION)/build-thrsimd-$(*)/config.h touch $(@) +part-install-thrsimd-%: build/ffmpeg-$(FFMPEG_VERSION)/build-thrsimd-%/libavformat/libavformat.a + cd build/ffmpeg-$(FFMPEG_VERSION)/build-thrsimd-$(*) ; \ + $(MAKE) install prefix="$(PWD)/build/inst/thrsimd" + + +install-%: part-install-base-% part-install-thr-% part-install-simd-% part-install-thrsimd-% + true extract: build/ffmpeg-$(FFMPEG_VERSION)/PATCHED build/ffmpeg-$(FFMPEG_VERSION)/libavformat/jsfetch.c diff --git a/mk/ffmpeg.mk.m4 b/mk/ffmpeg.mk.m4 index a8f1a692..a3b398b5 100644 --- a/mk/ffmpeg.mk.m4 +++ b/mk/ffmpeg.mk.m4 @@ -43,6 +43,10 @@ build/ffmpeg-$(FFMPEG_VERSION)/build-$1-%/ffbuild/config.mak: \ sed 's/--extra-\(cflags\|ldflags\)='\''[^'\'']*'\''//g' < build/ffmpeg-$(FFMPEG_VERSION)/build-$1-$(*)/config.h > build/ffmpeg-$(FFMPEG_VERSION)/build-$1-$(*)/config.h.tmp mv build/ffmpeg-$(FFMPEG_VERSION)/build-$1-$(*)/config.h.tmp build/ffmpeg-$(FFMPEG_VERSION)/build-$1-$(*)/config.h touch $(@) + +part-install-$1-%: build/ffmpeg-$(FFMPEG_VERSION)/build-$1-%/libavformat/libavformat.a + cd build/ffmpeg-$(FFMPEG_VERSION)/build-$1-$(*) ; \ + $(MAKE) install prefix="$(PWD)/build/inst/$1" ]]]) # Base (asm.js and wasm) @@ -54,6 +58,9 @@ buildrule(simd, [[[--disable-pthreads --arch=x86_32 --disable-inline-asm --disab # wasm + threads + simd buildrule(thrsimd, [[[--enable-pthreads --arch=x86_32 --disable-inline-asm --disable-x86asm --enable-cross-compile]]], [[[$(THRFLAGS) $(SIMDFLAGS)]]]) +install-%: part-install-base-% part-install-thr-% part-install-simd-% part-install-thrsimd-% + true + extract: build/ffmpeg-$(FFMPEG_VERSION)/PATCHED build/ffmpeg-$(FFMPEG_VERSION)/libavformat/jsfetch.c build/ffmpeg-$(FFMPEG_VERSION)/PATCHED: build/ffmpeg-$(FFMPEG_VERSION)/configure