On 29 December 2015 at 21:42, Daniel Campoverde Carrión [Alx741] <alx...@riseup.net> wrote: > Hello everyone, > > I'm trying to use autotools for the first time for a simple microntroller > project, one of my Makefile.am files contains this: > > >>PIC_DEVICE=18f4550 >>CC=sdcc >>LD=sdcc >>FLAGS= --use-non-free -mpic16 -p$(PIC_DEVICE) >>AM_CFLAGS = $(FLAGS) >>AM_LDFLAGS= >>override CFLAGS= >> >>COMPILE=$(CC) $(FLAGS) -c -o >>LINK=$(LD) $(FLAGS) -o $@ >> >>noinst_PROGRAMS = firmware.hex >>firmware_hex_SOURCES = firmware.c > > * Notice i've tried (with no success) AM_CFLAGS, AM_LDFLAGS, override CFLAGS
I don't think override CFLAGS means anything. Maybe try taking all of this out of Makefile.am and giving this information on the configure command-line: ./configure CC=sdcc LD=sdcc CFLAGS='--use-non-free -mpic16 -p18f4550' and so on. > I need to compile the code using SDCC compiler with the flags i specified > there, > but when i try `make` i got error because of additional flags being added that > SDCC doesn't recognize: Right, I reckon the configure script isn't seeing what you put in Makefile.am, finds another C compiler and is using flags appropriate for that compiler. Putting CC=sdcc on the command line will let it know. (I believe the error message you're getting is to do with the "dependency style" of the C compiler that was found.)