jordansissel/grok — Issue #8: Build fails with Makefile on Ubuntu 11.10
Author: wiibaa
Created: 2011-12-16 07:07:20+00:00
State: open

Hello,
I tried to report this issue on the google groups already,
but in the meantime I made some more googling and found out why + solution.
But as I'm not a gcc/make expert, it is best for you to review it than for me to make a pull request.

So as I understood, the issue comes from gcc4.6 being more restrictive on the LDFLAGS position,
I found a similar bug report on another project, applied the same change (moving LDFLAGS to end of line) in your Makefile and it worked for me.
https://github.com/bumptech/stud/pull/62#commits-pushed-3656b32

So in the grok and dicogrok directive, I changed
$(CC) $(LDFLAGS) $^ -o $@
to
$(CC) $^ -o $@ $(LDFLAGS)

and in the libgrok.$(LIBSUFFIX):, I changed
$(CC) $(LDFLAGS) -fPIC $(DYNLIBFLAG) $(LIBNAMEFLAG) $^ -o $@
to
$(CC) -fPIC $(DYNLIBFLAG) $(LIBNAMEFLAG) $^ -o $@ $(LDFLAGS)

I found the explanation here:
http://ubuntuforums.org/showthread.php?t=1859400