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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:24:39+00:00 2026-05-20T11:24:39+00:00

I am trying to modify a Makefile, and I can’t find the rule for

  • 0

I am trying to modify a Makefile, and I can’t find the rule for that.

The following doesn’t work. I don’t know how to write the src to obj rules.

# foo.c bar.c main.c
SRC = $(wildcard *.c)
OBJ_1 = $(patsubst %.c,%_1.o,$(SRC))
OBJ_2 = $(patsubst %.c,%_2.o,$(SRC))

GCC1 = vtcc
GCC2 = vtcc

LD_FLAGS= -lm -lpthread 

all: a1 a2

# executables :
a1: $(OBJ_1)
    $(GCC1) $(LDFLAGS) $^ -o $@
a2: $(OBJ_2)
    $(GCC2) $(LDFLAGS) $^ -o $@

# objects :
$(OBJ_1) : $(SRC)
    $(GCC1) -c $< -o $@

$(OBJ_2) : $(SRC)
    $(GCC2) -c $< -o $@
  • 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-20T11:24:39+00:00Added an answer on May 20, 2026 at 11:24 am

    It’s hard tell what your question is, but I think the last two rules should be:

    # objects :
    $(OBJ_1) : %_1.o : %.c
        $(GCC1) -c $< -o $@
    
    $(OBJ_2) : %_2.o : %.c
        $(GCC2) -c $< -o $@
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to modify some exports. I understand that this code doesn't work because
I'm trying to modify the following query to find the rank of a specific
I'm trying to modify my test so that any database work is rolled back
Hi I'm trying to modify a web page so that it loads faster. Since
I've been trying to modify the AuditTrail code so that it does not copy
I'm trying to modify the text of a Label component that I already placed
I'm trying to debug a package that I'm developing. I use a makefile for
i've been trying to modify the program so that it could accept more than
I'm trying to modify the various loaders out there so multiple scripts can be
I am trying to modify Apple's PhotoScroller example and I encountered a problem that

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.