[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: generate a File-ID??

From: Greg Chicares
Subject: Re: generate a File-ID??
Date: Mon, 03 Jul 2006 20:48:10 +0000
User-agent: Thunderbird (Windows/20060516)

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]