This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: about makefile
- From: "Robert Cragie" <rcc at jennic dot com>
- To: =?gb2312?B?1cUgwcE=?= <johnsonest at hotmail dot com>
- Cc: <ecos-discuss at sources dot redhat dot com>
- Date: Thu, 26 Sep 2002 10:37:31 +0100
- Subject: RE: [ECOS] about makefile
Comments inline
> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of 张 亮
> Sent: 26 September 2002 10:00
> To: nickg@ecoscentric.com
> Cc: ecos-discuss@sources.redhat.com
> Subject: [ECOS] about makefile
>
>
> Dear nickg,
> i have difficulty in orgnizing my header file and source file with
> makefile:
> I create two folder ,named after "include" and "src" in current directory:
> >ls
> include src test.c
>
> in test.c, i want to call codes in "include" and "src" folder:
>
> #include <stdio.h>
> #include "cs.h" //in include folder
>
> int main()
> {
> ....
> ...
> call fucntions in file "cs.c" in folder "src"
> ...
>
>
> }
>
> to compile this
> my makefile is:
>
> HEADER_DIR = include
> test: test.o cs.o
> gcc -o test test.o cs.o
>
> test.o: test.c cs.h
> gcc -c test.c
> cs.o : cs.c cs.h
> gcc -c cs.c -I$(SOURCE_DIR)
Make sure the command in preceded by a TAB character, not just spaces - the
indentation above looks suspicious.
To quote the make guide:
"A command is an action that make carries out. A rule may have more than one
command, each on its own line. Please note: you need to put a tab character
at the beginning of every command line! This is an obscurity that catches
the unwary."
>
> clean:
> -rm *.o
>
> but:
> >make
> make: *** No rule to make target `cs.c', needed by `cs.o'. Stop.
> in fact,my cs.c is a set of functions called each other,no entry function.
>
> i am a newcomer about makefile,could you check my makefile ,tell me where
> error occur?
>
>
> thank you very much !!!!!!!!!!!!!
>
> >From: Nick Garnett <nickg@ecoscentric.com>
> >To: 张 亮 <johnsonest@hotmail.com>
> >CC: ecos-discuss@sources.redhat.com
> >Subject: Re: [ECOS] Re: On ecos interrupt process
> >Date: 25 Sep 2002 18:11:58 +0100
> >
> >张 亮 <johnsonest@hotmail.com> writes:
> >
> > > Hi,nickg!
> > > thank you very much,I think i have grasped it!
> > > Now,i want study linux source code and want to modify
> linux kernel
> ,
> > > but lack of some directions,for example,how to establish linux debug
> > > enviorment?
> > > could you help me?
> > >
> >
> >I know very little about the details of the Linux kernel -- it has
> >little relevance to the kind of stuff I do. I believe that debugging
> >the Linux kernel is not easy.
> >
> >--
> >Nick Garnett - eCos Kernel Architect
> >http://www.eCosCentric.com/
>
>
>
>
> _________________________________________________________________
> 与联机的朋友进行交流,请使用 MSN Messenger:
> http://messenger.microsoft.com/cn/
>
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss