Answer the question
In order to leave comments, you need to log in
How to use bash inside a Makefile?
I'm trying to write a test section:
BINNAME = passgen
BIN_DIR = ./bin
...
test:
make
@len=$($(BIN_DIR)/$(BINNAME) -l20 -ds | wc -m)
@[ $$len -eq '21' ] && echo "[PASSGEN TEST] OK" || echo "[PASSGEN TEST] ERROR"
$ make test
/bin/bash: строка 0: [: -eq: ожидается использование унарного оператора
[PASSGEN TEST] ERROR
Answer the question
In order to leave comments, you need to log in
Solved the problem like this:
test:
make
@test $$($(BINDIR)/$(BINNAME) -l20 -ds | wc -m) == '21' && echo "[PASSGEN TEST] OK" || echo "[PASSGEN TEST] ERROR"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question