Remove some internal dumps.
[panamaz] / test-ffmpeg / Makefile
1
2 CFLAGS=-g -fPIC
3 HOST_CC=gcc
4
5 JAVA_HOME=/opt/jdk-foreign/jvm/openjdk-19-internal
6 JAVAC=$(JAVA_HOME)/bin/javac
7 JAVA=$(JAVA_HOME)/bin/java
8
9 JAVACFLAGS=--add-modules jdk.incubator.foreign
10
11 api_SOURCES := $(wildcard ../src/api/*.java)
12 ffmpeg_SOURCES := $(wildcard src/proto/ffmpeg/*.java)
13 ffmpeg_demo_SOURCES := $(wildcard src/ffmpeg/test/*.java)
14
15 all::
16         mkdir -p bin
17
18 all:: bin/demo.built
19
20 bin/ffmpeg.built: bin/ffmpeg.gen $(ffmpeg_SOURCES)
21         $(JAVAC) $(JAVACFLAGS) -cp bin/classes -d bin/classes \
22                 $(shell find bin/java -name '*.java') \
23                 $(ffmpeg_SOURCES)
24         touch $@
25
26 bin/ffmpeg.gen: bin/ffmpeg.pm bin/ffmpeg-defines.pm ../src/generate-native $(api_SOURCES)
27         ../src/generate-native -d bin/java -t proto.ffmpeg -a ./bin/ffmpeg.pm -a ./bin/ffmpeg-defines.pm ffmpeg.api
28         touch $@
29
30 bin/ffmpeg-defines.pm: ffmpeg.h ../src/export-defines ffmpeg.api
31         ../src/export-defines -d bin/ffmpeg-defines.c ffmpeg.api
32         $(HOST_CC) -o bin/ffmpeg-defines -I. bin/ffmpeg-defines.c
33         bin/ffmpeg-defines $@~
34         mv $@~ $@
35
36 bin/ffmpeg.pm: ffmpeg.h ../src/export.so
37         gcc -fplugin=../src/export.so -fplugin-arg-export-output=$@~ ./$< -o /dev/null
38         mv $@~ $@
39
40 bin/demo.built: $(ffmpeg_demo_SOURCES) bin/ffmpeg.built
41         $(JAVAC) $(JAVACFLAGS) -cp bin/classes -d bin/classes $(ffmpeg_demo_SOURCES)
42         touch $@
43
44 demo: all
45         $(JAVA) --enable-native-access=ALL-UNNAMED --add-modules jdk.incubator.foreign \
46                 -cp bin/classes \
47                 ffmpeg.test.TestFFMPEG
48
49 clean:
50         rm -rf bin 000[0-9].pnm
51
52 .PHONY: demo clean all