Skip to content

Commit

Permalink
Adding an install rule
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Yahweasel committed Nov 8, 2023
1 parent decdf45 commit 53b5f5b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions mk/ffmpeg.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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: \
Expand All @@ -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: \
Expand All @@ -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: \
Expand All @@ -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

Expand Down
7 changes: 7 additions & 0 deletions mk/ffmpeg.mk.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 53b5f5b

Please sign in to comment.