Say, for example, I have a makefile:
front:
cd front && (sudo make -f Makefile.linux ) -- require sudo
back:
cd back && (make -f Makefile.linux )
clean:
cd front && (make -f Makefile.linux clean)
cd back && (make -f Makefile.linux clean)
Is it possible to do it? If yes, what is the right way to do it? Thanks
LJ
Sudo is just a program that allows you to authenticate and then run programs as root. After you authenticate, you are allowed to freely run commands as root through sudo, without having to re-authenticate for a configurable period of time. Any commands that you don't prefix with sudo
will just be run with your regular user's privileges.
If you are expecting this makefile to be used on the command line then this is the correct way to do it. On the other hand, if you want the makefile to be used in a graphical environment, then you may want to use gksu
or gksudo
depending on what distribution you're using.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With