Basic tutorial on Makefile

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
19,170
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 16, 2008

This basic tutorial on Makefile explains how to write a very basic makefile.

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (adityabankar)

  • Why do we need to create the file "compile"? can't the timestamp of source(after compilation) be directly compared with the timestamp of source.c(the source)?

  • @ART000747 Yes we can do so. I took a different approach here. Sometimes we would want to do tasks that won't generate files with name "source" for "source.c", for example VHDL/Verilog compilation. In such cases it is required to follow this approach. After all Makefiles can be used for tasks other than C compilation.

  • @adityabankar Thanks for the reply, i tried to replace "touch compile" with "source" but gives me error.How exactly can this be done.

    Here is the code:

    exec: \

    compile ./source

    compile: \

    source.c gcc source.c -o source  echo " compiling the source now " source

  • @ART000747 actually touch is the command that updates the time stamp of an existing file to current system time. If the file doesn't already exist then it creates the file. There is no such command as source thus there is an error. To do what you wanna do you must rename compile: to source: and remove the statement "touch compile".

    Here is the code:

    exec: \

    compile ./source

    source: \

    source.c gcc source.c -o source echo " compiling the source now "

  • Why is it always indians doing these tutorials???

  • @AppleHack23 I was not aware if more Indians were doing it. But if you see at the bottom a user called "themanyone" has also done it and he is not an Indian.

Video Responses

This video is a response to Using gdb within emacs
see all

All Comments (21)

Sign In or Sign Up now to post a comment!
  • In the batch File you can read line of text file like this:

    set /p var= <Text.txt

    echo %var%

    But how can you do it in the makefile (To read a Line of text File or the whole text)?

    I want to read a file and print the contents.

  • Thank you for the great video .. it really helped me :)

    please keep posting

    Thank you again ....

  • @AppleHack23: Indians are awesome!

    When I had to learn how to use Hibernate, I saw another tutorial by an Indian.

    Apparently they are pretty good at their stuff, and helpful, plus I love the Indian accent ^^

  • Thanks for doing this tutorial!

  • Thanks dude, helped out

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more