List Info

Thread: GNU Make: check if a file or directory exists




GNU Make: check if a file or directory exists
user name
2006-05-05 18:43:28
Hello,

Is there a way I can check myself for the existence of a
file or 
directory in make and provide specific error message for my
users?

For example if the user calls:
    make build_vxworks

I would like a message that says:
    You have not generated source code for any vxworks
targets. Please 
... blah blah blah ...

I hope this makes sense ... I am digging thru examples but
not finding 
what i need ...

Cheers,

Jim


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make
GNU Make: check if a file or directory exists
user name
2006-05-05 19:39:47
%% Jim <jimdonsympatico.ca> writes:

  j> Is there a way I can check myself for the existence
of a file or 
  j> directory in make and provide specific error message
for my users?

  j> For example if the user calls:
  j>     make build_vxworks

  j> I would like a message that says:
  j>     You have not generated source code for any
vxworks targets. Please 
  j> ... blah blah blah ...

There are really lots of ways to do this, depending on
exactly what you
want to do... which isn't well-defined above.

But, for example:

  $(if $(wildcard $(SRCS)),,$(fatal You have not generated
source code...))

-- 
------------------------------------------------------------
-------------------
 Paul D. Smith <psmithgnu.org>          Find
some GNU make tips at:
 http://www.gnu.org        
             http://make.paulandlesl
ey.org
 "Please remain calm...I may be mad, but I am a
professional." --Mad Scientist


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make
GNU Make: check if a file or directory exists
user name
2006-05-05 19:44:25
Paul D. Smith wrote:
> %% Jim <jimdonsympatico.ca> writes:
>
>   j> Is there a way I can check myself for the
existence of a file or 
>   j> directory in make and provide specific error
message for my users?
>
>   j> For example if the user calls:
>   j>     make build_vxworks
>
>   j> I would like a message that says:
>   j>     You have not generated source code for any
vxworks targets. Please 
>   j> ... blah blah blah ...
>
> There are really lots of ways to do this, depending on
exactly what you
> want to do... which isn't well-defined above.
>
> But, for example:
>
>   $(if $(wildcard $(SRCS)),,$(fatal You have not
generated source code...))
>
>   

Thanks your example is just what i need to see ... no
further questions ...

Thanks
Jim


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )