ifeq
is a make command. All lines in the makefile (in a recipe context) are passed to the shell. So make is passing ifeq
to the shell and the shell is telling you that it has no idea what you're talking about.
You should write this using shell syntax, not make syntax.
Also it's rarely useful to use $(shell ...)
functions inside a make recipe. The make recipe will be run by the shell, so when you use $(shell ...)
you're just doubling the amount of shells that are running. Plus a command like $(shell ls -l)
is not going to work, because $(shell ...)
is like backtick and replaces the function with the stdout of the command. That'll be an error in this situation.
I would write it as:
postinstall:
@echo "$(OS)"
@case '$(OS)' in \
(*Debian*) \
echo "Estoy dentro del if"; \
/etc/init.d/udev restart ;; \
(*) \
echo "Estoy dentro del else"; \
ls -l ;; \
esac