Jump to content

Re: Linux Makefile Tutorial

- - - - -

  • Please log in to reply
1 reply to this topic

#1
rock

rock

    Newbie

  • Members
  • Pip
  • 1 posts
hey

I read all what you explained it before.. and so this is what i did...


touch test.c
gedit test.c

than in the test.c

i had

test.c: src1.o src2.o
gcc -o test.c src1.o src2.o

src1.o : src1.c
gcc -c src1.c
src2.o : src2.c
gcc -c src2.c

than i did
# make

but i still dont get where i m gona include my src1.c and src2.c

and how i m gona have these two files in the make..

i need ot get the make file concept done.. i knw its easy bu the thing is its kinda hard concept at the same time.. may b i m slow but please if someone can explain m step by step i will really appreciate it.. thanks...

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
I've moved your thread to it's own thread, instead of reviving a thread that's more than a year old.

Are you saying that you put that text inside of source.c? You need a different file, called "makefile" to contain the text above.
All the file is doing is giving rules about which files to check for changes, and what commands to issue to address those changes.


There's much more information here: GNU `make'
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users