'clear' shell command in Makefile

Discussion in 'C Programming' started by silversurfer, Jul 1, 2006.

  1. silversurfer

    silversurfer Guest

    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?
    silversurfer, Jul 1, 2006
    #1
    1. Advertising

  2. In article <>,
    silversurfer <> 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
    Walter Roberson, Jul 1, 2006
    #2
    1. Advertising

  3. silversurfer

    silversurfer Guest

    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 <>,
    > silversurfer <> 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
    silversurfer, Jul 1, 2006
    #3
  4. silversurfer

    Jack Klein Guest

    On 1 Jul 2006 08:45:08 -0700, "silversurfer" <> 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/~ajo/docs/FAQ-acllc.html
    Jack Klein, Jul 1, 2006
    #4
  5. silversurfer

    Flash Gordon Guest

    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
    Flash Gordon, Jul 1, 2006
    #5
  6. silversurfer

    Flash Gordon Guest

    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
    Flash Gordon, Jul 1, 2006
    #6
  7. silversurfer

    Simon Biber Guest

    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.
    Simon Biber, Jul 3, 2006
    #7
  8. OT: mid/bottom posting (was Re: 'clear' shell command in Makefile)

    In article <44a93c59$>,
    Simon Biber <> wrote:

    >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)
    Walter Roberson, Jul 3, 2006
    #8
  9. Re: OT: mid/bottom posting (was Re: 'clear' shell command inMakefile)

    -cnrc.gc.ca (Walter Roberson) writes:
    > In article <44a93c59$>,
    > Simon Biber <> wrote:
    >
    >>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) <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.
    Keith Thompson, Jul 3, 2006
    #9
  10. silversurfer

    Jordan Abel Guest

    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?


    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.
    Jordan Abel, Jul 4, 2006
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    5,653
    Jonathan Bromley
    Feb 18, 2005
  2. Replies:
    4
    Views:
    1,693
    Terry Hancock
    Apr 23, 2005
  3. Donald Duck

    Best command for running shell command

    Donald Duck, Jul 11, 2006, in forum: Python
    Replies:
    3
    Views:
    389
    iapain
    Jul 11, 2006
  4. David

    Response.Clear() doesn't clear

    David, Jan 31, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    994
    Mark Fitzpatrick
    Jan 31, 2008
  5. InvalidLastName

    Unrecognized element 'add' after <clear></clear>

    InvalidLastName, Feb 26, 2007, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    925
    Steven Cheng[MSFT]
    Mar 6, 2007
Loading...

Share This Page