Skip to content

Instantly share code, notes, and snippets.

@swiftgeek swiftgeek/Makefile Secret
Last active Jan 12, 2018

Embed
What would you like to do?
adb package for OpenWRT
SRCS+= adb.c
SRCS+= adb_auth_host.c
SRCS+= adb_client.c
SRCS+= commandline.c
SRCS+= console.c
SRCS+= fdevent.c
SRCS+= file_sync_client.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
VPATH+= ../libcutils
SRCS+= list.c
SRCS+= load_file.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
CPPFLAGS+= -DADB_HOST=1
CPPFLAGS+= -DHAVE_FORKEXEC=1
CPPFLAGS+= -I.
CPPFLAGS+= -I../include
LIBS+= -lcrypto -lpthread -lz
OBJS= $(SRCS:.c=.o)
all: adb
adb: $(OBJS)
$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
include $(TOPDIR)/rules.mk
#Based on adb package from AUR https://aur.archlinux.org/packages/adb/ , reused adbMakefile
PKG_NAME:=adb
PKG_VERSION:=android.4.4.2_r2
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://android.googlesource.com/platform/system/core
PKG_SOURCE_VERSION:=e65b7ea8801145626504c724c28aedd0e5038a28
# PKG_SOURCE_SUBDIR specifies where repo is cloned
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_MAINTAINER:=Swift Geek <swiftgeek at gmail>
include $(INCLUDE_DIR)/package.mk
ifeq ($(CONFIG_BIG_ENDIAN),y)
TARGET_CFLAGS+= -DHAVE_BIG_ENDIAN=1
beinfo: $(info *** Big endian detected, look for -DHAVE_BIG_ENDIAN=1 ***)
endif
define Package/adb
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Android Debug Bridge CLI tool
URL:=http://tools.android.com/
DEPENDS:=+zlib +libopenssl +libpthread
endef
define Package/bridge/description
Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device.
endef
# Add Makefile from AUR
define Build/Prepare
$(call Build/Prepare/Default)
$(CP) ./adbMakefile $(PKG_BUILD_DIR)/adb/Makefile
endef
# Nothing just to be sure
define Build/Configure
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/adb/ \
$(TARGET_CONFIGURE_OPTS) \
TARGET=Linux \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
$(STRIP) $(PKG_BUILD_DIR)/adb/adb
endef
define Package/adb/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/adb/adb $(1)/usr/bin/
endef
$(eval $(call BuildPackage,adb))
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.