This repository has been archived by the owner on Feb 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
/
makefile.cargo
100 lines (74 loc) · 2.01 KB
/
makefile.cargo
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
FLAGS := ""
# On MSVC, no -FPIC
ifeq (,$(findstring windows-msvc,$(TARGET)))
FLAGS += -fPIC
endif
ifeq (armv7-linux-androideabi,$(TARGET))
# Reset TARGET variable because armv7 target name used by Rust is not
# the same as the target name needed for the CXX toolchain.
TARGET = arm-linux-androideabi
FLAGS += -march=armv7-a -mfpu=neon --target=$(TARGET)
endif
ifneq ($(HOST),$(TARGET))
CXX ?= $(TARGET)-g++
CC ?= $(TARGET)-gcc
AR ?= $(TARGET)-ar
else
CXX ?= g++
CC ?= gcc
AR ?= ar
endif
CONFIGURE_FLAGS := \
--host=$(TARGET)
ifeq (android,$(findstring android,$(TARGET)))
CONFIGURE_FLAGS += \
--with-default-fonts=/system/fonts \
--with-cache-dir=/sdcard/servo/.fccache \
$(NULL)
endif
# Fix up OUT_DIR paths on Windows
ifeq (windows,$(findstring windows,$(TARGET)))
OUT_DIR := $(shell cygpath "$(OUT_DIR)")
endif
CFLAGS += $(FLAGS)
CXXFLAGS += $(FLAGS)
ifneq (android,$(findstring android,$(TARGET)))
CONFIGURE_FLAGS += \
--sysconfdir=/etc \
--localstatedir=/var \
$(NULL)
endif
ifneq (darwin,$(findstring darwin,$(TARGET)))
SRC_DIR = $(shell pwd)
all: $(OUT_DIR)/libfontconfig.a
$(OUT_DIR)/libfontconfig.a: $(OUT_DIR)/Makefile
cd $(OUT_DIR) && make -j$(NUM_JOBS)
cp $(OUT_DIR)/src/.libs/libfontconfig.a $(OUT_DIR)
EXPAT_INCLUDE_DIR ?= $(DEP_EXPAT_OUTDIR)/include
EXPAT_LIB_DIR ?= $(DEP_EXPAT_OUTDIR)/lib
ifneq ($(HOST),$(TARGET))
EXPAT_FLAGS = --with-expat-includes="$(EXPAT_INCLUDE_DIR)" \
--with-expat-lib="$(EXPAT_LIB_DIR)"
FREETYPE_CFLAGS ?= -I$(DEP_FREETYPE_OUTDIR)/include/freetype2
FREETYPE_LIBS ?= -L$(DEP_FREETYPE_OUTDIR)/lib -lfreetype
else
EXPAT_FLAGS =
FREETYPE_CFLAGS =
FREETYPE_LIBS =
endif
$(OUT_DIR)/Makefile:
cd $(OUT_DIR) && \
CC="$(CC)" \
AR="$(AR)" \
FREETYPE_CFLAGS="$(FREETYPE_CFLAGS)" \
FREETYPE_LIBS="$(FREETYPE_LIBS)" \
CFLAGS="$(CFLAGS)" \
$(SRC_DIR)/configure \
--disable-docs \
--disable-shared \
$(EXPAT_FLAGS) \
$(strip $(CONFIGURE_FLAGS)) && \
touch $(SRC_DIR)/src/fcobjshash.h
else
all:
endif