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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:33:16+00:00 2026-06-13T23:33:16+00:00

I recently found this piece of example code from the GNU make documentation that

  • 0

I recently found this piece of example code from the GNU make documentation that refers to the eval function. I really like it, but when I tried to test it on my machine (make 3.81/Debian), all it does is trying to link the server without compiling the c files first … why? Is make 3.81 not compatible?

Shell output:

$ make
cc     -o server
cc: no input files

Code:

 PROGRAMS    = server client

 server_OBJS = server.o server_priv.o server_access.o
 server_LIBS = priv protocol

 client_OBJS = client.o client_api.o client_mem.o
 client_LIBS = protocol

 # Everything after this is generic

 .PHONY: all
 all: $(PROGRAMS)

 define PROGRAM_template =
  $(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%)
  ALL_OBJS   += $$($(1)_OBJS)
 endef

 $(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog))))

 $(PROGRAMS):
         $(LINK.o) $^ $(LDLIBS) -o $@

 clean:
         rm -f $(ALL_OBJS) $(PROGRAMS)
  • 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-06-13T23:33:17+00:00Added an answer on June 13, 2026 at 11:33 pm

    I think it will work if you remove the = from the define line:

    define PROGRAM_template
      ...
    endef
    

    I’ve tested this with GNUMake 3.81. As for why this works and the version in the manual doesn’t, I have no idea.

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

Sidebar

Related Questions

Recently I found a piece of code that creates an instance of TButton from
This question is based off some really odd code I recently found in a
I recently found this piece of JavaScript code: Math.random() * 0x1000000 << 0 I
I recently found this little piece of code for my .vimrc if has(autocmd) Highlight
I recently found that this is impossible in SQLite: SELECT * FROM fruit WHERE
I recently found this post . It basically says that Eclipse has a modified
I've recently found this blog entry on a tool that writes XSS attacks directly
I just recently found myself writing this line of code, which i did not
I recently found an article online that told me about this: RewriteRule ^mock-up/([^/]+)/([^/]+) /mock-up/index.php?page=$1&section=$2
EDIT 9-3-10: I found this blog entry recently that was very enlightening. http://optimizermagic.blogspot.com/2007/12/outerjoins-in-oracle.html There

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.