Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6988523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:05:33+00:00 2026-05-27T19:05:33+00:00

my source files are not inside of one directory which I need to do

  • 0

my source files are not inside of one directory which I need to do ../ or ../../ stuff.

after that, I need to change source file name for example: ../ex/test.c to obj/test.o

with this: command:

$(OBJDIR) $(notdir $(SOURCECODE:.c=.o))

however only first filename in $(SOURCECODE) (../ex/test.c) is correctly renamed to obj/test.o, the rest all look like *.o, without directory information.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:05:34+00:00Added an answer on May 27, 2026 at 7:05 pm

    That’s because you prepend $(OBJDIR) to the list as is: obj/ + foo.c bar.c baz.c gives obj/foo.c bar.c baz.c, which is not what you want.

    To add directory to each file in your list use addprefix function:

    $(addprefix $(OBJDIR),$(notdir $(SOURCECODE:.c=.o)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A bit context. Let's say I have source files, which need to end up
I have binary files which contain each one PNG file at a time (the
I have a products.jar file. Inside that there is one class com.ClassA . The
Textmate does not source my .profile file. I don't have a custom bash_init.rb, nor
All source files seem to have compiled fine. However, since I achieved that, I
How should I divide source files into projects (within one solution) to be able
I have some Fortran 77 source files that I'm trying to convert from a
I have a large work space which has many source files of C code.
I have a working webpage which just displays external html files inside a div
I have an application that loads external SWF files and plays them inside a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.