forked from shakalaca/adb-win64
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.fastboot
155 lines (133 loc) · 3.22 KB
/
makefile.fastboot
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# ADB makefile
# ------------
#TODO change TOOLCHAIN variable to your toolchain path
TOOLCHAIN= /usr/bin/x86_64-w64-mingw32-
CC= $(TOOLCHAIN)gcc
LD= $(TOOLCHAIN)gcc
CXX=$(CC)
LOCAL_PATH:= $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
fastboot_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android
SRCS+= bootimg_utils.c
SRCS+= engine.c
SRCS+= fastboot.c
SRCS+= fs.c
SRCS+= protocol.c
SRCS+= socket.c
SRCS+= tcp.c
SRCS+= udp.c
SRCS+= util.c
SRCS+= usb_windows.c
SRCS+= util_windows.c
SRCS+= ../adb/diagnose_usb.c
VPATH+= ../../../external/zlib/src
SRCS+= adler32.c
SRCS+= compress.c
SRCS+= crc32.c
SRCS+= deflate.c
SRCS+= infback.c
SRCS+= inffast.c
SRCS+= inflate.c
SRCS+= inftrees.c
SRCS+= trees.c
SRCS+= uncompr.c
SRCS+= zutil.c
SRCS+= gzclose.c
SRCS+= gzwrite.c
SRCS+= gzread.c
SRCS+= gzlib.c
VPATH+= ../libutils
SRCS+= FileMap.c
VPATH+= ../base
SRCS+= file.c
SRCS+= logging.c
SRCS+= parsenetaddress.c
SRCS+= stringprintf.c
SRCS+= strings.c
SRCS+= test_utils.c
SRCS+= errors_windows.c
SRCS+= utf8.c
VPATH+= ../libziparchive
SRCS+= zip_archive.c
VPATH+= ../libsparse
SRCS+= backed_block.c
SRCS+= output_file.c
SRCS+= sparse.c
SRCS+= sparse_crc32.c
SRCS+= sparse_err.c
SRCS+= sparse_read.c
VPATH+= ../../extras/ext4_utils/
SRCS+= make_ext4fs.c
SRCS+= ext4fixup.c
SRCS+= ext4_utils.c
SRCS+= allocate.c
SRCS+= contents.c
SRCS+= extent.c
SRCS+= indirect.c
SRCS+= sha1.c
SRCS+= wipe.c
SRCS+= crc16.c
SRCS+= ext4_sb.c
VPATH+= ../liblog
SRCS+= log_event_list.c
SRCS+= log_event_write.c
SRCS+= logger_write.c
SRCS+= config_write.c
SRCS+= logger_name.c
SRCS+= logger_lock.c
SRCS+= fake_log_device.c
SRCS+= fake_writer.c
SRCS+= uio.c
SRCS+= ../libcutils/socket_inaddr_any_server_windows.c
SRCS+= ../libcutils/sockets_windows.c
SRCS+= ../libcutils/sockets.c
SRCS+= ../libcutils/socket_network_client_windows.c
VPATH+= ../../../external/gtest/src
SRCS+= gtest-all.c
CPPFLAGS+= -D_mkdir=mkdir
CPPFLAGS+= -DHAVE_FORKEXEC=1
CPPFLAGS+= -DHAVE_SYS_SOCKET_H
CPPFLAGS+= -D_GNU_SOURCE
CPPFLAGS+= -D_XOPEN_SOURCE
CPPFLAGS+= -DMB_CUR_MAX=1
CPPFLAGS+= -D_WIN32
CPPFLAGS+= -D_WIN32_WINNT=0x0600
CPPFLAGS+= -D__STDC_FORMAT_MACROS=1
CPPFLAGS+= -DHAVE_WIN32_PROC
CPPFLAGS+= -DHAVE_WIN32_IPC
CPPFLAGS+= -DHAVE_WINSOCK
CPPFLAGS+= -DHAVE_OFF64_T
CPPFLAGS+= -DFASTBOOT_REVISION='"$(fastboot_version)"'
CPPFLAGS+= -DADBWIN_EXPORTS
CPPFLAGS+= -D__BEGIN_DECLS=/**/
CPPFLAGS+= -D__END_DECLS=/**/
CPPFLAGS+= -I.
CPPFLAGS+= -I../include
CPPFLAGS+= -I../base/include
CPPFLAGS+= -I../libsparse/include
CPPFLAGS+= -I../../../external/gtest/include
CPPFLAGS+= -I../../../external/gtest
CPPFLAGS+= -I../../../external/zlib
CPPFLAGS+= -I../adb
CPPFLAGS+= -I../mkbootimg
CPPFLAGS+= -I../../extras/ext4_utils
CPPFLAGS+= -I../../extras/f2fs_utils
CXXFLAGS+= -std=gnu++11
CXXFLAGS+= -mno-ms-bitfields
CFLAGS+= -DUSE_MINGW
CFLAGS+= -DZLIB_CONST
CFLAGS+= -DFAKE_LOG_DEVICE=1
CFLAGS+= -DLIBLOG_LOG_TAG=1005
CFLAGS+= -DSNET_EVENT_LOG_TAG=1397638484
CFLAGS+= -std=gnu99
CFLAGS+= -O2 -g -Wall -Wno-unused-parameter
LDFLAGS+= -L.
LDFLAGS+= -static-libstdc++ -static-libgcc
LIBS= -lws2_32
LIBS+= AdbWinUsbApi.dll AdbWinApi.dll
LIBS+= -static -lstdc++
OBJS= $(SRCS:.c=.o)
all: fastboot.exe
fastboot.exe: $(OBJS)
$(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
clean:
rm -rf $(OBJS)