By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,171 Members | 1,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,171 IT Pros & Developers. It's quick & easy.

'clear' shell command in Makefile

P: n/a
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?

Jul 1 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
In article <11**********************@m73g2000cwd.googlegroups .com>,
silversurfer <ki****@web.de> wrote:
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]

--
All is vanity. -- Ecclesiastes
Jul 1 '06 #2

P: n/a
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 Roberson schrieb:
In article <11**********************@m73g2000cwd.googlegroups .com>,
silversurfer <ki****@web.de> wrote:
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]

--
All is vanity. -- Ecclesiastes


Jul 1 '06 #3

P: n/a
On 1 Jul 2006 08:45:08 -0700, "silversurfer" <ki****@web.de> wrote in
comp.lang.c:
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 news:comp.os.linux.development.apps.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 1 '06 #4

P: n/a
silversurfer wrote:
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>
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
Jul 1 '06 #5

P: n/a
silversurfer wrote:
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.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
Jul 1 '06 #6

P: n/a
silversurfer wrote:
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).

--
Simon.
Jul 3 '06 #7

P: n/a
In article <44**********@news.peopletelecom.com.au>,
Simon Biber <ne**@ralmin.ccwrote:
>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.
--
"law -- it's a commodity"
-- Andrew Ryan (The Globe and Mail, 2005/11/26)
Jul 3 '06 #8

P: n/a
ro******@ibd.nrc-cnrc.gc.ca (Walter Roberson) writes:
In article <44**********@news.peopletelecom.com.au>,
Simon Biber <ne**@ralmin.ccwrote:
>>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>.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jul 3 '06 #9

P: n/a
silversurfer <ki****@web.dewrote:
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.
Jul 4 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.