Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Makefile for adb
SRCS+= adb.c
SRCS+= adb_client.c
SRCS+= commandline.c
SRCS+= console.c
SRCS+= file_sync_client.c
SRCS+= fdevent.c
SRCS+= get_my_path_linux.c
SRCS+= services.c
SRCS+= sockets.c
SRCS+= transport.c
SRCS+= transport_local.c
SRCS+= transport_usb.c
SRCS+= usb_linux.c
SRCS+= usb_vendors.c
SRCS+= utils.c
VPATH+= ../libcutils
SRCS+= abort_socket.c
SRCS+= socket_inaddr_any_server.c
SRCS+= socket_local_client.c
SRCS+= socket_local_server.c
SRCS+= socket_loopback_client.c
SRCS+= socket_loopback_server.c
SRCS+= socket_network_client.c
VPATH+= ../libzipfile
SRCS+= centraldir.c
SRCS+= zipfile.c
VPATH+= ../../../external/zlib
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
CPPFLAGS+= -DADB_HOST=1
CPPFLAGS+= -DHAVE_FORKEXEC=1
CPPFLAGS+= -DHAVE_SYMLINKS
CPPFLAGS+= -DHAVE_TERMIO_H
CPPFLAGS+= -D_GNU_SOURCE
CPPFLAGS+= -D_XOPEN_SOURCE
CPPFLAGS+= -I.
CPPFLAGS+= -I../include
CPPFLAGS+= -I../../../external/zlib
CFLAGS+= -O2 -g -Wall -Wno-unused-parameter
LDFLAGS= -static
LIBS= -lrt -lpthread
TOOLCHAIN= arm-none-linux-gnueabi-
CC= $(TOOLCHAIN)gcc
LD= $(TOOLCHAIN)gcc
OBJS= $(SRCS:.c=.o)
all: adb
adb: $(OBJS)
$(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
clean:
rm -rf $(OBJS)
@wuzhenda

This comment has been minimized.

Copy link

commented Sep 17, 2014

did you update for android adb RSA?

@cstratton

This comment has been minimized.

Copy link

commented Feb 15, 2015

I've modified this to build a more recent version of ADB which supports the security features. Doesn't seem to work with the latest, but works with a "recent enough" version identified within.

https://gist.github.com/cstratton/2d3be0682f3c5312a5cd

@cantren

This comment has been minimized.

Copy link

commented Feb 20, 2015

I had to change "TOOLCHAIN= arm-none-linux-gnueabi-" to "TOOLCHAIN= arm-linux-gnueabihf-" to get the "make" command to run.

I ended up downloading the Makefile to /system/core/adb/ and running "make" from there.

Device: Acer CB5-311-T7NN
Crouton Install: sh -e ~/Downloads/crouton -r kali -t xfce

@gutschke

This comment has been minimized.

Copy link

commented Mar 16, 2016

I needed ARM binaries for version 1.0.32+ of adb and for fastboot. Turns out, nobody has them; at least I came up empty-handed when searching the web.

So, I used your Makefile as a basic inspiration to figure out how to build version 1.0.35. If anybody else needs these files, I put as snapshot at https://github.com/gutschke/adb-fastboot

I hope this will be useful to others, too. I make no promise as to maintaining these binaries, but they filled my needs.

If you use these files in order to flash an Android device using a Chromebook, please note the information given in https://www.reddit.com/r/Android/comments/49lcfb/psa_when_updating_nexus_devices_via_fastboot_make/ Chromebooks have limited amounts of RAM and because of that don't always run "fastboot update ..." to completion.

@andrewleo

This comment has been minimized.

Copy link

commented Jul 6, 2017

Does anyone have build adb-ar, version 1.0.39?

@parkerlreed

This comment has been minimized.

Copy link

commented Aug 9, 2018

Or now 1.0.40. I hate all these 2-3 year old outdated adb/fastboot binaries (ARM).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.