Updated warnroot and checkroot Commands
Updated the Makefile.in to check if the `id` utility exists on the platform, otherwise skip the root check.
This commit is contained in:
parent
9b6bb3ecbf
commit
1d2114cbe0
1 changed files with 10 additions and 4 deletions
14
Makefile.in
14
Makefile.in
|
|
@ -66,12 +66,18 @@ all: $(SUBDIRS2) warnroot
|
||||||
@echo "\e[32mAfter 'make install' as euid root, build example app and test utils: 'make example'\e[0m"
|
@echo "\e[32mAfter 'make install' as euid root, build example app and test utils: 'make example'\e[0m"
|
||||||
|
|
||||||
checkroot:
|
checkroot:
|
||||||
@if [ "$${DESTDIR}" = "" -a $$(id -u) != "0" ]; \
|
@if command -v id &> /dev/null; then \
|
||||||
then echo "\e[31mThis target must be made as euid root\e[0m"; exit 1; fi;
|
if [ "$${DESTDIR}" = "" -a $$(id -u) != "0" ]; then \
|
||||||
|
echo "\e[31mThis target must be made as euid root\e[0m"; exit 1; \
|
||||||
|
fi; \
|
||||||
|
fi;
|
||||||
|
|
||||||
warnroot:
|
warnroot:
|
||||||
@if [ $$(id -u) = 0 ]; \
|
@if command -v id &> /dev/null; then \
|
||||||
then echo "\e[36mWarning: You built this target as uid root\e[0m"; exit 0; fi;
|
if [ $$(id -u) = 0 ]; then \
|
||||||
|
echo "\e[36mWarning: You built this target as uid root\e[0m"; exit 0; \
|
||||||
|
fi; \
|
||||||
|
fi;
|
||||||
|
|
||||||
checkinstall:
|
checkinstall:
|
||||||
@if [ ! -f $(prefix)/include/clixon/clixon.h ]; then \
|
@if [ ! -f $(prefix)/include/clixon/clixon.h ]; then \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue