Skip to content

Instantly share code, notes, and snippets.

Created May 6, 2011 02:17
Show Gist options
  • Save splhack/958335 to your computer and use it in GitHub Desktop.
Save splhack/958335 to your computer and use it in GitHub Desktop.
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+= -I../include
CPPFLAGS+= -I../../../external/zlib
CFLAGS+= -O2 -g -Wall -Wno-unused-parameter
LDFLAGS= -static
LIBS= -lrt -lpthread
TOOLCHAIN= arm-none-linux-gnueabi-
OBJS= $(SRCS:.c=.o)
all: adb
adb: $(OBJS)
$(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
rm -rf $(OBJS)
Copy link

did you update for android adb RSA?

Copy link

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.

Copy link

cantren 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

Copy link

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

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 Chromebooks have limited amounts of RAM and because of that don't always run "fastboot update ..." to completion.

Copy link

Does anyone have build adb-ar, version 1.0.39?

Copy link

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

Copy link

EugenNY commented Aug 17, 2022

I wrote this years ago:
and just updated it, summary:

Raspbian 10/buster which offers gcc 8.3.0. It also comes with adb v1.0.39, 1:8.1.0+r23-5. And to my surprise, Raspbian 11/bullseye actually includes adb v1.0.41, 28.0.2-debian. Even better, bullseye is also available for arm64 now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment