Menu

#20 Small Makefile issue causes compile issues on some Linux targets

v1.0.12
closed-fixed
nobody
None
5
2017-03-05
2016-12-07
No

There's a small makefile issue that particularly causes issues when compiling on gcc 4.9.2 on a Raspberry Pi. The pattern rule in the Makefile for creating .o files from .c files is missing the "." before the file extension. This is causing Make (at least on that system) to call 'cc' instead of 'gcc' and not pass the arguments, which fails to compile because it is then missing the -std=c99 flag.

This is fixed by changing the pattern rule from this:

%o : %c
    gcc -c $(CPFLAGS) $< -o $@

To this:

%.o : %.c
   gcc -c $(CPFLAGS) $< -o $@

Making this simple change of making it "%.o : %.c" allows it to compile and work correctly on the Raspberry Pi and should continue to be correct on other platforms too.

Discussion

  • Jacques Pelletier

    I'll make the change in the next release. Thanks!

     
  • Jacques Pelletier

    • status: open --> closed-fixed