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

  • Home
  • SEARCH
  • 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 906817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:27:02+00:00 2026-05-15T16:27:02+00:00

gcc 4.4.4 I have the following Makefile OBJECT_FILES = brd.o logger.o test_brd.o CFLAGS =

  • 0

gcc 4.4.4

I have the following Makefile

OBJECT_FILES = brd.o logger.o test_brd.o
CFLAGS = -m32 -ggdb -Wall -Wextra -D_REENTRANT -D_THREAD_SAFE -O0 -D_DEBUG

# Linker Run-time library path
LDFLAGS = -Wl,-rpath=/usr/NET/lib 

FLATFORM = -DLINUX
TARGET = dlg
CC = gcc -m32

LIBS_PATH = -L/usr/NET/lib
INC_PATH = -I/usr/NET/include

LIBS = -lnc -lnxx -lphread

$(TARGET): $(OBJECT_FILES)
    $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECT_FILES) $(FLATFORM) $(INC_PATH) $(LIBS_PATH) $(LIBS) -o $(TARGET)

test_brd.o: test_brd.c brd.c
    $(CC) -c $(CFLAGS) test_brd.c

brd.o: brd.c logger.c
    $(CC) -c $(CFLAGS) $(INC_PATH) brd.c

logger.o: logger.c
    $(CC) -c $(CFLAGS) $(INC_PATH) logger.c

clean: 
    rm -f $(TARGET) $(OBJECT_FILES)

However, the logger.c doesn’t need to be built anymore. Is there a way to include it in the project without having to compile it each time. When I clean my project. It will re-compile it again, and it is a large file.

Many thanks for any suggestions,

  • 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-15T16:27:02+00:00Added an answer on May 15, 2026 at 4:27 pm

    You could change:

    OBJECT_FILES = brd.o logger.o test_brd.o
    

    into:

    OBJECT_FILES_EXCEPT_LOGGER = brd.o test_brd.o
    OBJECT_FILES = $(OBJECT_FILES_EXCEPT_LOGGER) logger.o
    

    and change your clean to:

    clean: 
        rm -f $(TARGET) $(OBJECT_FILES_EXCEPT_LOGGER)
    

    But the whole point to clean is to do a full rebuild. If you don’t want a full rebuild, just use make on its own and it’ll build only what it needs to. With a properly built makefile, you should almost never need to do a full rebuild (the only exception I can think of to that is when you change the makefile itself but I even bypass that by making all rules depend on the makefile as well).

    By the way,

    brd.o: brd.c logger.c
    

    and

    test_brd.o: test_brd.c brd.c
    

    don’t seem write to me – there’s no dependency between brd.o and logger.c, nor between test_brd.o and brd.c (at least based on your compilation statements). The only way you would have a dependency is if you #include‘d one C file within another, and that’s rarely a good idea.

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

Sidebar

Related Questions

I have the following bits in my makefile : GLFW_FLAG := -m32 -O2 -Iglfw/include
I have the following makefile: prog1: prog1.c gcc -o prog1.exe prog1.c prog2: prog2.c gcc
I have the following make file: CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS =
I have the following makefile: CC = gcc SRC = source1.c EXE = source1
I have following piece of code: It compiles without problems under gcc-3.4, gcc-4.3, intel
I have the following code compiled by gcc: #include <iostream> using namespace std; class
I have the following piece of code compiling under gcc: int parseMsg(const char *msg_to_parse,
gcc 4.4.2 I have the following code: char channels[] = NumberOfChannel = [2]; sscanf(channels,
I have the following string from which I want to extract gcc-4.3.2 and C
gcc 4.1.2 c99 I have the following enum's in this file ccsmd.h : enum

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.