Re: Two make questions
Posted in 2003
I don't understand the first question but I can answer the second.
If you simply 'update' the timestamp on the source file make will believe
it has been updated. It will then recompile from the .ec file.
You can do this on most unix machines with
touch filename
eg touch abc.ec
ipellew@pipemedia
.co.uk (Ian To: informix-list@iiug.org
Pellew) cc:
Sent by: Subject: Two make questions
owner-informix-li
st@iiug.org
08/12/2003 12:55
Please respond to
ipellew
Hi;
Two questions on make:-
How can I get the name of the makefile into a usable variable?
IE $MK = makefile if I use makefile
= Makefile if I am using Makefile
= whatever if I run `make ?f whatever`.
===========
2.
I am compiling Informix .ec files and ask how can I force 'make' to
compile the .ec file rather than the .c left over from a previous
erroneous compile.
Eg:-
cgi_env.ec: In function `dl_our_tag':
cgi_env.ec:2695: `n' undeclared (first use in this function)
cgi_env.ec:2695: (Each undeclared identifier is reported only once
cgi_env.ec:2695: for each function it appears in.)
cgi_env.ec:2695: parse error before "strcpy"
*** Error code 1
make: Fatal error: Command failed for target `cgi_env.o'
I have now corrected the cgi_env.ec file.
$ make
cgi_env.ec: In function `dl_our_tag':
cgi_env.ec:2695: `n' undeclared (first use in this function) etc.
My make file fragment is:-
.SUFFIXES : .o .4gl .ec .c
.4gl.o :
@$(ESQL) $(ESQLFLAGS) $(CFLAGS) $<
.ec.o :
@$(ESQL) $(ESQLFLAGS) $(CFLAGS) $<
.c.o :
@$(ESQL) $(ESQLFLAGS) $(CFLAGS) $<
If I `rm cgi_env.c` 'make' works OK.
Regards
Ian
--------------------------------------------------------------------------
THE FOLLOWING WARNINGS ATTACH TO THIS COMMUNICATION
This material is intended for the named recipient only and has been created
solely for the purpose and function of Livestock Improvement Corporation
Limited and may contain information that is subject to the Privacy Act /
Confidentiality / Privilege / Copyright. Any person other than the named
recipient is prohibited from retaining / disclosing / copying /
distributing / using all or part of this material.
sending to informix-list