0

I have tcsh shell. I want to compile once which is VCS and then run multiple testcases using SIMV. Earlier for single test VCS = vcs -sverilog -timescale=1ns/1ps \ +acc +vpi .. and SIMV = ./simv +UVM_VERBOSITY=$(UVM_VERBOSITY) +UVM_TESTNAME=$(TESTNAME) ${vcs_waves_cmd} -l $(TESTNAME).log were defined as constants.

I have to replace $(TESTNAME) by looping on an array.I tried as below by switching to bash but ultimately it is causing other failures such as make cleannot working.

TESTS = ext_reg_write_read reg_write_read 
regress: $(TESTS) 
  $(VCS)\ 
  for t in $(TESTS); do\
./simv +UVM_VERBOSITY=$(UVM_VERBOSITY) +UVM_TESTNAME=$$t ${vcs_waves_cmd} -l $$t.log;\ 
done

Also I would like to add export shell command export SHELL = /bin/csh -f

My question is similar to following – Implementing `make check` or `make test`

I have used @J. C. Salomon 's answer to make this code

Community
  • 1
  • 1
Chandan Choudhury
  • 323
  • 2
  • 3
  • 11
  • Please fix the formatting of your makefile snippet. I tried but you reverted a bunch of it in ways that I don't believe can be correct. – Etan Reisner Nov 07 '14 at 17:43
  • What error *exactly* are you getting? Is make running `tcsh` for your rules? I would expect it to run `/bin/sh` unless you've told it otherwise. – Etan Reisner Nov 07 '14 at 17:43
  • Why is it running three times? You only have two arguments in `TESTS`. – tripleee Nov 07 '14 at 18:18
  • The formatting is still off, you need to show us your code exactly. Edit your question, paste in the real code, select it, hit ctrl-K. – tripleee Nov 07 '14 at 18:21
  • Sorry @Etan Reisner and tripleee . I hope the formatting is correct now. But also I am not able to see the error now().Earlier it was saying like t is not defined in the third pass. I also expect it to run for two times only. – Chandan Choudhury Nov 07 '14 at 19:25
  • So formatting the code correctly has solved the problem? – Etan Reisner Nov 07 '14 at 20:16
  • Sorry I was not getting the difference between the shell earlier – Chandan Choudhury Nov 10 '14 at 07:44

1 Answers1

1

The problem is with export SHELL = /bin/csh -f which I was changing to export SHELL = /bin/bash -f.

But finally SHELL := /bin/bash works as answered in How can I use Bash syntax in Makefile targets? by @derobert

Community
  • 1
  • 1
Chandan Choudhury
  • 323
  • 2
  • 3
  • 11