Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Multiple exe's under one project
Multiple exe's under one project [message #48467] Sat, 02 November 2002 10:07 Go to next message
Eclipse UserFriend
We have a project consisting out of multiple C source files. Each source
files must compile and link to an corresponding .exe file.

Now I don't know make. so well, sorry I'm a mainframe programmer :), and
after two fruitless days trying to create a make file that can create the
above I'm desperate.

Can it even be done.

Thanks for your time.

JdJ
Re: Multiple exe's under one project [message #48775 is a reply to message #48467] Mon, 04 November 2002 14:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sam.robb.oneparticularharbor.net

"Johannes de Jong" <plotzeling@hotmail.com> wrote in message
news:aq0pnb$mbe$1@rogue.oti.com...
> We have a project consisting out of multiple C source files. Each source
> files must compile and link to an corresponding .exe file.
>
> Now I don't know make. so well, sorry I'm a mainframe programmer :), and
> after two fruitless days trying to create a make file that can create the
> above I'm desperate.
>
> Can it even be done.

Yes, certainly. Given source files a.c, b.c, c.c:

# --------------------
# Sample Makefile
# --------------------

# Tell make that all and clean are not real targets
..PHONY: all clean

# List of targets to build
TARGETS=a.exe b.exe c.exe

# Target 'all' depends on the list of targets
all: $(TARGETS)

# Target 'clean' removes targets
clean:
$(RM) $(TARGETS)

# Build targets - *.exe depends on *.c
# *.exe is built by running the program specified by the
# CC variable (gcc), passing it the names of all dependencies
# newer than the target ($?), and producing an output file
# with the same name as the target ($@)

a.exe: a.c
$(CC) $? -o $@

b.exe: b.c
$(CC) $? -o $@

c.exe: c.c
$(CC) $? -o $@

# --------------------
# EOF
# --------------------

Make wizards can probably give you 20 reasons why this
stinks :-) If you'd like to delve into Makefile management
yourself, I recommend "GNU Make" by Stallman & McGrath.

-Samrobb
Re: Multiple exe's under one project [message #48836 is a reply to message #48775] Tue, 05 November 2002 00:58 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Sam, I appreciate your input, you put me out of my misery i.e. that
it could be done :D

I'll have a look at some local bookstores if I can find the suggested book.
Re: Multiple exe's under one project [message #48895 is a reply to message #48836] Tue, 05 November 2002 10:52 Go to previous message
Eclipse UserFriend
Originally posted by: sam.robb.oneparticularharbor.net

"Johannes de Jong" <plotzeling@hotmail.com> wrote in message
news:aq7mm0$g2c$1@rogue.oti.com...
> Thanks Sam, I appreciate your input, you put me out of my misery i.e. that
> it could be done :D
>
> I'll have a look at some local bookstores if I can find the suggested
book.

It's published by the FSF - ISBN # 1-882114-79-5; you can
order it directly from the FSF at https://agia.fsf.org/.

If you're comfortable working with the online docs, the GNU make
manual (along with many other GNU manuals) is available online at:

http://www.fsf.org/manual/make-3.79.1/make.html

-Samrobb
Previous Topic:Plugging in a different C debugger?
Next Topic:(How) does cross referecing work?
Goto Forum:
  


Current Time: Mon May 12 01:33:17 EDT 2025

Powered by FUDForum. Page generated in 0.19679 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top