Skip to content

Commit

Permalink
introduce GNU Makefile to build adbd for non-Android targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoann Sculo committed Jul 3, 2014
1 parent f61439d commit 921d4c6
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*~
tags
3 changes: 3 additions & 0 deletions adb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.o
adbd
*.swp
60 changes: 60 additions & 0 deletions adb/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# adbd

SRCS+=adb.c
SRCS+=fdevent.c
SRCS+=transport.c
SRCS+=transport_local.c
SRCS+=transport_usb.c
SRCS+=sockets.c
SRCS+=services.c
SRCS+=file_sync_service.c
SRCS+=jdwp_service.c
SRCS+=framebuffer_service.c
SRCS+=remount_service.c
SRCS+=usb_linux_client.c
SRCS+=log_service.c
SRCS+=utils.c

VPATH+= ../libcutils
SRCS+= array.c
SRCS+= hashmap.c
SRCS+= properties.c
SRCS+= threads.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
SRCS+= load_file.c

CPPFLAGS+= -DADB_HOST=0
CPPFLAGS+= -DHAVE_PTHREADS
CPPFLAGS+= -D_XOPEN_SOURCE -D_GNU_SOURCE
CPPFLAGS+= -fPIC
CPPFLAGS+= -I .
CPPFLAGS+= -I ../include
CPPFLAGS+= -I ../zlib
CPPFLAGS+= -I $(OPENSSL_DIR)/include

CPPFLAGS+= -L $(OPENSSL_DIR)

CFLAGS+= -O2 -g -Wall -Wno-unused-parameter
LDFLAGS= -static

LIBS= -lrt -lpthread -lcrypto -ldl -L $(OPENSSL_DIR)

CC=$(TOOLCHAIN)gcc
LD=$(TOOLCHAIN)gcc
STRIP=$(TOOLCHAIN)strip

OBJS= $(SRCS:.c=.o)

all: adbd

adbd: $(OBJS)
$(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
$(STRIP) adbd

clean:
rm -rf $(OBJS)
19 changes: 19 additions & 0 deletions adb/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
adbd for non-Android devices
----------------------------

To build adbd you need to specify your toolchain and openssl path to build adbd

export TOOLCHAIN=<your_toolchain_path_with_prefix>
export OPENSSL_DIR=<path_to_openssl>
make

Thanks to:

- https://hev.cc/2227.html
- http://android.serverbox.ch/?p=1217
- http://events.linuxfoundation.org/images/stories/pdf/lf_abs12_kobayashi.pdf

Contact
-------

Yoann Sculo <[email protected]>

0 comments on commit 921d4c6

Please sign in to comment.