www.digitalmars.com         C & C++   DMDScript  

c++ - smake question

reply "Jim Jennings" <jwjenn mindspring.com> writes:
I am grass green on makefiles and am trying my first one.

With the lines below from the makefile, I have tried:
smake /Fmakefile cleanall
which works, but
smake /Fmakefile clean
does not. It will clean out ALLOBJS, but not ALLBIN.

 I have read all 26 pages of the "Managing Code with SMAKE" html file, and
cannot find an answer. (It may be there, but I do not see it.)
How do I get smake to work on two macros at the same time as I am trying to
do with "clean"? Or is it not possible?
Obviously, I could use "cleanall", or enter both cleanobjs and cleanbin on
the command line. Having spent a inordinate amount of time on this problem,
however, I am curious.

ALLOBJS = cross.obj crosstest.obj swap.obj string1.obj argv.
ALLBIN: = cross.exe swap.exe string1.exe argv.execharset.exe hello.exe

cleanobjs:
         -del *.obj
cleanbin:
         -del *.exe
cleanall:
         -del *.obj *.exe

clean:
         -del $(ALLOBJS)
         -del $(ALLBIN)

Jim J.
Mar 19 2003
next sibling parent "Nic Tiger" <nictiger progtech.ru> writes:
I guess there is extra ':' in your 2nd line.
Anyway the following works as expected:

-------------
ALLOBJS = cross.obj crosstest.obj swap.obj string1.obj argv.
ALLBIN = cross.exe swap.exe string1.exe argv.execharset.exe hello.exe

cleanobjs:
         del *.obj
cleanbin:
         del *.exe
cleanall:
         echo cleanall
         del *.obj *.exe

clean:
         echo clean
         del $(ALLOBJS)
         del $(ALLBIN)
-------------
With command line "smake -f test.mak cleanall" it cleans files and prints
"cleanall".
With command line "smake -f test.mak clean" it cleans files and prints
"clean".

Nic Tiger.

"Jim Jennings" <jwjenn mindspring.com> сообщил/сообщила в новостях
следующее: news:b5bd13$oer$1 digitaldaemon.com...
 I am grass green on makefiles and am trying my first one.

 With the lines below from the makefile, I have tried:
 smake /Fmakefile cleanall
 which works, but
 smake /Fmakefile clean
 does not. It will clean out ALLOBJS, but not ALLBIN.

  I have read all 26 pages of the "Managing Code with SMAKE" html file, and
 cannot find an answer. (It may be there, but I do not see it.)
 How do I get smake to work on two macros at the same time as I am trying
to
 do with "clean"? Or is it not possible?
 Obviously, I could use "cleanall", or enter both cleanobjs and cleanbin on
 the command line. Having spent a inordinate amount of time on this
problem,
 however, I am curious.

 ALLOBJS = cross.obj crosstest.obj swap.obj string1.obj argv.
 ALLBIN: = cross.exe swap.exe string1.exe argv.execharset.exe hello.exe

 cleanobjs:
          -del *.obj
 cleanbin:
          -del *.exe
 cleanall:
          -del *.obj *.exe

 clean:
          -del $(ALLOBJS)
          -del $(ALLBIN)

 Jim J.
Mar 19 2003
prev sibling next sibling parent "Jim Jennings" <jwjenn mindspring.com> writes:
Never mind. I found the offending colon.
jwj

"Jim Jennings" <jwjenn mindspring.com> wrote in message
news:b5bd13$oer$1 digitaldaemon.com...
 I am grass green on makefiles and am trying my first one.

 With the lines below from the makefile, I have tried:
 smake /Fmakefile cleanall
 which works, but
 smake /Fmakefile clean
 does not. It will clean out ALLOBJS, but not ALLBIN.

  I have read all 26 pages of the "Managing Code with SMAKE" html file, and
 cannot find an answer. (It may be there, but I do not see it.)
 How do I get smake to work on two macros at the same time as I am trying
to
 do with "clean"? Or is it not possible?
 Obviously, I could use "cleanall", or enter both cleanobjs and cleanbin on
 the command line. Having spent a inordinate amount of time on this
problem,
 however, I am curious.

 ALLOBJS = cross.obj crosstest.obj swap.obj string1.obj argv.
 ALLBIN: = cross.exe swap.exe string1.exe argv.execharset.exe hello.exe

 cleanobjs:
          -del *.obj
 cleanbin:
          -del *.exe
 cleanall:
          -del *.obj *.exe

 clean:
          -del $(ALLOBJS)
          -del $(ALLBIN)

 Jim J.
Mar 19 2003
prev sibling next sibling parent "Matthew Wilson" <dmd synesis.com.au> writes:
Have you got Oram & Talbott's "Projects with make" (O'Reilly)? It's old but
really good for doing makefiles.


"Jim Jennings" <jwjenn mindspring.com> wrote in message
news:b5bd13$oer$1 digitaldaemon.com...
 I am grass green on makefiles and am trying my first one.

 With the lines below from the makefile, I have tried:
 smake /Fmakefile cleanall
 which works, but
 smake /Fmakefile clean
 does not. It will clean out ALLOBJS, but not ALLBIN.

  I have read all 26 pages of the "Managing Code with SMAKE" html file, and
 cannot find an answer. (It may be there, but I do not see it.)
 How do I get smake to work on two macros at the same time as I am trying
to
 do with "clean"? Or is it not possible?
 Obviously, I could use "cleanall", or enter both cleanobjs and cleanbin on
 the command line. Having spent a inordinate amount of time on this
problem,
 however, I am curious.

 ALLOBJS = cross.obj crosstest.obj swap.obj string1.obj argv.
 ALLBIN: = cross.exe swap.exe string1.exe argv.execharset.exe hello.exe

 cleanobjs:
          -del *.obj
 cleanbin:
          -del *.exe
 cleanall:
          -del *.obj *.exe

 clean:
          -del $(ALLOBJS)
          -del $(ALLBIN)

 Jim J.
Mar 19 2003
prev sibling next sibling parent "Walter" <walter digitalmars.com> writes:
Remove the : after the ALLBIN.

"Jim Jennings" <jwjenn mindspring.com> wrote in message
news:b5bd13$oer$1 digitaldaemon.com...
 I am grass green on makefiles and am trying my first one.

 With the lines below from the makefile, I have tried:
 smake /Fmakefile cleanall
 which works, but
 smake /Fmakefile clean
 does not. It will clean out ALLOBJS, but not ALLBIN.

  I have read all 26 pages of the "Managing Code with SMAKE" html file, and
 cannot find an answer. (It may be there, but I do not see it.)
 How do I get smake to work on two macros at the same time as I am trying
to
 do with "clean"? Or is it not possible?
 Obviously, I could use "cleanall", or enter both cleanobjs and cleanbin on
 the command line. Having spent a inordinate amount of time on this
problem,
 however, I am curious.

 ALLOBJS = cross.obj crosstest.obj swap.obj string1.obj argv.
 ALLBIN: = cross.exe swap.exe string1.exe argv.execharset.exe hello.exe

 cleanobjs:
          -del *.obj
 cleanbin:
          -del *.exe
 cleanall:
          -del *.obj *.exe

 clean:
          -del $(ALLOBJS)
          -del $(ALLBIN)

 Jim J.
Mar 19 2003
prev sibling parent reply "Jim Jennings" <jwjenn mindspring.com> writes:
Wow, you all are sure on the ball. Two answers in less than an hour, and
three in two hours.
The way I finally found the error was by trying "smake /Fmakefile" and it
said it couldn't make =.
Yes, I have the Oram & Talbott make book. I have just begun reading it. It
is based on UNIX, so I have only referred to it occasionally until now. But
I will go into it in depth immediately. I am doing a lot of small exercises,
where I compile a group of programs over and over. A makefile sure helps, I
have discovered. And dmc is the fastest compiler that I have seen -- by far.
It is great!
Thank you all very much, I had spent hours on that bug.
Jim J

"Jim Jennings" <jwjenn mindspring.com> wrote in message
news:b5bd13$oer$1 digitaldaemon.com...
 I am grass green on makefiles and am trying my first one.

 With the lines below from the makefile, I have tried:
 smake /Fmakefile cleanall
 which works, but
 smake /Fmakefile clean
 does not. It will clean out ALLOBJS, but not ALLBIN.
Mar 20 2003
parent reply "Matthew Wilson" <dmd synesis.com.au> writes:
Jim

You're more than welcome. :)

I've had occasion this week to use DM's make for the first time, and there
are a number of differences with the one I've previously favoured
(Borland's).

Walter, is it possible to create a separate newsgroup - make ? - so that all
the make information can be centralised?

Matthew


"Jim Jennings" <jwjenn mindspring.com> wrote in message
news:b5cshc$1po9$1 digitaldaemon.com...
 Wow, you all are sure on the ball. Two answers in less than an hour, and
 three in two hours.
 The way I finally found the error was by trying "smake /Fmakefile" and it
 said it couldn't make =.
 Yes, I have the Oram & Talbott make book. I have just begun reading it. It
 is based on UNIX, so I have only referred to it occasionally until now.
But
 I will go into it in depth immediately. I am doing a lot of small
exercises,
 where I compile a group of programs over and over. A makefile sure helps,
I
 have discovered. And dmc is the fastest compiler that I have seen -- by
far.
 It is great!
 Thank you all very much, I had spent hours on that bug.
 Jim J

 "Jim Jennings" <jwjenn mindspring.com> wrote in message
 news:b5bd13$oer$1 digitaldaemon.com...
 I am grass green on makefiles and am trying my first one.

 With the lines below from the makefile, I have tried:
 smake /Fmakefile cleanall
 which works, but
 smake /Fmakefile clean
 does not. It will clean out ALLOBJS, but not ALLBIN.
Mar 20 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Matthew Wilson" <dmd synesis.com.au> wrote in message
news:b5d7h5$21le$1 digitaldaemon.com...
 Jim

 You're more than welcome. :)

 I've had occasion this week to use DM's make for the first time, and there
 are a number of differences with the one I've previously favoured
 (Borland's).

 Walter, is it possible to create a separate newsgroup - make ? - so that
all
 the make information can be centralised?
There's been a lot of traffic recently on smake, but that's pretty rare.
Mar 20 2003
parent "Matthew Wilson" <dmd synesis.com.au> writes:
Is that a no?

;)


"Walter" <walter digitalmars.com> wrote in message
news:b5dbav$24kb$1 digitaldaemon.com...
 "Matthew Wilson" <dmd synesis.com.au> wrote in message
 news:b5d7h5$21le$1 digitaldaemon.com...
 Jim

 You're more than welcome. :)

 I've had occasion this week to use DM's make for the first time, and
there
 are a number of differences with the one I've previously favoured
 (Borland's).

 Walter, is it possible to create a separate newsgroup - make ? - so that
all
 the make information can be centralised?
There's been a lot of traffic recently on smake, but that's pretty rare.
Mar 20 2003