diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..29cef09 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +*.o +.deps +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +config.log +config.status +configure +rkdeveloptool +rkdeveloptool*bz2 diff --git a/Makefile b/Makefile deleted file mode 100644 index d7b3444..0000000 --- a/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# Simple Makefile for RK Flash Tool - -CC = g++ -LD = $(CC) -CXXFLAGS= -O2 -Wall -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/usr/include/libusb-1.0 -LDFLAGS = -L/usr/lib -Wl,-Bstatic -lusb-1.0 -Wl,-Bdynamic -ludev -lrt -lpthread - - -PROGS = $(patsubst %.cpp,%.o, $(wildcard *.cpp)) - -rkdeveloptool: $(PROGS) - $(CC) $(CXXFLAGS) $^ -o rkdeveloptool $(LDFLAGS) - -install: $(PROGS) - install -d -m 0755 /usr/local/bin - install -m 0755 ./rkdeveloptool /usr/local/bin - -clean: - rm $(PROGS) ./rkdeveloptool - -uninstall: - cd /usr/local/bin && rm -f ./rkdeveloptool - - diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..47787c1 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,20 @@ +## Copyright (C) 2017 Trevor Woerner + +SUBDIRS = +DIST_SUBDIRS = cfg + +AM_CPPFLAGS = -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE $(LIBUSB1_CFLAGS) + +bin_PROGRAMS = rkdeveloptool +rkdeveloptool_SOURCES = main.cpp \ + crc.cpp DefineHeader.h Endian.h DefineHeader.h Property.hpp \ + RKBoot.cpp RKBoot.h \ + RKComm.cpp RKComm.h \ + RKDevice.cpp RKDevice.h \ + RKImage.cpp RKImage.h \ + RKLog.cpp RKLog.h \ + RKScan.cpp RKScan.h +rkdeveloptool_LDADD = $(LIBUSB1_LIBS) + +clean-local:: + $(RM) -fr log diff --git a/Readme.txt b/Readme.txt index 6c4c041..80a3191 100644 --- a/Readme.txt +++ b/Readme.txt @@ -4,7 +4,9 @@ compile and install 1 install libusb and libudev sudo apt-get install libudev-dev libusb-1.0-0-dev 2 go into root of rkdeveloptool -3 make && make install +3 autoreconf -i +4 ./configure +5 make rkdeveloptool usage,input "rkdeveloptool -h" to see diff --git a/cfg/.gitignore b/cfg/.gitignore new file mode 100644 index 0000000..09f2a98 --- /dev/null +++ b/cfg/.gitignore @@ -0,0 +1,6 @@ +compile +config* +depcomp +install* +missing +stamp* diff --git a/cfg/Makefile.am b/cfg/Makefile.am new file mode 100644 index 0000000..ef8fb97 --- /dev/null +++ b/cfg/Makefile.am @@ -0,0 +1,6 @@ +## Copyright (C) 2017 Trevor Woerner + +######################## +# cfg/Makefile.am +######################## +SUBDIRS = diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..44f4c1f --- /dev/null +++ b/configure.ac @@ -0,0 +1,24 @@ +dnl Copyright (C) 2017 Trevor Woerner + +AC_INIT([Rockchip rkdeveloptool], 1.0, [Eddie Cai ], rkdeveloptool) +AC_PREREQ([2.68]) +AC_CONFIG_SRCDIR(main.cpp) +AC_CONFIG_AUX_DIR(cfg) +AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-bzip2 1.9]) +AM_CONFIG_HEADER(cfg/config.h) + +SUBDIRS="" + +AC_PROG_CPP +AC_PROG_CXX +AC_PROG_CXXCPP +AC_PROG_MAKE_SET +AC_PROG_INSTALL +AC_PROG_LN_S + +PKG_CHECK_MODULES(LIBUSB1,libusb-1.0) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([cfg/Makefile]) + +AC_OUTPUT diff --git a/main.cpp b/main.cpp index 6da93ec..0b04ef8 100644 --- a/main.cpp +++ b/main.cpp @@ -13,6 +13,7 @@ #include "RKComm.h" #include "RKDevice.h" #include "RKImage.h" +#include "config.h" extern const char *szManufName[]; CRKLog *g_pLogObject=NULL; CONFIG_ITEM_VECTOR g_ConfigItemVec; @@ -758,7 +759,7 @@ bool handle_command(int argc, char* argv[], CRKScan *pScan) usage(); return true; } else if(strcmp(strCmd.c_str(), "-V") == 0) { - printf("rkDevelopTool ver 1.0\r\n"); + printf("rkDevelopTool ver %s\r\n", PACKAGE_VERSION); return true; } cnt = pScan->Search(RKUSB_MASKROM | RKUSB_LOADER);