Re: new list user: I have a problem with a makefile
Re: new list user: I have a problem with a makefile
- Subject: Re: new list user: I have a problem with a makefile
- From: Eric Albert <email@hidden>
- Date: Sun, 14 Aug 2005 16:39:52 -0700
On Aug 14, 2005, at 4:27 PM, Paul Archibald wrote:
If this belongs on another forum, let me know.
The unix-porting list might be better, but this one works.
I would like to migrate the makefile into an Xcode project for
maintainablity, so if someone knows how to do that, swell. Our next
version will do away with the Codewarrior entirely.
For what you're doing here, building this in Xcode should be pretty
straightforward. (Building the load map -- the -M option -- is
possibly an exception; do you really need that?) I'd suggest starting
with a new "Java JNI Application" project and changing that one to
match your needs.
$(TARGET): $(OBJECTS)
libtool -dynamic -M -single_module -o $@ $^ -lstdc++ -lc -lgcc >
map
strip -x $@
When I try make (in the Terminal), I get (something like) this:
$ make
libtool -dynamic -M -single_module -o ../libJEngine.jnilib
engine/mathx.o engine/auto.o -lstdc++ -lc -lgcc > map
libtool: can't locate file for: -lstdc++
libtool: file: -lstdc++ is not an object file (not allowed in a
library)
libtool: can't locate file for: -lgcc
libtool: file: -lgcc is not an object file (not allowed in a library)
make: *** [../libJEngine.jnilib] Error 1
$
Try changing the libtool line to this:
g++ -Wl,-M -single_module -o $@ $^ > map
When you're building C++ code with any recent version of gcc, libstdc++
and libgcc are included automatically for you, and when you build with
gcc on Mac OS X, libc (more properly libSystem) is included
automatically for you, so you don't need to specify them.
Hope this helps,
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden