Thursday, April 10, 2014

Programming Pocketbook - jumpstart script

As you may know, it's possible to build apps for some older Pocketbook models, that run Linux. There are 2 SDKs for that, that I'm aware of - official and unofficial one, the latter being much more popular. Unfortunately that SDK comes with no templates. So to start development from scratch, you have to manually create a bunch of file yourself, like the makefile and the source code file, which is not fine in the XXI century. To automate the process, I created this small shell script, which creates them for you, using a name you specify:
#!/bin/bash

echo "Input project name:"

read proj_name

mkdir $proj_name
mk_file_name=$proj_name".mk"
c_file_name=$proj_name".c"
master_makefile_name="Makefile"

cd $proj_name
echo "SOURCES += "$proj_name".c" > $mk_file_name

echo "OUT = "$proj_name > $master_makefile_name
echo "include /usr/local/pocketbook/common.mk" >> $master_makefile_name

echo -e "#include \"inkview.h\"\n\nint main(int argc, char **argv)\n{\nreturn 0;\n}" > $c_file_name
Hope it hepls you too.

No comments:

Post a Comment