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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:03:24+00:00 2026-06-06T08:03:24+00:00

This is my VERY FIRST Makefile and so I have cut and paste junk

  • 0

This is my VERY FIRST Makefile and so I have cut and paste junk I have found all over the web. My directory structure is pretty flat and was not thought out for Makefiles. It is:
Project/
Project/Control
Project/NodeMgmt
Project/Common
Project/Interfaces

I am writing a Makefile for Control and would like it to standalone inside Control. It needs to include compile and include from Common & Interfaces. Here’s my Makefile:

CC = g++

CFLAGS = -Wall -c

INCLUDES = -I/usr/local/include -I/SuperCool/Ion-1.0.0-snapshot-1/include -I/SuperCool/FastrakSDK-4.0.1-snapshot-1/include/Fastrak/Engine/Core/CoreIpc -I/Projects/Common -I/Projects/Interfaces -I/Projects/NodeMgmt -I/Projects/Controller 

LFLAGS = -L/usr/local/lib -L/SuperCool/FastrakSDK-4.0.1-snapshot-1/lib

LIBS = -lCoreIpc4 -lIonOs

VPATH = ../Interfaces/
VPATH = ../Common/
VPATH = ../NodeMgmt/

SRCS = *.cc

OBJS = $(SRCS:.cc=.o)

MAIN = controller

.PHONY: clean

all:    $(MAIN)
    @echo Built Controller

$(MAIN): $(OBJS)
    $(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LFLAGS) $(LIBS)

.cc.o:
    $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

clean:
    $(RM) *.o $(MAIN)

It’s compiling the first .cc file it finds “-c Controller.cc -o *.o” which make sense but that’s all it’s compiling and I get a *.o output file, not a Controller.o file. It does not compile any other 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. Editorial Team
    Editorial Team
    2026-06-06T08:03:25+00:00Added an answer on June 6, 2026 at 8:03 am

    Here’s one problem:

    SRCS = *.cc
    

    Make doesn’t understand wildcards without the wildcard function:

    SRCS = $(wildcard *.cc)
    

    That should get it working; we can make minor improvements later.

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

Sidebar

Related Questions

So this was one of my very first questions here, but I have a
This is very basic magento question i guess. I want to first get all
At first, i have to say that this topic is very common topic. I
First of all thanks in advance, this has been very frustrating and I'm hoping
EDIT: solved, look below for my solution. first of all, this is my very
this is my very first post! I have a quick question in regarding inheritance
I have this written at the very first line on every page of my
I'm new here, and this is my very first post. I have a very
This is my very first attempt at including ads in my app. I have
This is the very first time I have set up a git server, as

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.