I am testing the avr-gcc -combine -fwhole-program flags, and copied bits from the example makefile.wpo in winavr. But the example doesn't take .S asm files in account.
This is what the example makefile has:
%.elf: $(SRC) @echo @echo $(MSG_COMPILING_AND_LINKING) $@ $(CC) -combine -fwhole-program $(ALL_CFLAGS) $(LDFLAGS) $^ --output $@
If I just add the asm files $(ASRC) as another dependency, the compiler errors out with "cc1: error: too many filenames given". Perhaps I could first build the .S files into a static library and then add another -l to LDFLAGS to get them into the program.
Any simpler ways to achieve this with whole program optimization on the .c files?