Skip to content

Commit a14d092

Browse files
author
Andrea Medeghini
committed
improve build scripts
1 parent ab33ca5 commit a14d092

6 files changed

Lines changed: 46 additions & 19 deletions

File tree

ffmpeg4java-linux/native/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
INSTALL_PATH := $(PWD)/../src/main/resources
1+
INSTALL_PATH := $(CURDIR)/../src/main/resources
22

33
.PHONY: checkout
44
checkout:
@@ -21,12 +21,12 @@ install:
2121
./scripts/copy.sh $(INSTALL_PATH)
2222

2323
.PHONY: all
24-
all: checkout configure compile install
24+
all: build-lib install
2525

2626
.PHONY: build-image
2727
build-image:
2828
docker build -t ffmpeg4java-linux .
2929

3030
.PHONY: build-lib
31-
build-lib:
32-
docker run --rm -i -v $(PWD):/var/native ffmpeg4java-linux make checkout configure compile
31+
build-lib: build-image
32+
docker run --rm -i -v $(CURDIR):/var/native ffmpeg4java-linux make checkout configure compile
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -e
44

5-
test ! -d "$(pwd)/ffmpeg" && git clone https://git.ffmpeg.org/ffmpeg.git "$(pwd)/ffmpeg"
5+
if [ ! -d "$(pwd)/ffmpeg" ]; then
6+
git clone https://git.ffmpeg.org/ffmpeg.git "$(pwd)/ffmpeg"
7+
else
8+
pushd "$(pwd)/ffmpeg"
9+
git fetch
10+
popd
11+
fi
612

7-
cd "$(pwd)/ffmpeg" && git checkout af25a4bfd2503caf3ee485b27b99b620302f5718
13+
pushd "$(pwd)/ffmpeg"
14+
git checkout af25a4bfd2503caf3ee485b27b99b620302f5718
15+
popd

ffmpeg4java-macos/native/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
INSTALL_PATH := $(PWD)/../src/main/resources
1+
INSTALL_PATH := $(CURDIR)/../src/main/resources
22

33
.PHONY: checkout
44
checkout:
@@ -21,4 +21,7 @@ install:
2121
./scripts/copy.sh $(INSTALL_PATH)
2222

2323
.PHONY: all
24-
all: checkout configure compile install
24+
all: build-lib install
25+
26+
.PHONY: build-lib
27+
build-lib: checkout configure compile
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -e
44

5-
test ! -d "$(pwd)/ffmpeg" && git clone https://git.ffmpeg.org/ffmpeg.git "$(pwd)/ffmpeg"
5+
if [ ! -d "$(pwd)/ffmpeg" ]; then
6+
git clone https://git.ffmpeg.org/ffmpeg.git "$(pwd)/ffmpeg"
7+
else
8+
pushd "$(pwd)/ffmpeg"
9+
git fetch
10+
popd
11+
fi
612

7-
cd "$(pwd)/ffmpeg" && git checkout af25a4bfd2503caf3ee485b27b99b620302f5718
13+
pushd "$(pwd)/ffmpeg"
14+
git checkout af25a4bfd2503caf3ee485b27b99b620302f5718
15+
popd

ffmpeg4java-windows/native/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
INSTALL_PATH := $(PWD)/../src/main/resources
1+
INSTALL_PATH := $(CURDIR)/../src/main/resources
22

33
.PHONY: checkout
44
checkout:
@@ -21,12 +21,12 @@ install:
2121
./scripts/copy.sh $(INSTALL_PATH)
2222

2323
.PHONY: all
24-
all: checkout configure compile install
24+
all: build-lib install
2525

2626
.PHONY: build-image
2727
build-image:
2828
docker build -t ffmpeg4java-linux .
2929

3030
.PHONY: build-lib
31-
build-lib:
32-
docker run --rm -i -v $(PWD):/var/native ffmpeg4java-linux make compile
31+
build-lib: build-image
32+
docker run --rm -i -v $(CURDIR):/var/native ffmpeg4java-linux make checkout configure compile
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -e
44

5-
test ! -d "$(pwd)/ffmpeg" && git clone https://git.ffmpeg.org/ffmpeg.git "$(pwd)/ffmpeg"
5+
if [ ! -d "$(pwd)/ffmpeg" ]; then
6+
git clone https://git.ffmpeg.org/ffmpeg.git "$(pwd)/ffmpeg"
7+
else
8+
pushd "$(pwd)/ffmpeg"
9+
git fetch
10+
popd
11+
fi
612

7-
cd "$(pwd)/ffmpeg" && git checkout af25a4bfd2503caf3ee485b27b99b620302f5718
13+
pushd "$(pwd)/ffmpeg"
14+
git checkout af25a4bfd2503caf3ee485b27b99b620302f5718
15+
popd

0 commit comments

Comments
 (0)