summaryrefslogtreecommitdiff
path: root/devel/android-tools-fastboot-devel/files/Makefile
blob: c90b8ac76fdfe29e281ca0df0bd6c04045aaade2 (plain) (blame)
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
106
107
108
109
110
111
112
# $FreeBSD$

PROG_CXX=fastboot
BINDIR?=/usr/bin
FILESDIR?=${DOCDIR}/${PROG}

FILES=	*.[Tt][Xx][Tt]

SRCS+=	bootimg_utils.cpp
SRCS+=	engine.cpp
SRCS+=	fastboot.cpp
SRCS+=	fs.cpp
SRCS+=	protocol.cpp
SRCS+=	util.cpp

.PATH: ${EXTRADIR}
SRCS+=	usb_freebsd.cpp
SRCS+=	util_freebsd.cpp

# required by fastboot and libziparchive
.PATH: ${.CURDIR}/../base
SRCS+=	file.cpp
SRCS+=	strings.cpp

# required by fastboot
.PATH: ${.CURDIR}/../ext4_utils
SRCS+=	allocate.c
SRCS+=	contents.c
SRCS+=	crc16.c
SRCS+=	ext4_sb.c
SRCS+=	ext4_utils.c
SRCS+=	ext4fixup.c
SRCS+=	extent.c
SRCS+=	indirect.c
SRCS+=	make_ext4fs.c
SRCS+=	sha1.c
SRCS+=	wipe.c

# required by base and libutils
.PATH:	${.CURDIR}/../liblog
SRCS+=	fake_log_device.c
SRCS+=	logd_write.c
CPPFLAGS.logd_write.c+=	-DFAKE_LOG_DEVICE=1

# required by ext4_utils
.PATH:	${.CURDIR}/../libselinux/src
SRCS+=	callbacks.c
SRCS+=	check_context.c
SRCS+=	freecon.c
SRCS+=	init.c
SRCS+=	label.c
SRCS+=	label_android_property.c
SRCS+=	label_file.c
SRCS+=	label_support.c
CPPFLAGS.label_file.c+=	-D_WITH_GETLINE

# required by fastboot and ext4_utils
.PATH:	${.CURDIR}/../libsparse
SRCS+=	backed_block.c
SRCS+=	output_file.c
SRCS+=	sparse.c
SRCS+=	sparse_crc32.c
SRCS+=	sparse_err.c
SRCS+=	sparse_read.c

# required by libziparchive
.PATH: ${.CURDIR}/../libutils
SRCS+=	FileMap.cpp

# required by fastboot
.PATH:	${.CURDIR}/../libziparchive
SRCS+=	zip_archive.cc

REVISION?=	$$(${GIT} rev-parse --short=12 HEAD 2>/dev/null || echo unknown)

CPPFLAGS+=	-DFASTBOOT_REVISION="\"${REVISION}-android\""
CPPFLAGS+=	-Doff64_t=off_t
CPPFLAGS+=	-Dftruncate64=ftruncate
CPPFLAGS+=	-Dlseek64=lseek
CPPFLAGS+=	-Dmmap64=mmap
CPPFLAGS+=	-Dpread64=pread
CPPFLAGS+=	-I${.CURDIR}
CPPFLAGS+=	-I${.CURDIR}/../include
CPPFLAGS+=	-I${.CURDIR}/../mkbootimg
CPPFLAGS+=	-I${.CURDIR}/../base/include
CPPFLAGS+=	-I${.CURDIR}/../ext4_utils
CPPFLAGS+=	-I${.CURDIR}/../f2fs_utils
CPPFLAGS+=	-I${.CURDIR}/../libselinux/include
CPPFLAGS+=	-I${.CURDIR}/../libsparse/include
CPPFLAGS+=	${CPPFLAGS.${.IMPSRC:T}}
CPPFLAGS+=	$$(${PKG_CONFIG} libpcre --cflags 2>/dev/null)
CPPFLAGS+=	$$(${PKG_CONFIG} libusb-1.0 --cflags 2>/dev/null)
CXXFLAGS+=	-D__STDC_LIMIT_MACROS # DragonFly
CXXFLAGS+=	-std=gnu++11

.ifndef COMPILE.c
CFLAGS+=	${CPPFLAGS}
CXXFLAGS+=	${CPPFLAGS}
.endif

LDADD+=	$$(${PKG_CONFIG} libpcre --libs 2>/dev/null || echo -lpcre)
LDADD+=	$$(${PKG_CONFIG} libusb-1.0 --libs 2>/dev/null || echo -lusb)
LDADD+=	-lz
DPADD+=	${LIBPCRE} ${LIBUSB} ${LIBZ}

GIT?=		git
PKG_CONFIG?=	pkg-config

beforeinstall:
	${INSTALL} -d ${DESTDIR}${FILESDIR}

.include <bsd.prog.mk>