extraneous end if in .dep.inc file

773 Views Asked by At

I am giving a job to Jenkins to build binaries for my code through make file . It is showing error of extraneous end if in .dep.inc file,I tried to change the configuration of net beans.

This file is getting generated from auto generated make file in net beans. In net beans it is compiling but in Jenkins it is showing error.*

# dependency checking support
.depcheck-impl:
    @echo "# This code depends on make tool being used" >.dep.inc
    @if [ -n "${MAKE_VERSION}" ]; then \
        echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
        echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
        echo "include \$${DEPFILES}" >>.dep.inc; \
        echo "endif" >>.dep.inc; \
    else \
        echo ".KEEP_STATE:" >>.dep.inc; \
        echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
    fi
1

There are 1 best solutions below

0
Jamil KR On

you are using BASH syntax instead of Makefile. One option could be to use the conditional structure of Makefile: Conditional Parts of Makefiles

Another way is to define the whole BASH instruction in the same line, like that:

if [ <condition>]; then <action1>; else <action2>; fi

In Makefile, each line of a target could be a SHELL, but you should not split them.

Finally, you can use the "define" environment to insert BASH code:

define <name>=
<BASH code>
<...>
<name>: ; @$(value <name>)
.ONESHELL

I hope you find it useful!