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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:47:35+00:00 2026-05-14T14:47:35+00:00

I am creating a Makefile which I want it to be a single file

  • 0

I am creating a Makefile which I want it to be a single file for different architectures, OSes, libraries, etc. To do this I have a build specific XML file which defines the different configuration options for each architecture. The config file is read by Perl (it could be any language) and the Perl output returns something like:

var1 := var1_value
var2 := var2_value
var3 := var3_value

What I am trying to do is define this variables in my Makefile. From the makefile I am calling my readconfig script and it is giving the correct output, but I have not been able to get this variables as part of my Makefile. I have tried the use of eval and value, but none of them have worked (although it could be an issue of me not knowing how to use them. In overall what I am trying to do is something like:

read_config:
     $(eval (perl '-require "readConfig.pl"'))
     @echo $(var1)

It could be assumed I am using only GNU Make behavior. Things I could not change:

  • Config file is on XML
  • Using Perl as a XML parser
  • 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-14T14:47:36+00:00Added an answer on May 14, 2026 at 2:47 pm

    There’s no need to have config.mk as an explicit target; if you include it, Make will make it (if necessary):

    -include config.mk
    
    all: real_targets
    
    config.mk: xml_file
        perl make-config.pl > $@
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Android Application which uses JNI calls. Now i want this application
I have a bunch of scripts which I want to refactor into modules. This
Hi I have a makefile I am creating where each .o is represented as
I am in linux. My Makefile file is this main2: main.cpp g++ -c $(LIBS)
Creating Traversals for Binary Search Tree with Recursion. void inOrder(void (*inOrderPtr)(T&)) { if(this->left !=
When creating a web application, and lets say you have a User object denoting
While creating a file synchronization program in C# I tried to make a method
I am experimenting with makefile...mainly when sources are in many directories I have following
A couple of Rails applications I downloaded have dependencies on bson_ext which appears to
How can I distinguish in makefile, which targets and how( when ) they are

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.