On 2006-7-3 18:58 UTC, Torsten Mohr wrote:
> 
> in a large project with several source files (in C) for an
> embedded target with not much ROM we want to use a self-written
> "assert" that does not print out the file name (too much program
> space) but uses a "file ID" that i want to hand over to the
> compiler when generating the object file.
[...]
> obj/%.o : %.c
>         $(CC) -DF_ID=F_ID_$(subst .,_,$<)
> 
> If then F_ID_main_c := 1 the compiler option should expand to
> -DF_ID=1 for "main.c".

Why not do this completely outside of the makefile? For example, add
  #define FI_D 1
at the top of file 'main.c', and at the bottom
  #undef FI_D



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to