www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/08/18/13:02:20

From: Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Makefiles with DJGPP
Date: Sat, 18 Aug 2001 17:45:30 +0100
Lines: 23
Message-ID: <rq6tnt8ad88jfb7je08e53ti08fb703egh@4ax.com>
References: <ijve7.2399$lc6 DOT 1621461 AT carnaval DOT risq DOT qc DOT ca>
NNTP-Posting-Host: modem-60.acyclovir.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: newsg4.svr.pol.co.uk 998153183 2582 62.136.75.188 (18 Aug 2001 16:46:23 GMT)
NNTP-Posting-Date: 18 Aug 2001 16:46:23 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Agent 1.7/32.534
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Patrick Mitran" <pmitran AT tsp DOT ece DOT mcgill DOT ca> wrote:

> Hi,
> 
> I'm trying to write a makefile that will run with DJGPP and Linux. There is
> only
> one issue that troubles me. I have a line
> 
> LDLIBS = -lm -lstdcxx
> 
> in my makefile. In DJGPP, this links fine, no problem. In linux, I would
> need
> the second library to be -lstdc++ instead. How can I make the makefile
> detect the build environment and choose the right library?

Another solution to the one already mentioned is to rewrite the internal
make rule to use g++ for linking rather than gcc.  With ths rule the
makefile should DTRT however g++/libstdc++ are named:

LDLIBS = -lm

%: %.o
	$(CXX) $(LDFLAGS) $^ $(LDLIBS) -o $@

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019