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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:43:58+00:00 2026-05-10T17:43:58+00:00

In a recent issue , I’ve found that DJGPP can only accept the DOS

  • 0

In a recent issue, I’ve found that DJGPP can only accept the DOS command line character limit. To work around this limitation, I’ve decided to try to write a makefile to allow me to pass longer strings. In the process of hacking together a makefile and testing it, I’ve come across a strange error. The makefile is as follows:

AS  :=  nasm CC  :=  gcc LD  :=  ld  TARGET      :=  $(shell basename $(CURDIR)) BUILD       :=  build SOURCES     :=  source  CFLAGS  :=  -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions \             -nostdinc -fno-builtin -I./include ASFLAGS :=  -f aout  export OUTPUT   :=  $(CURDIR)/$(TARGET)  CFILES      :=  $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) SFILES      :=  $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))  SOBJS   :=  $(SFILES:.s=.o) COBJS   :=  $(CFILES:.c=.o) OBJS    :=  $(SOBJS) $(COBJS)  build   :   $(TARGET).img  $(TARGET).img   :   $(TARGET).bin     concat.py  $(TARGET).bin   :   $(OBJS)     $(LD) -T link.ld -o $@ $^  $(SOBJS)    :   %.o :   %.asm     $(AS) $(ASFLAGS) $< -o $@  $(COBJS)    :   %.o :   %.c     $(CC) -c $< $(CFLAGS) -o $@ 

When attempting to run it, I receive this error:

make: *** No rule to make target `consoleio.c', needed by `consoleio.o'.  Stop.

What I don’t understand is why it’s trying to find a rule for .c files. From what I understand, if the file is there, it should just use it. How do I make make not need a rule for .c files?

  • 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. 2026-05-10T17:43:58+00:00Added an answer on May 10, 2026 at 5:43 pm

    What you are trying to do will not work without VPATH, and since you are still learning makefiles, I would avoid using VPATH.

    The rule is looking for ‘consoleio.c’, which if I understood your makefile correctly does not exist; what exists is ‘source/consoleio.c’. You probably should change it to something like ‘$(SOURCES)/%.c’ instead of ‘%c’.

    I didn’t check your syntax for that rule, however. If it’s incorrect, the builtin ‘%.o: %.c’ rule will be used instead, which would have the same problem.

    The way you are doing is not the usual way I’ve seen, however. The usual way is to:

    • Create an implicit rule ‘%.o: %.c’ (or in your case ‘%.o: $(SOURCES)/%.c’)
    • Explicit list the dependencies for each file: ‘foo.o: foo.c bar.h baz.h’ (with no command, the implicit rule has the command)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've only just recent began learning C++ and am having a little issue with
In my recent project which is using Asp.net Mvc 2, we found that the
A recent question about string literals in .NET caught my eye. I know that
I have a similar issue as my recent post but with a zip code
Given my recent (somewhat successful) question: Algorithmic issue: determining "user sessions" I'm pretty sure
Several comments on a recent answer of mine, What other useful casts can be
Recent conversations with colleagues have produced varying points of view on this matter. What
The Recent Projects panel on the Start Page of VS2008 Professional doesn't appear to
A recent article on Ars Technica discusses a recent study performed by the Psychology
A recent question came up about using String.Format(). Part of my answer included 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.