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

  • Home
  • SEARCH
  • 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 913753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:36:36+00:00 2026-05-15T17:36:36+00:00

I looking to optimize an existing Makefile. It’s used to create multiple plots (using

  • 0

I looking to optimize an existing Makefile. It’s used to create multiple plots (using Octave) for every logfile in a given directory using an scriptfile for every plot which takes a logfilename as an argument. In the Moment, I use one single rule for every kind of plot available, with a handwritten call to Octave, giving the specific scriptfile/logfile as an argument.

It would be nice, if every plot has “his” octave-script as a dependency (plus the logfile, of course), so only one plot is regenerated if his script is changed.

Since I don’t want to type that much, I wonder how I can simplifiy this by using only one general rule to build “a” plot?

To make it clearer:

  • Logfile: “$(LOGNAME).log”
  • Scriptfile: “plot$(PLOTNAME).m” creates “$(LOGNAME)_$(PLOTNAME).png”

The first thing I had in mind:

%1_%2.png: %1.log
    $(OCTAVE) --eval "plot$<2('$<1')"

But this seems not to be allowed. Could someone give me a hint?

  • 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-15T17:36:37+00:00Added an answer on May 15, 2026 at 5:36 pm

    It’s pretty crazy that make doesn’t support this directly, I need it all the time.

    The technique I use at the moment (with GNU make) (building on Didier Trosset’s example):

    define OCT_template
    
    all: %_$(1).png
    
    %_$(1).png: %.log
        $$(OCTAVE) --eval "plot$(1)('$$*')"
    
    endef
    
    PLOT_NAMES = plot1 plot2 plot3
    
    $(foreach p, $(PLOT_NAMES), \
      $(eval $(call OCT_template,$(p))) \
    )
    

    This is in the GNU make documentation.

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

Sidebar

Related Questions

In my custom view I'm looking into using Canvas.getClipBounds() to optimize my onDraw method
Is there any way to optimize the query below? It requires looking through multiple
I'm just looking to optimize the code below. It works, but I want to
Looking to do a bit of refactoring... Using NHibernate I have this query currently
Looking at the Slickgrid examples and using Google Chrome, I'm setting a breakpoint on
Looking to optimize the performance of WCF Rest services hosted on Azure. The services
I am looking to optimize how we build forms for some of our models
I am looking for some advice how to optimize a couple of SQL stored
I am looking to optimize my LINQ query because although it works right, the
I have a complex objective function I am looking to optimize. The optimization problem

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.