'clear' shell command in Makefile

S

silversurfer

Hello world,
I was just wondering why the clear-line in my Makefile does not work:

main:main.o $(ADDOBJS)
clear
@g++ -o main $(LDFLAGS) $+

As far as I understood it, it should be possible to add multiple
shell-commands.. Nevertheless, this does compile the files, but the
'clear' before does not work..

Anyone knows why?
 
W

Walter Roberson

silversurfer said:
I was just wondering why the clear-line in my Makefile does not work:
main:main.o $(ADDOBJS)
clear
@g++ -o main $(LDFLAGS) $+
As far as I understood it, it should be possible to add multiple
shell-commands.. Nevertheless, this does compile the files, but the
'clear' before does not work..
Anyone knows why?

That is not a question about C. Try asking in a newsgroup that
deals with the version of Make you are using. As you are using g++
it appears that you might be using FSF's gmake and so might want
to ask in one of the gnu newsgroups.


[In my opinion, putting a clear command into a Makefile is
a bad idea. But that's irrelevant in comp.lang.c]
 
S

silversurfer

Sorry, I found many many posts about makefiles in this group so I did
not think it was a big deal..I'll ask somewhere else...thanks for the
lesson.



Walter said:
silversurfer said:
I was just wondering why the clear-line in my Makefile does not work:
main:main.o $(ADDOBJS)
clear
@g++ -o main $(LDFLAGS) $+
As far as I understood it, it should be possible to add multiple
shell-commands.. Nevertheless, this does compile the files, but the
'clear' before does not work..
Anyone knows why?

That is not a question about C. Try asking in a newsgroup that
deals with the version of Make you are using. As you are using g++
it appears that you might be using FSF's gmake and so might want
to ask in one of the gnu newsgroups.


[In my opinion, putting a clear command into a Makefile is
a bad idea. But that's irrelevant in comp.lang.c]
 
J

Jack Klein

Hello world,
I was just wondering why the clear-line in my Makefile does not work:

main:main.o $(ADDOBJS)
clear
@g++ -o main $(LDFLAGS) $+

As far as I understood it, it should be possible to add multiple
shell-commands.. Nevertheless, this does compile the files, but the
'clear' before does not work..

Anyone knows why?

You are posting to the wrong group, this is not a C language question
at all. You need to ask in a group that supports your particular OS
and development tool combination. Based on headers on your post, you
probably want
 
F

Flash Gordon

silversurfer said:
Hello world,
I was just wondering why the clear-line in my Makefile does not work:

main:main.o $(ADDOBJS)
clear
@g++ -o main $(LDFLAGS) $+

As far as I understood it, it should be possible to add multiple
shell-commands.. Nevertheless, this does compile the files, but the
'clear' before does not work..

Anyone knows why?

I'm sure lots of people know. They probably hang out on groups where
things like make files are topical. This is not such a group. This group
discusses the C programming language. It might be that
comp.unix.programmer would be more appropriate, but check the group out
before posting since I could be wrong.

<OT>
Perhaps when run from with a makefile it does not see a terminal type
that supports clearing the screen.
</OT>
 
F

Flash Gordon

silversurfer said:
Sorry, I found many many posts about makefiles in this group so I did
not think it was a big deal..I'll ask somewhere else...thanks for the
lesson.

<snip>

You obviously failed to read all the responses to the questions about
makefiles. Had you done so you would have seen that in almost every case
the questioner has been told that this is the wrong group.

Also, your reply belongs after the text you are replying to, not before.
With irrelevant material snipped, of course.
 
S

Simon Biber

silversurfer said:
Sorry, I found many many posts about makefiles in this group so I did
not think it was a big deal..I'll ask somewhere else...thanks for the
lesson.

Then you would have found that in every case there were several replies
explaining that such posts are off-topic. Just because there were posts
on a topic before does not mean that they received meaningful answers,
or that they were on topic.

That said, you seem to be lucky in this case in that Flash Gordon gave
you an off-topic answer which was also my first guess at why your
problem may be occurring. However that answer may not be correct, and
since the experts on 'make' and 'clear' inhabit other groups they
probably won't be here to correct the answer for you.

In future please also bottom-post (place your reply below the text that
it is replying to, and trim away any irrelevant text from the quote).
 
W

Walter Roberson

Simon Biber said:
In future please also bottom-post (place your reply below the text that
it is replying to, and trim away any irrelevant text from the quote).

"mid-post" is the preferred style.
(Selected Quotation, relevant response) repeat.
In very simple cases [eg. this post] this is equivilent to
bottom-posting, but "bottom-posting" implies putting -all- of the
quoted material at the top, followed by all of the response, even
if multiple topics are dealt with.
 
K

Keith Thompson

Simon Biber said:
In future please also bottom-post (place your reply below the text that
it is replying to, and trim away any irrelevant text from the quote).

"mid-post" is the preferred style.
(Selected Quotation, relevant response) repeat.
In very simple cases [eg. this post] this is equivilent to
bottom-posting, but "bottom-posting" implies putting -all- of the
quoted material at the top, followed by all of the response, even
if multiple topics are dealt with.

True, but the term "mid-post" is also consistent with top-posting; it
doesn't make it clear that the each piece of the response goes below
the piece of the previous article to which it responds.

I don't think we have a single term for the preferred style -- which
means we need to explain it each time. My usual way to explain it is:

Please don't top-post. See <http://www.caliburn.nl/topposting.html>.
 
J

Jordan Abel

silversurfer said:
Hello world,
I was just wondering why the clear-line in my Makefile does not work:

main:main.o $(ADDOBJS)
clear
@g++ -o main $(LDFLAGS) $+

As far as I understood it, it should be possible to add multiple
shell-commands.. Nevertheless, this does compile the files, but the
'clear' before does not work..

Anyone knows why?

Regardless of whether it's off-topic or whatever, (by the way, i have
a suspicion on why it works, but it's speculative), i think the much
more important issue is

why the @#$! do you want to do this? The first thing i would do on
encountering a makefile that cleared the screen at all, worse, in the
*middle* of the build would be to delete the offending line.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top