What is the best way to hardcode the compiler's -D flag into the source files?
I want to put the #define in one of the headers and then import bunch of stuff that should react to that define. Does it work like that? Which header should I put it? Or directly to main.c? Or to all of them?
TMI-details: The environment here is digispark hw-018 (attiny85 with built-in usb programmer) and the #define should replace -DUSE_SOFTWARE_SPI so I can use AVR-CAN library in SPI mode to read stuff from MCP2515.
EDIT: After some annoying banging head to the wall the top of main.c looks now like this and it still does not work.
#define USE_SOFTWARE_SPI
#include "src/can.h"
#define USE_SOFTWARE_SPI
#include <avr/io.h>
#define USE_SOFTWARE_SPI
#include <avr/pgmspace.h>
#define USE_SOFTWARE_SPI
#include <DigiUSB.h>
I am right in saying that there is something that overrides my define somewhere? It works if I hardcode the #define USE_SOFTWARE_SPI just before the #ifndef (or #ifdef)