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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:49:15+00:00 2026-05-31T21:49:15+00:00

I am programming for a big project, so I cooperate with others. To make

  • 0

I am programming for a big project, so I cooperate with others.
To make the directory easily managed, my directory is like below:

project:
--include (header files from others supplied for me)
--lib (libraries from others supplied for me)
--L3_CVS  (this folder include all my files)
   -- Makefile 
   -- sourceFile (all my source files here)
       -- include_private(all header files used only by myself)
       -- appl (all my C files here)

My Makefile is below:

####################################################
CROSS_COMPILE=/home/powerpc-wrs-linux-gnu/x86-linux2/powerpc-wrs-linux-gnu-ppc_e500v2-glibc_cgl-

EXTRA_CFLAGS += -g

EXTRA_LDFLAGS +=

LIBSB =-Wl,--start-group -ldiag -ldiag_esw -lacl -ldiagcint -lcint -lsal_appl -lsal_appl_editline -lsal_appl_plat\

-lbcm -lbcm_esw -lbcm_common -lfirebolt -ltitan -ltrident -lhumv -lbradley -lherc -ldraco -lscorpion\

-ltriumph -ltrx -ltriumph2 -lenduro -lkatana -lflexctr -lptp -lsoc_esw -lsoc -lsoc_phy -lsoc_mcm\

-lsoccommon -lsoc_shared -lshared -lsal_core -lsal_core_plat -lcustomer -lsoc_nemo -lsoc_clsbuilder\

-lsoc_sal \

-lbcm_compat -lbcm_rpc -lcpudb  -ltrx  -lstktask -llubde -ldrivers -ldiscover -lcputrans \

-lrcu -lpthread -lrt -lm   -Wl,--end-group

LIBS = -ldiag -lrcu 

CC = $(CROSS_COMPILE)gcc

LD = $(CROSS_COMPILE)ld

AR = $(CROSS_COMPILE)ar

STRIP = $(CROSS_COMPILE)strip


SRC_PATH := ./SourceFile/appl

HEAD_PATH :=  ./SourceFile/include-private


INC_DIR  =  ../include

LIB_PATH =  ../lib


APP_NAME = L3appl

SRCS := $(wildcard $(SRC_PATH)/*.c)

export $(SRCS)

OBJS:= $(patsubst %.c,%.o,$(SRCS)) 

%.d: %.c

    @set -e; rm -f $@; \

    $(CC) -MM  $< > $@.$$$$; \

    sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \

    rm -f $@.$$$$

sinclude $(SRCS:.c=.d)

INCLUDES = $(wildcard $(HEAD_PATH)/*.h)

$(APP_NAME):$(OBJS)

    $(CC)   -c -I$(INC_DIR) $(SRCS)

    $(CC)   -o  $(APP_NAME) $(OBJS) -L$(LIB_PATH) $(LIBSB)  -lpthread -lrt -lm


.PHONY:clean

clean: 

    rm   -f  $(OBJS) $(APP_NAME) 
#################################################

My problem is that when I run make in terminal, it always show : ***No such file or directory
compilation terminated. which seems the .h files in ./SourceFile/include-private do not be included.

But, in fact, I have use “INCLUDES = $(wildcard $(HEAD_PATH)/*.h)” include these .h files.

I don’t know where is wrong!

this is my first time to write makefile. So if there are mistakes in my makefile, I would appreciate that you would point them out !

thank you for your help very much!!!!!!!

  • 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-31T21:49:17+00:00Added an answer on May 31, 2026 at 9:49 pm

    You can try to change $(CC) -c -I$(INC_DIR) $(SRCS) to $(CC) -c -I$(INC_DIR) -include $(INCLUDES) $(SRCS)

    or $(CC) -c -I$(INC_DIR) $(SRCS) to $(CC) -c -I$(INC_DIR) -I$(INCLUDES) $(SRCS)
    where INCLUDES is ./SourceFile/include-private (only the directory, no .h files)

    Edit: Usually you don’t have to explicitly include the .h files, but that’s what the first change do. The second change does not add the .h files explicitely but provide the compiler another include directory where it could search for necessary .h files.

    Refer to GCC man file for more info.

    Regards

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

Sidebar

Related Questions

I am programming for a big project, so I cooperate with others. To make
I'd like to implement a big int class in C++ as a programming exercise—a
I'm writing an editor for large archive files (see below) of 4GB+, in native&managed
When programming a big project, you often need the same pieces of code in
I have taken Problem #12 from Project Euler as a programming exercise and to
Programming Student here...trying to work on a project but I'm stuck. The project is
I try to realize a little game project to dive deeper into OO programming
I have a programming project with highly intensive use of malloc/free functions. It has
I am following a book (Big Nerd Ranch IOS Programming) and the version of
I am doing my Computing Science project. I am doing Multiprocessor programming using C.

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.