Find the answer to your Linux question:
Results 1 to 2 of 2
I'm a newbie.. ....working on a project in Linux OS .... using C language. ....n using threads n sockets.. I need to make a "Makefile" for my files, so that ...
  1. #1
    Just Joined! ZODZOD's Avatar
    Join Date
    Apr 2007
    Posts
    1

    Question Unable to make Makefile.......

    I'm a newbie..
    ....working on a project in Linux OS
    .... using C language.
    ....n using threads n sockets..

    I need to make a "Makefile" for my files, so that i don't have to compile each one separately.

    I read some tutorials about make, wherein the hierarchy of files is mentions. But since , mine is in C language, all C files contain main(); and hierarchy is not observed..

    I tried to make a Makefile using the bits of info.
    But, when i run it, i get warnings and errors., mostly regarding multiple declaration of main.

    1. Can i make a Makefile for C programs which are not interdependent[strongly].... like a makefile for server.c client.c display.c lan.c data.txt?



    I'm also working with Qt:
    With refrerence to it...
    when i compile a program i use...
    : qmake -project
    qmake hello.pro
    {Now the Makefile gets created automatically]
    I just have to run :
    : make
    And i get a hello.o file ready.
    : ./hello
    runs successfully.


    Is there anything like this for general C programs,.??

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile

    why do so? i believe you can use one main().
    this is what i did in my previous work...
    main.c --- clearly contain main()
    server.c -- don't have any main - just functions replated to server
    client.c -- just functions replated to server
    created a make file.it worked well
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...