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 7663155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:59:12+00:00 2026-05-31T13:59:12+00:00

I am trying to write a Makefile for a JVM port. I have already

  • 0

I am trying to write a Makefile for a JVM port. I have already exported a variable like $CROSS_COMPILE=mipsel-linux-
This can be different for different platformd with its specific toolchains.
The toolchain can be located at different locations, but is guaranteed to be in the PATH( eg: /opt/toolchains/mipsel/bin/mipsel-linux-gcc)
My aim is to genericaly get the path upto “opt/toolchains/mipsel/bin/mipsel-linux-” from within my make file.
My current thinking is the do something like
1) which $(CROSS_COMPILE)gcc —– Which will return something like “/opt/toolchains/mipsel/bin/mipsel-linux-gcc”
2) Use that string and remove the gcc from the end.

I guess this should be possible. I have no idea though on how to proceed. Pointers on how to start will be appreciated.
I have tried “which $(CROSS_COMPILE)gcc” and which ($(CROSS_COMPILE)gcc), both of which arent working

  • 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-31T13:59:13+00:00Added an answer on May 31, 2026 at 1:59 pm

    There are plenty of GNU Make funcions to retrieve for example a directory name.

    PATHTOTOOLS:=$(dir $(shell which $(CROSS_COMPILE)gcc))
    

    Also note the use of the := assignement to compute it only once and thus avoid running the which command repeatedly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to write a chat, like on facebook, I wondered if two clients can
Im trying to write something to get my images to show correctly. I have
I am trying to write a makefile for compiling a program with source files
I'm trying to write a Makefile where prerequisites using target specific variables version= target1:
I am trying to write a makefile for a small scale application I wrote
I'm trying to write a Linux device driver. I've got it to work really
I'm trying to write a makefile to package up some PHP scripts. I would
I am trying to modify a Makefile, and I can't find the rule for
I'm trying to write a Makefile which should download some sources if and only
I'm trying write a query to find records which don't have a matching record

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.