summaryrefslogtreecommitdiffstats
path: root/test/module.defs
blob: 33bee3111aac1873435f4f95f18a4dd43e6dea30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
$(eval $(call import.MODULE.defs,TEST,test,LIBHB))
$(eval $(call import.GCC,TEST))

TEST.src/   = $(SRC/)test/
TEST.build/ = $(BUILD/)test/

TEST.c   = $(wildcard $(TEST.src/)*.c)
TEST.c.o = $(patsubst $(SRC/)%.c,$(BUILD/)%.o,$(TEST.c))

TEST.exe = $(BUILD/)$(call TARGET.exe,$(HB.name)CLI)

TEST.GCC.L = $(CONTRIB.build/)lib

TEST.libs = $(LIBHB.a)

TEST.GCC.l = \
        ass avformat avfilter avcodec avutil swresample postproc mp3lame dvdnav \
        dvdread fribidi swscale vpx theoraenc theoradec vorbis vorbisenc ogg \
        x264 bluray freetype xml2 bz2 z jansson harfbuzz opus speex lzma dav1d \
        turbojpeg

ifeq (,$(filter $(HOST.system),darwin cygwin mingw))
    TEST.GCC.l += fontconfig
endif

ifeq (1,$(FEATURE.qsv))
    TEST.GCC.l += mfx
ifneq (,$(filter $(HOST.system),linux freebsd))
    TEST.GCC.l += va va-drm
endif
endif

ifeq (1,$(FEATURE.flatpak))
    TEST.GCC.l += glib-2.0
endif

TEST.GCC.l += $(foreach m,$(MODULES.NAMES),$($m.OSL.libs))

TEST.install.exe = $(DESTDIR)$(PREFIX/)bin/$(notdir $(TEST.exe))
ifeq (1,$(FEATURE.flatpak))
    TEST.metainfo.template = $(TEST.src/)fr.handbrake.HandBrakeCLI.metainfo.xml.template
    TEST.metainfo = $(TEST.build/)fr.handbrake.HandBrakeCLI.metainfo.xml
    TEST.install.metainfo = $(DESTDIR)$(PREFIX/)share/metainfo/$(notdir $(TEST.metainfo))
endif

###############################################################################

TEST.out += $(TEST.c.o)
TEST.out += $(TEST.exe)
ifeq (1,$(FEATURE.flatpak))
    TEST.out += $(TEST.metainfo)
endif

BUILD.out += $(TEST.out)
BUILD.out += $(TEST.install.exe)
ifeq (1,$(FEATURE.flatpak))
    BUILD.out += $(TEST.install.metainfo)
endif

###############################################################################

TEST.GCC.I += $(LIBHB.GCC.I)

ifeq ($(HOST.system),darwin)
    TEST.GCC.f += IOKit CoreServices CoreText CoreGraphics AudioToolbox VideoToolbox CoreMedia CoreVideo Foundation
    TEST.GCC.l += iconv
else ifeq ($(HOST.system),linux)
    TEST.GCC.l += pthread dl m
ifeq (1, $(FEATURE.numa))
    TEST.GCC.l += numa
endif
else ifeq ($(HOST.system),kfreebsd)
    TEST.GCC.l += pthread dl m
else ifneq (,$(filter $(HOST.system),freebsd netbsd))
    TEST.GCC.L += $(LOCALBASE)/lib
    TEST.GCC.l += pthread m
else ifeq ($(HOST.system),solaris)
    TEST.GCC.l += pthread nsl socket
ifneq (,$(filter $(HOST.release),2.10))
    TEST.GCC.l += iconv
endif
    TEST.GCC.D += _POSIX_C_SOURCE=200112L __EXTENSIONS__
else ifeq (1-mingw,$(HOST.cross)-$(HOST.system))
ifeq ($(HAS.dlfcn),1)
    TEST.GCC.l += dl
endif
ifeq (1,$(HAS.pthread))
    TEST.GCC.l += pthread
else
    TEST.GCC.l += pthreadGC2
endif
    TEST.GCC.l += bcrypt iconv ws2_32 regex uuid ole32
    TEST.GCC.D += PTW32_STATIC_LIB
    TEST.GCC.args.extra.exe++ += -static
endif #   (1-mingw,$(HOST.cross)-$(HOST.system))