|
Re: help with using compiler other than gcc for example Sun C compiler [message #72631 is a reply to message #72425] |
Sun, 01 June 2003 10:56  |
Eclipse User |
|
|
|
Daniel Huang schrieb:
> Hi,
>
> Does anyone tried it before and willing to share the experience ?
>
I can't help with settings for the debugger.
But for building projects, even the Sun C Compiler should have some
make-tool.
Adapt your Makefile like this:
# these are the settings for GCC/G++
# adapt these to the Sun C Compiler
# C Compiler
CC = gcc
# C++ Compiler
CXX = g++
# Archiver to build libs
AR = ar
# Linker
LD = ld
# add more tools
# ...
# Compiler settings
C_DEBUG = -g
C_INCLUDE_PATHS = -I/usr/include # add more here
CFLAGS = $(C_DEBUG) $(C_INCLUDE_PATHS)
CXXFLAGS = $(CFLAGS)
LIB_PATHS = -L/usr/lib -L../mylib
LIB_USELIBS = -lmylib # add more as you need
LDFLAGS = $(LIB_PATHS) $(LIB_USELIBS)
in your Build rules use these variables instead of the commands itself
like:
$(PROGRAM): $(OBJECTS)
$(LD) -o $@ $< $(LDFLAGS)
# compile .o from .cpp
%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<
This should work, though, I don't have an Sun C Compiler here.
If you have the make-tool and it supports the include-directive, you can
put these settings for the compiler (CC,CXX,...) in a Rules.sun-file and
include it in your Makefile like:
# comment out either one
include Rules.sun # use settings for Sun-C-Compiler
#include Rules.gnu # use settings for GCC/G++
A real difference in building projects is probably the Microsoft
Compiler, since there is the nmake tool with a different syntax for
their Makefile and also the options are started with '/' instead of '-'.
|
|
|
Powered by
FUDForum. Page generated in 0.10363 seconds