summaryrefslogtreecommitdiffstats
path: root/tools/depends/native/Makefile
blob: 800270f8a3a445d2c486232ee824439e302bba34 (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
96
97
98
99
100
101
102
103
104
105
include ../Makefile.include

ifneq ($(shell test -f $(NATIVEPREFIX)/share/config.site && echo 1),1)
  $(error Error: $(NATIVEPREFIX)/share/config.site  is missing. Please reconfigure depends to generate it)
endif

# Keep in alphabetical order
NATIVE= \
  autoconf \
  autoconf-archive \
  automake \
  cmake \
  gas-preprocessor \
  gettext \
  giflib \
  heimdal \
  JsonSchemaBuilder \
  libjpeg-turbo \
  liblzo2 \
  libpng \
  libtool \
  m4 \
  meson \
  nasm \
  ninja \
  openssl \
  pcre \
  perlmodule-parseyapp \
  pkg-config \
  python3 \
  swig \
  TexturePacker \
  zlib

ifneq ($(NATIVE_OS),osx)
  NATIVE += libffi
  LIBFFI = libffi
endif

ifeq ($(OS),darwin_embedded)
  NATIVE += dpkg xz tar ldid
endif

ifeq ($(OS),linux)
  NATIVE += expat wayland-scanner pugixml waylandpp-scanner
  EXPAT = expat

  ifeq ($(RENDER_SYSTEM),gles)
    NATIVE += MarkupSafe Mako
  endif
endif

.PHONY: $(NATIVE) native

all: native
	@echo "Dependencies built successfully."

# Dependency layout for parallel builds
autoconf-archive: autoconf
autoconf: m4
automake: autoconf
dpkg: automake gettext libtool pkg-config tar
heimdal: libtool
JsonSchemaBuilder: automake
libjpeg-turbo: cmake nasm
libpng: zlib automake
libtool: automake
Mako: MarkupSafe
meson: python3
ninja: meson
openssl: zlib
pugixml: cmake
python3: $(EXPAT) $(LIBFFI) pkg-config zlib openssl autoconf-archive
swig: pcre
tar: xz automake
TexturePacker: automake pkg-config libpng liblzo2 giflib libjpeg-turbo
wayland-scanner: expat pkg-config
waylandpp-scanner: cmake pugixml

# python installs are not thread safe when using easy_install method.
# MarkupSafe doesn't really depend on ninja but we need to make the
# build sequential
MarkupSafe: ninja

#liblzo2 has stale packaged automake files that cause borked host/build detection
liblzo2: automake

native: $(NATIVE)
$(NATIVE):
	$(MAKE) -C $@
clean:
	for d in $(NATIVE); do $(MAKE) -C $$d clean; done

# Debug target, this will DELETE all data in staging!
test-dependencies:
	( for d in $(NATIVE); do \
	rm -rf $(NATIVEPREFIX); \
        mkdir -p $(NATIVEPREFIX)/include $(NATIVEPREFIX)/share $(NATIVEPREFIX)/bin; \
	cp -f config.site $(NATIVEPREFIX)/share/; \
	$(MAKE) distclean; \
	$(MAKE) $$d; done ) && echo "$@ built successfully"

distclean::
	for d in $(NATIVE); do $(MAKE) -C $$d distclean; done