Skip to content

Commit 25bd926

Browse files
committed
src: use a custom Makefile
We are bound to one toolchain and most results of the config-time checks were ignored anyway. This is more concise and doesn't require a configuration step.
1 parent 7250e6e commit 25bd926

File tree

5 files changed

+26
-56
lines changed

5 files changed

+26
-56
lines changed

.gitignore

-13
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,8 @@ a.out.wasm
33
a.out.js.mem
44
a.out
55
a.wasm
6-
src/.deps/
76
src/WebIDLGrammar.pkl
87
src/parser.out
9-
src/Makefile
10-
src/Makefile.in
11-
src/aclocal.m4
12-
src/autom4te.cache/
13-
src/compile
14-
src/config.log
15-
src/config.status
16-
src/configure
17-
src/configure~
18-
src/depcomp
19-
src/install-sh
20-
src/missing
218
lib/expat/xmlwf/xmlwf
229
dist
2310
.libs/

Makefile

+5-15
Original file line numberDiff line numberDiff line change
@@ -253,21 +253,11 @@ OCTP_DEPS = \
253253
$(DIST_DIR)/lib/libfontconfig.a \
254254
$(DIST_DIR)/lib/libass.a
255255

256-
# Require a patch to fix some errors
257-
src/SubOctpInterface.cpp: src/SubtitleOctopus.idl
258-
cd src && \
259-
python3 ../build/webidl_binder.py SubtitleOctopus.idl SubOctpInterface
260-
261-
src/Makefile: src/SubOctpInterface.cpp
262-
cd src && \
263-
autoreconf -fi && \
264-
EM_PKG_CONFIG_PATH=$(DIST_DIR)/lib/pkgconfig \
265-
emconfigure ./configure --host=x86-none-linux --build=x86_64 CFLAGS="$(GLOBAL_CFLAGS)"
266-
267-
src/subtitles-octopus-worker.bc: $(OCTP_DEPS) src/Makefile src/SubtitleOctopus.cpp src/SubOctpInterface.cpp
268-
cd src && \
269-
emmake make -j8 && \
270-
mv subtitlesoctopus.bc subtitles-octopus-worker.bc
256+
src/subtitles-octopus-worker.bc: $(OCTP_DEPS) all-src
257+
.PHONY: all-src
258+
all-src:
259+
PKG_CONFIG_PATH=$(DIST_DIR)/lib/pkgconfig \
260+
$(MAKE) -C src all
271261

272262
# Dist Files
273263
EMCC_COMMON_ARGS = \

src/Makefile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# If needed, override the following variables via `make VARNAME=VAL ...`
2+
CXX = em++ -r
3+
CXXFLAGS = -O3 -g4
4+
LIBASS_CXXFLAGS = $(shell pkg-config --static --cflags "libass >= 0.14.0")
5+
LOCAL_CXXFLAGS = -Wall -Wno-deprecated $(LIBASS_CXXFLAGS)
6+
7+
all: subtitles-octopus-worker.bc
8+
9+
SubOctpInterface.cpp: SubtitleOctopus.idl ../build/webidl_binder.py
10+
@# Our version of WebIDL contains JSO-specific patches
11+
python3 ../build/webidl_binder.py SubtitleOctopus.idl SubOctpInterface
12+
13+
subtitles-octopus-worker.bc: SubtitleOctopus.cpp libass.cpp SubOctpInterface.cpp
14+
@# All later dependencies are already included into the first by CPP
15+
$(CXX) $(LOCAL_CXXFLAGS) $(CXXFLAGS) -o $@ $<
16+
17+
clean:
18+
rm -f subtitles-octopus-worker.bc
19+
rm -f SubOctpInterface.cpp WebIDLGrammar.pkl parser.out
20+
21+
.PHONY: all clean

src/Makefile.am

-8
This file was deleted.

src/configure.ac

-20
This file was deleted.

0 commit comments

Comments
 (0)