avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] FIXED: Flags to use in Building a Library


From: User Tomdean
Subject: Re: [avr-gcc-list] FIXED: Flags to use in Building a Library
Date: Tue, 26 Jul 2005 18:47:57 -0700 (PDT)

I found a work around.  I use FreeBSD.  I include bsd.prog.mk in all
my Makefiles, it eliminates a lot of extra stuff.  The downside is I
have to provide bsd.prog.mk to anyone who wants to use my Makefiles.
Since it is open source, no problem.

I put bsd.lib.mk in my Makefile.  It seems to use the same commands
except for actually building the library.  And, I had to read a LOT of
make scripts to get there.  After jumping thru a lot of hoops, I had
to put in a strange set of commands to make sure bsd.lib.mk had all
the tools.  Like, for example, lorder, which uses nm.  The FreeBSD nm
is looking for

      ELF 32-bit LSB relocatable, Intel 80386, version 1 (FreeBSD), not stripped

while avg-gcc produces

      ELF 32-bit LSB relocatable, version 1 (SYSV), not stripped

So, I had to force lorder to use avr-nm.  This means it has to be in
the shell environment.  No way to get there from make.  All I know how
to do is force an error if NM is not set to avr-nm in the shell
environment.

The final Makefile is below.

tomdean

# libasus Makefile
#
# $Id: Makefile,v 1.1 2005/07/26 18:15:35 tomdean Exp $
#

SRCDIR=../../..

.ifdef ATMEGA8515
_MACH_CPU=atmega8515
.else
_MACH_CPU=atmega16
.endif
_CPUCFLAGS=-mmcu=$(_MACH_CPU)

CC=avr-gcc
AR=avr-ar
RANLIB=avr-ranlib
.ifndef NM
.BEGIN:
        @echo " "
        @echo "================= setenv NM avr-nm before invoke make ======"
        @echo " "
        @# This causes an error - leave it here
        @setenv NM avr-nm
.endif

CFLAGS+=-Wall -Os -I$(SRCDIR)/asus-avr-1.0/include

LIB=asus
NOPROFILE=1
LIBOWN=tomdean
LIBGRP=users
LIBMODE=444 
LIBDIR=../../lib

SRCS=serial_flush.c serial_init.c serial_print.c serial_recv.c serial_send.c \
     bin_to_hex_ascii.c bin_to_decimal_ascii.c

include /usr/share/mk/bsd.lib.mk




reply via email to

[Prev in Thread] Current Thread [Next in Thread]