Matthias Weingart wrote:
> 
> On Sun, Oct 27, 2002 at 05:41:17AM -0400, Garst R. Reese wrote:
> > "Garst R. Reese" wrote:
> > I can post my makefile if anybody wants it.
> 
> Yes, please. Would be a good idea I think :-)
Here it is. Pls note that I took out the -g flag also. Add it back if
you want the debugger.
Garst
#************************************************************************
#*
#* SOS - Small Operating System
#*
#* This is an RTOS for TI MSP430 microcontrollers family.
#*
#* NOTICE: Copyright (C) 2002 by Oleg Skidan
#*
#* Files means any text, html or source files that came with
#* this copyright notice.
#*
#* You may use, embed, modify or distribute the contents
#* of the file(s) in any way you see fit as long as you
#* include this copyright notice in the resulting file(s).
#*
#* Any commercial or industrial use including publishing
#* or distributing in any form requires the written
#* authorization of the copyright holder(s).  Simple
#* e-mail is sufficient.
#*
#* This program is distributed in the hope that it will be useful,
#* but WITHOUT ANY WARRANTY; without even the implied warranty of
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#*
#* The program author can be contacted by E-mail at [email protected].
#*
#* For more details on the background or use of the program, please visit
#* http://users.ints.net/skidan/SOS
#*
#****************************************************************************

#put the name of the target mcu here 
    MCU = msp430x149

#put your C sourcefiles here 
        SRC     = Kernel.c Priority.c Timer.c Events.c CS.c

#put additional assembler source file here
        ASRC =

#additional includes to compile
        INC     = /usr/local/msp430/msp430

#compiler flags
        CPFLAGS = -std=gnu99 -O -Wall -Wstrict-prototypes 

#----------------------------------------------------------------------------------
# MSPGCC standard Makefile part 3
# 
---------------------------------------------------------------------------------

###### BLOCK 1) define some variables based on the MSP base path in $(MSP) 
#######

        CC      = msp430-gcc
        AS      = msp430-gcc -x assembler-with-cpp      
        AR = msp430-ar
        RM      = rm -f
        RN      = mv
        OUT     = coff
        CP      = cp
        BIN     = msp430-objcopy
        SIZE    = msp430-size
        INCDIR  = .
        OBJDIR  = obj
        TRGDIR  = lib
        LIBDIR  = $(MSP)/msp430/lib
        SHELL   = $(MSP)/bin/sh


###### BLOCK 3) define all project specific object files ######

        OBJ     = $(ASRC:.s=.o) $(SRC:.c=.o) 
        CPFLAGS += -mmcu=$(MCU)
        ASFLAGS += -mmcu=$(MCU)

###### BLOCK 5) compile: instructions to create assembler and/or object files 
from C source ######

%.o:  %.c 
        $(CC) -c $(CPFLAGS)  -Wa,-ahlms=$(addprefix $(OBJDIR)/,$(<:.c=.lst)) 
-I$(INCDIR) $< -o $(OBJDIR)/$@

%.s : %.c
        $(CC) -S $(CPFLAGS) -I$(INCDIR) $< -o $(OBJDIR)/$@


###### BLOCK 6) assemble: instructions to create object file from assembler 
files ######

%.o : %.s
        $(AS) -c $(ASFLAGS) -I$(INCDIR) $< -o $(OBJDIR)/$@


###### BLOCK 7)  arch: instructions to create library output file from object 
files ######
OS.a : $(OBJ)
        ${AR} -rcsv $(TRGDIR)/$@ $(addprefix $(OBJDIR)/,$(OBJ))
        $(SIZE) $(TRGDIR)/$@


###### BLOCK 8)  make instruction to delete created files ######

clean:
        $(RM) $(addprefix $(OBJDIR)/,$(OBJ))
        $(RM) $(TRGDIR)/OS.a
        @echo "Errors: none"
        

Reply via email to