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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:05:03+00:00 2026-05-27T05:05:03+00:00

My Makefile keeps telling me make: *** No rule to make target `rs232.c’, I

  • 0

My Makefile keeps telling me

make: *** No rule to make target `rs232.c',

I list the files here (rs232.c is at the very end) –

SOURCES_RAW=codeprofiler.cpp gametimer.cpp timer.cpp timeprofile.cpp vector4.cpp matrix.cpp agent.cpp agentcontroller.cpp dummy.cpp evader.cpp pursuer.cpp goal.cpp player.cpp graphdata.cpp graph.cpp cubiccoefs.cpp segment.cpp trajectory.cpp anode.cpp arrayvector4.cpp color.cpp drawcomponent.cpp drawcontroller.cpp flags.cpp global.cpp map_analyzer.cpp minheap.cpp node.cpp quadtree.cpp queue.cpp results.cpp sensor.cpp settings.cpp utility.cpp world.cpp gui.cpp main.cpp logger.cpp parameters.cpp counter.cpp polygon.cpp line.cpp robot_driver_agent.cpp position.cpp robot_driver_priorityqueue.cpp main.cpp robot_driver_tree.cpp robot_driver_grid.cpp path.cpp tcpserver.cpp tcpclient.cpp servercontrol.cpp clientcontrol.cpp Robot.cpp udpserver.cpp udpclient.cpp rs232.c 

All of there files are in a folder called src. So I do –

SRCDIR= src
SOURCES:=$(SOURCES_RAW)
SOURCES:=$(patsubst %.c, $(SRCDIR)/%.c, $(SOURCES))
SOURCES:=$(patsubst %.cpp, $(SRCDIR)/%.cpp, $(SOURCES))

Why will it not compile the .c file?

The entire Makefile is –

INCLUDE = -I/usr/X11R6/include
#INCLUDE_W32 = -Isrc 
CC=g++ 
CFLAGS=-w -D LINUX -fpermissive 
CFLAGS_R= -w -D LINUX -O3 -fpermissive 
CFLAGS_D=-w -D LINUX -fpermissive 
OBJ= obj
OBJ_DEBUG= obj_debug
OBJDIR= release
SRCDIR= src

LDFLAGS= -L/usr/X11R6/lib$(LIBSELECT) -lGL -lfltk -lfltk_gl -lXext -lX11 -lglut -lGLU -lfltk_images

SOURCES_RAW=codeprofiler.cpp gametimer.cpp timer.cpp timeprofile.cpp vector4.cpp matrix.cpp agent.cpp agentcontroller.cpp dummy.cpp evader.cpp pursuer.cpp goal.cpp player.cpp graphdata.cpp graph.cpp cubiccoefs.cpp segment.cpp trajectory.cpp anode.cpp arrayvector4.cpp color.cpp drawcomponent.cpp drawcontroller.cpp flags.cpp global.cpp map_analyzer.cpp minheap.cpp node.cpp quadtree.cpp queue.cpp results.cpp sensor.cpp settings.cpp utility.cpp world.cpp gui.cpp main.cpp logger.cpp parameters.cpp counter.cpp polygon.cpp line.cpp robot_driver_agent.cpp position.cpp robot_driver_priorityqueue.cpp main.cpp robot_driver_tree.cpp robot_driver_grid.cpp path.cpp tcpserver.cpp tcpclient.cpp servercontrol.cpp clientcontrol.cpp Robot.cpp udpserver.cpp udpclient.cpp rs232.c

TARGET:= pursuit_evasion
TARGETD:= pursuit_evasion_d
TARGETP:= pursuit_evasion_p
TARGETW32:= pursuit_evasion_w32

OBJECTS:=$(SOURCES_RAW:.cpp=.o)
OBJECTS:=$(patsubst %.o,$(OBJDIR)/%.o, $(OBJECTS))

SOURCES:=$(SOURCES_RAW)
SOURCES:=$(patsubst %.cpp, $(SRCDIR)/%.cpp, $(SOURCES))

OBJ_DEBUG:=$(SOURCES_RAW:.cpp=.o)
OBJ_DEBUG:=$(patsubst %.o,debug/%.o, $(OBJ_DEBUG))

OBJECTS_P:=$(SOURCES_RAW:.cpp=.o)
OBJECTS_P:=$(patsubst %.o,profile/%.o, $(OBJECTS_P))

OBJDIR=obj

all: $(TARGET)

#--- Release 
$(TARGET): $(OBJECTS)
    $(CC) -w -D LINUX $(INCLUDE) $^ -o $@ $(LDFLAGS)

release/%.o: src/%.cpp
    $(CC) -c $< $(CFLAGS_R) -o $@ 

#--- Debug
debug: $(TARGETD)

$(TARGETD): $(OBJ_DEBUG)
    $(CC) -w -D LINUX $(INCLUDE) $^ -o $@ $(LDFLAGS)

debug/%.o: src/%.cpp
    $(CC) -c -g $< $(CFLAGS)-o $@ 

#-- Profile
profile: $(TARGETP)

$(TARGETP): $(OBJECTS_P)
    $(CC) -w -g -pg -D LINUX $(INCLUDE) $^ -o $@ $(LDFLAGS)

profile/%.o: src/%.cpp
    $(CC) -c -g -pg $< $(CFLAGS)-o $@ 

win32: $(TARGETW32)

$(TARGETW32): $(OBJECTS)
    $(CC) -w -D WIN32 $(INCLUDE_W32) $^ -o $@ $(LDFLAGS)

.PHONY : clean
clean:
    rm -f release/*.o
    rm -f debug/*.o
    rm -f profile/*.o
    rm -f $(TARGET) $(TARGETD) $(TARGETP)
  • 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-27T05:05:03+00:00Added an answer on May 27, 2026 at 5:05 am

    All your previous files (before rs232.c) are actually C++ files.

    I guess you have a rule to compile C++ files, later in your makefile, but do you also have a rule to compile pure C files?

    Like:

    %.o: %.c
        gcc [...]
    

    EDIT – Just for you to know

    You’re not forced to specify all the files you want to compile.

    Take a look at the foreach and dir functions.
    With that, you can get all files matching a specific pattern from a directory.

    Example:

    FILES = $(foreach dir,$(DIR_SRC),$(wildcard $(DIR_SRC)*.cpp))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to run make on a PintOS makefile but I keep getting
I have a large makefile which builds several libraries, installs them, and then keeps
I wrote a makefile which behaves oddly. You can find it here: http://pastebit.com/pastie/8215 Basically
Here is the makefile: CC = g++ LD = g++ CFLAGS = -I/usr/X11R6/include -I.
This is a brain-dead newbie question, but here goes: What determines what files get
Lets say I call: make -j 5 Is there a way, within my Makefile
bmake: Makefile line 20: warning: duplicate script for target xyz ignored bmake: Makefile line
I want my Makefile to be invoked like this: make x11 oss bin which
What forces are at work keeping crufty old Make (with or without makefile generator
My makefile is failing to determine the make and version of ld. A typical

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.