Thread: create a symbolic link in a MakeFile

  1. #1
    Registered User
    Join Date
    Apr 2011

    create a symbolic link in a MakeFile


    I have a question regarding MakeFile

    Let us say I have two directories:

    first directory: /a/src/dbt/sch

    second directory: /a/src/mdls/fcl/mst/

    Now, the main program is present in "first directory". But, it needs definitions from a file, call it "test.c" that is present in "second directory".

    How can I create a symbolic link to "test.c" in a MakeFile in first directory, so that I do not receive compilation errors.

    It might be a simple question, but this is rather new for me.

    Any input, is welcome.


  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    I'm not sure why you are reaching straight for "making symbolic links" when "specifying the proper directory" seems like a lot simpler way to go.

    Given that your other file is "test.c", I assume this means that you're not trying to do #include, but rather need to compile and link the other file in to your executable. In that case just specify ../../mdls/fcl/mst/test.c as a prerequisite.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. automake does not create
    By useless79 in forum Tech Board
    Replies: 0
    Last Post: 02-20-2011, 04:05 AM
  2. Distinguish symbolic link from file (stat function)
    By mario++ in forum C Programming
    Replies: 10
    Last Post: 05-07-2010, 04:26 PM
  3. Create Link List for object
    By winsonlee in forum C++ Programming
    Replies: 6
    Last Post: 08-05-2004, 01:57 PM
  4. create dir in makefile
    By rotis23 in forum Linux Programming
    Replies: 5
    Last Post: 11-15-2002, 04:10 AM
  5. using MAKE with makefile to create executable file
    By sballew in forum C Programming
    Replies: 1
    Last Post: 11-19-2001, 12:49 PM