Click here to Skip to main content
15,884,010 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I had created a makefile for my simple C application.
I am able to create object and library file through makefile sucessfully.
I had written a code snippet for executable file also, but somehow its not working.
Here is the code for executable in makefile:
$(BIN)/EXT: $(OBJ)/EXT.o (respective dep. file paths)
  $(CCC) -o $@ $(OBJ)/EXT.o .a (respective dep. file paths) $(CLDFLAGS) $(CLIBPATHS) $(CLIBS)


How to get the executable from makefile?

Help me out please!!!!!!!!!!
Thanks in advance. :-O
Posted
Updated 6-Apr-10 23:42pm
v3

Poonamol wrote:
$(CCC)


Shouldn't be $(CC)?
What error (or unexpected behaviour) did you get?
:)
 
Share this answer
 
Here is my makefile:
OBJG=../../consultation/CSG/obj
OBJR=../../consultation/CSR/obj

TARGETS = $(BIN)/EXT
TOOLS = $(LIB)/libEXT_SRR.a
tools: $(TOOLS)
all: $(TARGETS) $(TOOLS)
install: all
@echo " Nothing to install, done!"
$(OBJ)/EXT_SRR.o: $(SRC)/EXT_SRR.cpp $(INC)/EXT_SRR.h
rm -f $@
$(CCC) -c -+ $< $(CCFLAGS)
$(MV) *.o $(OBJ)
$(BIN)/EXT: $(OBJ)/EXT_SRR.o $(OBJG)/CSG.o $(OBJG)/CSG_inter.o $(OBJR)/CSR.o
$(CCC) -o $@ $(OBJ)/EXT_SRR.o $(OBJG)/CSG.o $(OBJG)/CSG_inter.o $(OBJR)/CSR.o $(CLDFLAGS) $(CLIBPATHS) $(CLIBS)
$(LIB)/libEXT_SRR.a: $(OBJ)/EXT_SRR.o
rm -f $@
$(AR) $(AR_FLAGS) $@ $(OBJ)/EXT_SRR.o

Using this i am able to get object file and lib file.
What is the issue with my executable file in BIN folder?
(CCC) is working fine for me.

I am not receiving any error, but my file is not gets created in BIN folder.
Please help me out.
 
Share this answer
 
v2
Since we do not know, what is the variable BIN ,
try to replace all $(BIN)/EXT in your file
with /usr/poony/my_out.executable
(here poony is your user apartment),
just for a test... :)
 
Share this answer
 
BIN is the path where my exe "EXT" is stored.

[EP]What path is it, please ?[/EP]
 
Share this answer
 
v2
BIN contains ../common/EXT_SRR/bin

and executable file name is "EXT".
this EXT file should get created and placed it into that BIN directory.



Help me out ASAP.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900