robinpaulson / SimpleRT

Simple Reverse Tethering utility for Android
GNU General Public License v3.0
899 stars 101 forks source link

Adding install and uninstall targets in Makefile. #26

Closed Sur3 closed 4 years ago

Sur3 commented 7 years ago

Adding install and uninstall targets in Makefile. Ok now it working right.

vvviperrr commented 7 years ago

there is path to iface_up.sh in network.c, needs to be changed too.

Sur3 commented 7 years ago

Ah ok i gone this workaround by using a shellscript to change path for execution. ^^" But you're probably right and changing the path during compilation is more elegant. 👍

Sur3 commented 7 years ago

i tried to update the makefile to include the iface_up path but there is an error now finding the script, i'll fix that in a few hours.. ^^

Sur3 commented 7 years ago

Ok it's working, the problem was just i didn't have "comment" match support in the kernel because that's an extended netfilter option, probably it would be cleaner to just remove the two rules added instead of save/restore with comment filter. ^^ By standard the makefile compiles now with an iface_up.sh path for installing in /usr/local prefix, but the old compile behaviour for same path can be forced with "make iface_up_sh_path=.". I also included a config.mk which is created during compilation of network.c to store the path for later inclusion during install/uninstall. Installing with an other prefix is done with e.g. "make prefix=/usr && make prefix=/usr install" probably a configure-script or cmake (or inclusion of all paths in config.mk) would be a cleaner solution, then one needn't set the prefix twice.

Sur3 commented 7 years ago

I dont know if it's mac compatible though because of the bash commands and i dont have a mac here to test that.

vvviperrr commented 7 years ago

ok, i'll check macOS compatibility. thanks.