Help for makefile creation in Unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help for makefile creation in Unix
# 1  
Old 04-07-2010
Help for makefile creation in Unix

Hello,

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:
Code:
$(BIN)/EXT: $(OBJ)/EXT.o (respective dependent file paths)
      $(CCC) -o $@ $(OBJ)/EXT.o .a (respective dependent file paths)               $(CLDFLAGS) $(CLIBPATHS) $(CLIBS)

How to get the executable from makefile?

Help me out please!!!!!!!!!!
Thanks in advance.

---------- Post updated at 05:16 AM ---------- Previous update was at 04:19 AM ----------

Here is my makefile:
Code:
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?
I am not receiving any error, but my file is not gets created in BIN folder.

Please help me out.

Last edited by pludi; 04-07-2010 at 07:43 AM.. Reason: code tags, please!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX directory creation issues

Hi All, I am facing a strange scenario. I upgraded my server version to new version of linux. After the when I create a directory it is created with . in the the permission . What is the reason and how to fix . $ mkdir test $ ls -l total 0 drwxr-xr-x. 2 uk01 users 6 Dec 7 03:49 test ... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

2. Web Development

Web Application creation on UNIX

Hi, I would like to create an application with HTML front end in Unix. I am working on enterprise Unix server, so I could not install any add ons or software in my machine. but still i have super user permissions. I can change the permissions as i wish. I have built a small application with... (1 Reply)
Discussion started by: Balasankar
1 Replies

3. UNIX for Dummies Questions & Answers

File creation time in UNIX

Hi All, Can any one help how to long list today's files in unix.i.e files which are have been created today should be able to "ls -ltr" .I should be able to apply the "ls -ltr" command on today's files(should not include all the files which were there in the directory). Thanks in advance!!! (3 Replies)
Discussion started by: Balasankar
3 Replies

4. UNIX for Dummies Questions & Answers

About Unix File creation time

Hello, I registered and recreated this thread because everywhere we can see "It's not possible to get the file creation time in UNIX fs". This is not true any more with Ext4! Unfortunately, there is not user-level tools that allow you to read those information. You have to use a low level tool... (4 Replies)
Discussion started by: gaellafond
4 Replies

5. Homework & Coursework Questions

Help with Simple Multi-Level Makefile (Extremely New at Makefile)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Basically, the prompt is make a makefile with various sub makefiles in their respective subdirectories. All code... (1 Reply)
Discussion started by: Tatl
1 Replies

6. Shell Programming and Scripting

Makefile error in UNIX

Hi, I had created makefile to compile and create .exe file. but while executing makefile i am receiving following error I can create obj and lib files but not able to create executeable file due to following error. 0711-317 Error: undefined symbol: .fn_error(......) 0711-345 use the... (2 Replies)
Discussion started by: Poonamol
2 Replies

7. Programming

Process creation in Unix with C Program

Hi, can somebody please help me regarding this? How can i print parent's PID from child's and vice versa. I have tried with getpid() & ngetppid() function but it is not giving me the correct data. The logic i used is: if (pid == 0) { getpid() : Chil'd PID getppid():... (1 Reply)
Discussion started by: dsudipta
1 Replies

8. UNIX for Advanced & Expert Users

Makefile problem - How to run module load in a Makefile

Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error: make: module: command not found Why is this? Is there any way to run this command in a Makefile? NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (2 Replies)
Discussion started by: hernandinho
2 Replies

9. Shell Programming and Scripting

Unix File creation time

IS there any command to find the file creation time in Unix. (2 Replies)
Discussion started by: tinivt
2 Replies

10. UNIX for Dummies Questions & Answers

unix install dvd creation

i want to create a bootable iso dvd image of unix, i was thinking i openBSD but it can be another , what i need to now is how to make the image , what file to use directories to create and adictional software , can some1 help me with this, so that i can install a unix system that works. (2 Replies)
Discussion started by: lenny
2 Replies
Login or Register to Ask a Question