Problem with Makefile

I m using sunstudio11 on SUSE10 for c++.

i m getting error as

*********************************************

dmake -m serial -f "/root/.sunstudio/11-Linux-i686/sampledir/C++/namrata/Makefile"

CC -g-c -I/root/.sunstudio/11-Linux-i686/sampledir/C++/namrata -o Sun-i386-Linux/hello.o hello.cc

sh: CC: command not found

*** Error code 127

dmake: Fatal error: Command failed for target `Sun-i386-Linux/hello.o'

Build Failed

Total time: 0 seconds

*************************************************

my makefile is as shown below

## -*- Makefile -*-

##

## User: root

## Time: Sep 22, 2006 8:40:12 PM

## Makefile created by Sun Studio.

##

## This file is generated automatically.

##

#### Compiler and tool definitions shared by all build targets #####

CC = cc

CCC = CC

CXX = CC

BASICOPTS = -g

CFLAGS = $(BASICOPTS)

CCFLAGS = $(BASICOPTS)

CXXFLAGS = $(BASICOPTS)

CCADMIN = CCadmin -clean

# Define the target directories.

TARGETDIR_namrata=Sun-i386-Linux

all: $(TARGETDIR_namrata)/namrata

## Target: namrata

CPPFLAGS_namrata = \

-I/root/.sunstudio/11-Linux-i686/sampledir/C++/namrata

OBJS_namrata = \

$(TARGETDIR_namrata)/hello.o

USERLIBS_namrata = $(SYSLIBS_namrata)

DEPLIBS_namrata =

LDLIBS_namrata = $(USERLIBS_namrata)

# Link or archive

$(TARGETDIR_namrata)/namrata: $(TARGETDIR_namrata) $(OBJS_namrata) $(DEPLIBS_namrata)

$(LINK.cc) $(CCFLAGS_namrata) $(CPPFLAGS_namrata) -o $@ $(OBJS_namrata) $(LDLIBS_namrata)

# Compile source files into .o files

$(TARGETDIR_namrata)/hello.o: $(TARGETDIR_namrata) hello.cc

$(COMPILE.cc) $(CCFLAGS_namrata) $(CPPFLAGS_namrata) -o $@ hello.cc

#### Clean target deletes all generated files ####

clean:

rm -f \

$(TARGETDIR_namrata)/namrata \

$(TARGETDIR_namrata)/hello.o

$(CCADMIN)

rm -f -r $(TARGETDIR_namrata)

# Create the target directory (if needed)

$(TARGETDIR_namrata):

mkdir -p $(TARGETDIR_namrata)

# Enable dependency checking

.KEEP_STATE:

.KEEP_STATE_FILE:.make.state.Sun-i386-Linux

Anybody help me to solve this problem?

[2323 byte] By [namsyn] at [2007-11-26 10:19:02]
# 1
CC should be in your PATH so that sh invoked by make could find it.
MaximKartashev at 2007-7-7 2:16:05 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

Another approach is to create makefile macros that point to the compiler: You can generatlize them to allow plugging in different compilers and tools by changing only one macro:

BIN = /path/to/installation/bin

CC = $(BIN)/cc

CCC = $(BIN)/CC

Now you use $(CC) for the C compiler, and $(CCC) for the C++ compiler.

You can add other macros for other related tools, like bcheck or dbx.

If you want to use a different compiler release, you just change the BIN macro. You can edit the Makefile, or you can put the macro on the command line:

make BIN=/path/to/other/bin/ ...

clamage45 at 2007-7-7 2:16:05 > top of Java-index,Development Tools,Solaris and Linux Development Tools...