public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Questions on creating a makefile
@ 2000-01-26 11:45 Tim Michals
  2000-01-26 13:00 ` Jonathan Larmour
  2000-01-26 13:13 ` Jesper Skov
  0 siblings, 2 replies; 4+ messages in thread
From: Tim Michals @ 2000-01-26 11:45 UTC (permalink / raw)
  To: ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

All,
 
I'm confused on how create a new application. I created a application directory and downloaded several of the 
test applications to test the board and OS. Now I would like to create my 
own rom application. I having some confusion on how to use the existing 
makefiles to create my new application.  Can anyone provided a sample 
makefile? 
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Questions on creating a makefile
  2000-01-26 11:45 [ECOS] Questions on creating a makefile Tim Michals
@ 2000-01-26 13:00 ` Jonathan Larmour
  2000-01-26 13:33   ` Tim Michals
  2000-01-26 13:13 ` Jesper Skov
  1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Larmour @ 2000-01-26 13:00 UTC (permalink / raw)
  To: Tim Michals; +Cc: ecos-discuss

> Tim Michals wrote:
> 
> I'm confused on how create a new application. I created a application
> directory and downloaded several of the test applications to test the
> board and OS. Now I would like to create my own rom application. I having
> some confusion on how to use the existing makefiles to create my new
> application.  Can anyone provided a sample makefile?

First, to build a ROM image, you need to change the startup type of eCos.
You can do this in the graphical Configuration tool by changing the Startup
type listed under the HAL in question. Or if you are using pkgconf.tcl,
simply reinvoke it in the same build tree with "--startup rom".

As for the sample makefile, you can start with the one in the examples/
directory of the eCos installation, although it isn't perfect by any stretch
of the imagination.

Is that the type of answer you are looking for?

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS   Tel: +44 (1223) 728762
"I used to have an open mind but || Get yer free open source RTOS's here...
 my brains kept falling out."    || http://sourceware.cygnus.com/ecos
Help fight spam! http://spam.abuse.net/  These opinions are all my own fault

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Questions on creating a makefile
  2000-01-26 11:45 [ECOS] Questions on creating a makefile Tim Michals
  2000-01-26 13:00 ` Jonathan Larmour
@ 2000-01-26 13:13 ` Jesper Skov
  1 sibling, 0 replies; 4+ messages in thread
From: Jesper Skov @ 2000-01-26 13:13 UTC (permalink / raw)
  To: Tim Michals; +Cc: ecos-discuss

>>>>> "Tim" == Tim Michals <tim@cygnetinc.com> writes:
Tim> I'm confused on how create a new application. I created a
Tim> application = directory and downloaded several of the test
Tim> applications to test the = board and OS. Now I would like to
Tim> create my own rom application. I = having some confusion on how
Tim> to use the existing makefiles to create my = new application.
Tim> Can anyone provided a sample makefile?=20 =20

Here's the makefile which is part of the documentation examples.

Try to uncomment the appropriate XCC line and type

 % make hello

That should show you the basic commands required to link your own
application with eCos.

Jesper


# Mostly written by Jonathan Larmour, Cygnus Solutions
# This file is in the public domain and may be used for any purpose

# PKG_INSTALL_DIR might need to be edited.  Right now it is set
# assuming that a user ran pkgconf.tcl in //c/ecos-work on Windows NT,
# or used the Configuration Tool with C:\ecos-work as a build-tree.
#
# You can also override it on the make command-line, e.g.:
#   make PKG_INSTALL_DIR=/myecc/install
# or you can set it in your environment

PKG_INSTALL_DIR = //c/ecos-work/install

# You must also set XCC to the name of your cross-compiler, including any
# options it needs.

# Uncomment one of the below, or invoke make with the name of the compiler
# you want, e.g.:
#   make XCC="sparclite-elf-gcc -mcpu=sparclite"
# You can also set XCC in your environment

#XCC = mn10300-elf-gcc
#XCC = mips-tx39-elf-gcc
#XCC = sh-elf-gcc
#XCC = powerpc-eabi-gcc -msoft-float -mcpu=860
#XCC = arm-elf-gcc -mcpu=arm7di             # AEB
#XCC = arm-elf-gcc -mcpu=arm7tdmi           # PID
#XCC = arm-elf-gcc -mcpu=strongarm          # EBSA285
#XCC = sparclite-elf-gcc -mcpu=sparclite
#XCC = i686-pc-linux-gnu-gcc

###### VARIABLES
# Any of these can be overriden on the command-line or in your environment

ifeq ($(XCC),sh-elf-gcc)
CFLAGS        = -ggdb
else
CFLAGS        = -g
endif

CXXFLAGS      = $(CFLAGS)

EXTRACFLAGS   = -Wall -I$(PKG_INSTALL_DIR)/include -ffunction-sections -fdata-sections

EXTRACXXFLAGS = $(EXTRACFLAGS) -fno-exceptions -fno-rtti -fvtable-gc -finit-priority

LDFLAGS       = -nostartfiles -L$(PKG_INSTALL_DIR)/lib -Wl,--gc-sections
LIBS          = -Ttarget.ld -nostdlib

LD            = $(XCC)
XCXX          = $(XCC)

###### RULES

.PHONY: all clean CCCHECK

all: hello twothreads simple-alarm serial

clean:
	-rm -f hello hello.o twothreads twothreads.o
	-rm -f simple-alarm simple-alarm.o serial serial.o
	-rm -f instrument-test instrument-test.o

CCCHECK:
ifeq ($(XCC),)
	@echo You must set XCC to the name of your cross-compiler
	@false
endif


%.o: %.c
	$(XCC) -c -o $*.o $(CFLAGS) $(EXTRACFLAGS) $<

%.o: %.cxx
	$(XCXX) -c -o $*.o $(CXXFLAGS) $(EXTRACXXFLAGS) $<

%.o: %.C
	$(XCXX) -c -o $*.o $(CXXFLAGS) $(EXTRACXXFLAGS) $<

%.o: %.cc
	$(XCXX) -c -o $*.o $(CXXFLAGS) $(EXTRACXXFLAGS) $<

hello: CCCHECK hello.o
	$(LD) $(LDFLAGS) -o $@ $@.o $(LIBS)

twothreads: CCCHECK twothreads.o
	$(LD) $(LDFLAGS) -o $@ $@.o $(LIBS)

simple-alarm: CCCHECK simple-alarm.o
	$(LD) $(LDFLAGS) -o $@ $@.o $(LIBS)

serial: CCCHECK serial.o
	$(LD) $(LDFLAGS) -o $@ $@.o $(LIBS)

instrument-test: CCCHECK instrument-test.o
	$(LD) $(LDFLAGS) -o $@ $@.o $(LIBS)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Questions on creating a makefile
  2000-01-26 13:00 ` Jonathan Larmour
@ 2000-01-26 13:33   ` Tim Michals
  0 siblings, 0 replies; 4+ messages in thread
From: Tim Michals @ 2000-01-26 13:33 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: ecos-discuss

Thanks,

I started to use the example makefile and adding from there.  I guess what I
was looking for was an integrated makefile that is from the package that you
are building from.  Also, outlining all of the library's.



----- Original Message -----
From: "Jonathan Larmour" <jlarmour@redhat.co.uk>
To: "Tim Michals" <tim@cygnetinc.com>
Cc: <ecos-discuss@sourceware.cygnus.com>
Sent: Wednesday, January 26, 2000 3:00 PM
Subject: Re: [ECOS] Questions on creating a makefile


> > Tim Michals wrote:
> >
> > I'm confused on how create a new application. I created a application
> > directory and downloaded several of the test applications to test the
> > board and OS. Now I would like to create my own rom application. I
having
> > some confusion on how to use the existing makefiles to create my new
> > application.  Can anyone provided a sample makefile?
>
> First, to build a ROM image, you need to change the startup type of eCos.
> You can do this in the graphical Configuration tool by changing the
Startup
> type listed under the HAL in question. Or if you are using pkgconf.tcl,
> simply reinvoke it in the same build tree with "--startup rom".
>
> As for the sample makefile, you can start with the one in the examples/
> directory of the eCos installation, although it isn't perfect by any
stretch
> of the imagination.
>
> Is that the type of answer you are looking for?
>
> Jifl
> --
> Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS   Tel: +44 (1223)
728762
> "I used to have an open mind but || Get yer free open source RTOS's
here...
>  my brains kept falling out."    || http://sourceware.cygnus.com/ecos
> Help fight spam! http://spam.abuse.net/  These opinions are all my own
fault

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-01-26 13:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-26 11:45 [ECOS] Questions on creating a makefile Tim Michals
2000-01-26 13:00 ` Jonathan Larmour
2000-01-26 13:33   ` Tim Michals
2000-01-26 13:13 ` Jesper Skov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).