Difference between revisions of "JuiceBox Code Test Makefile"
From eLinux.org
m (Bot (Edward's framework)) |
|||
| Line 1: | Line 1: | ||
| − | |||
<pre> | <pre> | ||
# file: test_1.mak | # file: test_1.mak | ||
| Line 56: | Line 55: | ||
</pre> | </pre> | ||
| + | |||
| + | [[Category:JuiceBox]] | ||
Latest revision as of 09:02, 14 July 2007
# file: test_1.mak
#########################################################################
# the name of the project
#
PROJECT=test_1
# List of the objects files in the project
# Keep it current with all the source!
#
OBJECTS = $(PROJECT).o crt0.o
# Here's where the compiler options can be messed up
#
GCC = D:/cygwin/opt/rtems-4.6/bin/arm-rtems-gcc
GCFLAGS = -Wall -nostartfiles -mcpu=arm7tdmi -msoft-float
OBJCOPY = D:/cygwin/opt/rtems-4.6/bin/arm-rtems-objcopy
#
#########################################################################
all:: $(PROJECT).hex
$(PROJECT).hex: $(PROJECT).elf
$(OBJCOPY) -R .stack -S -O ihex $(PROJECT).elf $(PROJECT).hex
$(PROJECT).elf: $(OBJECTS)
$(GCC) $(GCFLAGS) -T $(PROJECT).dld $(OBJECTS) -Xlinker -Map -Xlinker $(PROJECT).map -o $(PROJECT).elf
#########################################################################
# Default rules to compile .c and .cpp file to .o
# and assemble .s files to .o
.c.o :
$(GCC) $(GCFLAGS) -c $<
$(GCC) -MM -o $*.d $<
.cpp.o :
$(GCC) $(GCFLAGS) -c $<
$(GCC) -MM -o $*.d $<
.s.o :
$(GCC) -x assembler-with-cpp $(GCFLAGS) -Wa,-gstabs -c $<
#########################################################################
#########################################################################
# Optional: copy all the .d files (autodependicies from source files) to the bottom of the makefile
# This will ensure that header file mods will force a recompile, if needed
# To update: delete everything after this line and "cat *.d >> rio_3.mak"