log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- WROCC Newsletter Volume 41:11 reviewed (News:)
- WROCC March 2024 meeting o... Hughes and Peter Richmond (News:1)
- Rougol March 2024 meeting on monday with Bernard Boase (News:)
- Drag'n'Drop 13i2 edition reviewed (News:)
- South-West Show 2024 talks (News:4)
- February 2024 News Summary (News:1)
- Next developer fireside chat (News:)
- DDE31d released (News:)
- South-West Show 2024 Report (News:)
- South-West Show 2024 in pictures (News:)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
 
View on Mastodon
@www.iconbar.com@rss-parrot.net
Site Search
 
Article archives
The Icon Bar: Programming: gcc's make utility
 
  gcc's make utility
  Cauchy (00:42 21/4/2011)
  Lampi (04:32 21/4/2011)
    Cauchy (21:00 21/4/2011)
      Phlamethrower (21:41 21/4/2011)
        Cauchy (22:21 21/4/2011)
          Lampi (00:01 22/4/2011)
            Cauchy (19:56 22/4/2011)
              Lampi (21:29 22/4/2011)
                Cauchy (22:40 22/4/2011)
 
John O'Meara Message #117417, posted by Cauchy at 00:42, 21/4/2011
Member
Posts: 43
Hi,
Does anyone here know if GCC's make works on the iyonix.
Or, how do I tell make to look in the floppy drive (:0.$.ch27.cc)for the various files to compile? makes address on the computer is HardDisc4.$.gnu.!GCC.bin.make. The code in the makefile follows:
CC=g++
CCFLAGS=-g -Wall
OBJS= stat.o ch_type.o token.o

all: stat.out stat

stat.out: stat
stat ../calc3/calc3.cc >stat.cc

stat: $(OBJS)
$(CC) $(CCFLAGS) -O STAT $(OBJS)

stat.out: stat.cc token.cc
$(CC) $(CCFLAGS) -c stat.cc

ch_type.o: ch_type.cc ch_type.h
$(CC) $(CCFLAGS) -c ch_type.cc

token.o: token.cc token.h ch_type.h
$(CC) $(CCFLAGS) -c token.cc

clean:
rm stat stat.o ch_type.o token.o

Thanks in advance. I just copied this as is from a book.
  ^[ Log in to reply ]
 
James Lampard Message #117418, posted by Lampi at 04:32, 21/4/2011, in reply to message #117417
Lampi

Posts: 190
Hi,
Does anyone here know if GCC's make works on the iyonix.
Yes it does.

Or, how do I tell make to look in the floppy drive (:0.$.ch27.cc)for the various files to compile? makes address on the computer is HardDisc4.$.gnu.!GCC.bin.make. The code in the makefile follows:
<snip>
Thanks in advance. I just copied this as is from a book.
*Dir :0.$.ch27
*MAKE

[Edited by Lampi at 07:11, 21/4/2011]
  ^[ Log in to reply ]
 
John O'Meara Message #117453, posted by Cauchy at 21:00, 21/4/2011, in reply to message #117418
Member
Posts: 43
Thanks Lampi, I did your commands and got the following warnings from make: makefile:17:warning overiding commands for target 'stat.out'
makefile:11:warning ignoring old commands for target 'stat.out'. Then g++ printed out the following:
g++ -g -Wall -o stat stat.o ch_type.o token.o
g++ stat.o: No such file or directory
g++ ch_type.o: No such file or directory
g++ token.o: No such file or directory
g++ np input files.
I was thinking that the following command in the make file; stat ../calc3/calc3.cc >stat.out
has no meaning in my case as my cc, h and out directories are in the same directory as the makefile is and I do not have a calc3 directory. Well I really am not sure what could be wrong, Thanks.
It also said make: *** [stat] Error 1

[Edited by Cauchy at 22:13, 21/4/2011]
  ^[ Log in to reply ]
 
Jeffrey Lee Message #117456, posted by Phlamethrower at 21:41, 21/4/2011, in reply to message #117453
PhlamethrowerHot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff

Posts: 15100
I think the problem is that this line:

stat.out: stat.cc token.cc
Should be this:

stat.o: stat.cc token.cc
Or possibly even this, as I suspect stat.cc #include's token.h, not token.cc:

stat.out: stat.cc token.h
Although the distinction between those last two is only really important if you want the makefile to properly rebuild stat.o whenever any of the inputs (i.e. stat.cc & token.cc/.h) change.
  ^[ Log in to reply ]
 
John O'Meara Message #117457, posted by Cauchy at 22:21, 21/4/2011, in reply to message #117456
Member
Posts: 43
Changing the line to: stat.o: stat.cc token.cc
still gives one error from make namely make: *** [stat] Error 1, but no overriding errors;
and all the g++ information. Thanks for reply Phlamethrower. But what does the line
stat.out stat
stat ../calc3/calc3.cc >stat.out do?
  ^[ Log in to reply ]
 
James Lampard Message #117460, posted by Lampi at 00:01, 22/4/2011, in reply to message #117457
Lampi

Posts: 190
But what does the line
stat.out stat
stat ../calc3/calc3.cc >stat.out do?
Execute the command "stat ../calc3/calc.cc >stat.out"

Or more simply generate the stat.out file by running the stat utility that you have created in the Makefile.
  ^[ Log in to reply ]
 
John O'Meara Message #117473, posted by Cauchy at 19:56, 22/4/2011, in reply to message #117460
Member
Posts: 43
I think I have solved it. I was using the editor Zap with info set to plain text i.e., fff and not to Makefile; i.e., fe1. Is there a preferred editor for use when typing makefiles for gnu make? Thanks.
  ^[ Log in to reply ]
 
James Lampard Message #117475, posted by Lampi at 21:29, 22/4/2011, in reply to message #117473
Lampi

Posts: 190
It shouldn't make any difference if you are invoking make from the cli with *MAKE.
On my system I have Makefiles that I want to use with Gnu Make typed as fff as FE1 launches the Norcroft Make/AMU.

The only issue I've ever had with GNU make is that it is fussy with the capitization of the name of the make file, it doesn't like "MakeFile" instead of "Makefile".

Either Zap of StrongEd are OK for editing makefiles.
  ^[ Log in to reply ]
 
John O'Meara Message #117479, posted by Cauchy at 22:40, 22/4/2011, in reply to message #117475
Member
Posts: 43
You are correct it doesn't make any difference. The problem appears to be I had typed "makefile" rather than "Makefile", Thanks again.
  ^[ Log in to reply ]
 

The Icon Bar: Programming: gcc's make utility