question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on line 111 of Makefile trying to set TOPLEVEL_LANG

See original GitHub issue

This Makefile:

CWD=$(shell pwd)
COCOTB_REDUCED_LOG_FMT = True
SIM ?= icarus
VERILOG_SOURCES =$(CWD)/hdl/verilog/tinyalu.sv
VHDL_SOURCES = $(CWD)/hdl/vhdl/single_cycle_add_and_xor.vhd	\
$(CWD)/hdl/vhdl/three_cycle_mult.vhd \
$(CWD)/hdl/vhdl/tinyalu.vhd
MODULE := tinyalu_cocotb
TOPLEVEL := tinyalu
# TOPLEVEL_LANG := verilog
COCOTB_HDL_TIMEUNIT=1us
COCOTB_HDL_TIMEPRECISION=1us

Gives this error

/home/rsalemi/.local/lib/python3.7/site-packages/cocotb/share/makefiles/Makefile.inc:111: *** invalid syntax in conditional.  

Meaning this code:

ifeq ($(TOPLEVEL_LANG),)

ifneq ($(and $(VHDL_SOURCES),$(if $(VERILOG_SOURCES),,1),)
	TOPLEVEL_LANG := vhdl
else ifneq ($(and $(VERILOG_SOURCES),$(if $(VHDL_SOURCES),,1),)
	TOPLEVEL_LANG := verilog
endif

endif

I do note see the error on Macos only Centos:

orw-salemi-vm:~/repos/blog_examples/cocotb>  cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
orw-salemi-vm:~/repos/blog_examples/cocotb>
orw-salemi-vm:~/repos/blog_examples/cocotb>  make --version
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
orw-salemi-vm:~/repos/blog_examples/cocotb>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
huang-jlcommented, Apr 27, 2021

The problem is because the brackets do not match in Makefile.inc:111:

ifneq ($(and $(VHDL_SOURCES),$(if $(VERILOG_SOURCES),,1),)
	TOPLEVEL_LANG := vhdl
else ifneq ($(and $(VERILOG_SOURCES),$(if $(VHDL_SOURCES),,1),)
	TOPLEVEL_LANG := verilog
endif

It should look like this instead

ifneq ($(and $(VHDL_SOURCES),$(if $(VERILOG_SOURCES),,1)),)
	TOPLEVEL_LANG := vhdl
else ifneq ($(and $(VERILOG_SOURCES),$(if $(VHDL_SOURCES),,1)),)
	TOPLEVEL_LANG := verilog
endif
0reactions
imphilcommented, May 4, 2021

This bug should be fixed on master and fixed in 1.5.2.

(General note: closing the bug as soon as a problem is fixed on master is the right approach. If we want a backport to a release branch, create a separate issue for the backport, please.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

make: *** [ ] Error 1 error - gcc - Stack Overflow
So in order to attack the problem, the error message from gcc is required. Paste the command in the Makefile directly to the...
Read more >
Error Messages (GNU make)
This means the first thing in the makefile seems to be part of a recipe: it begins with a recipe prefix character and...
Read more >
12. Debugging Makefiles - Managing Projects with GNU Make ...
GNU make provides some help with various built-in functions and command-line options. One of the best ways to debug a makefile is to...
Read more >
Command not found cc, make error 127 - Ask Ubuntu
I am trying to install shc on Ubuntu 18.04
Read more >
GNU Make - Writing Makefiles - MIT
Another such occasion is when you want to generate dependencies from source files automatically; the dependencies can be put in a file that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found