Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

makefile missing separator

I have a makefile (provided by third party) which gives the following error

Makefile:108: *** missing separator.  Stop.

The line in question is the following if statement.... any ideas? have tried various replacing tabs with spaces and not got very far at all...

if have_sdl
        libiulib_a_SOURCES += $(srcdir)/utils/dgraphics.cc
        libiulib_a_SOURCES += $(srcdir)/utils/SDL_lines.cc
        include_HEADERS += $(srcdir)/utils/SDL_lines.h
else
        libiulib_a_SOURCES += $(srcdir)/utils/dgraphics_nosdl.cc
endif
like image 946
Joe Avatar asked Dec 08 '22 05:12

Joe


2 Answers

Try it this way:

ifneq ($(have_sdl),)
        libiulib_a_SOURCES += $(srcdir)/utils/dgraphics.cc
        libiulib_a_SOURCES += $(srcdir)/utils/SDL_lines.cc
        include_HEADERS += $(srcdir)/utils/SDL_lines.h
else
        libiulib_a_SOURCES += $(srcdir)/utils/dgraphics_nosdl.cc
endif

This checks if have_sdl is non empty (meaning defined to TRUE, yes, 1 or something other than empty string)

like image 86
Aleksei Potov Avatar answered Dec 11 '22 09:12

Aleksei Potov


If there is no space between ifeq and opening of bracket then also it causes the same warning.

it should be ifeq ()

like image 21
sagar zaveri Avatar answered Dec 11 '22 08:12

sagar zaveri