introduced .MCU makefile variable so we can remove .ARCH later which is only used to set the MCU type for the compiler. .MCU is now only used for AVRs as for the others it is set in the makefiles (e.g. Makefile.arm7, Makefile.stm32, etc.)

This commit is contained in:
Felix Ruess
2010-09-22 21:40:15 +00:00
parent 9b3b1b03b4
commit f5bc50323b
7 changed files with 19 additions and 20 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ COPY = cp
Q=@
# MCU name and submodel
MCU = $($(TARGET).ARCH)
MCU = arm7tdmi
THUMB = -mthumb
THUMB_IW = -mthumb-interwork
+10 -10
View File
@@ -1,5 +1,5 @@
# Hey Emacs, this is a -*- makefile -*-
#
#
# $Id$
# Copyright (C) 2003-2005 Pascal Brisset, Antoine Drouin
#
@@ -18,8 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# Boston, MA 02111-1307, USA.
#
#
@@ -36,7 +36,7 @@ VERIFY=--verify
SRC_ARCH = $(PAPARAZZI_SRC)/sw/airborne/avr
CC = $(ATMELBIN)/avr-gcc -mmcu=$($(TARGET).ARCH)
CC = $(ATMELBIN)/avr-gcc -mmcu=$($(TARGET).MCU)
LD = $(CC) $(ATMEL_LIBPATH)
SIZE = $(ATMELBIN)/avr-size
OBJCOPY = $(ATMELBIN)/avr-objcopy
@@ -115,7 +115,7 @@ check_fuses: check_arch
@if (grep -i 'Fuse Low Byte' $(TMPFILE) | cut -c24- | grep -iq $($(TARGET).LOW_FUSE)) && (grep -i 'Fuse High Byte' $(TMPFILE) |cut -c24- | grep -iq $($(TARGET).HIGH_FUSE)) && (grep -i 'Fuse Extended Byte' $(TMPFILE) |cut -c24- | grep -iq $($(TARGET).EXT_FUSE)) && (grep -i 'Lock Bits' $(TMPFILE) |cut -c24- | grep -iq $($(TARGET).LOCK_FUSE)); then echo "-> Fuses are Ok"; rm $(TMPFILE); else echo "-> Wrong fuses. Type 'make wr_fuses'"; rm $(TMPFILE); exit 1; fi
# Define all object files.
COBJ = $(SRC:%.c=$(OBJDIR)/%.o)
COBJ = $(SRC:%.c=$(OBJDIR)/%.o)
COBJAVR = $(SRCAVR:%.c=$(OBJDIR)/%.o)
@@ -156,7 +156,7 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/../Makefile.ac
%.install: $(OBJDIR)/%.hex check_arch
# stk200 needs to be erased first
# stk200 needs to be erased first
$(UISP) $(UISP_FLAGS) --erase
@echo SIZE
$(Q)$(SIZE) $<
@@ -166,9 +166,9 @@ erase: check_arch
$(UISP) $(ISP_FLAGS) --erase
check_arch :
@echo "CHECKING link with device $($(TARGET).ARCH) on $(PROG_PORT)"
@echo "CHECKING link with device $($(TARGET).MCU) on $(PROG_PORT)"
$(Q)$(UISP) $(UISP_FLAGS)
$(Q)if ($(UISP) $(UISP_FLAGS) 2>&1 | tr '[:upper:]' '[:lower:]' | grep $($(TARGET).ARCH)); then : ; else echo "Wrong architecture (mcu0 vs mcu1 ?)"; exit 1; fi
$(Q)if ($(UISP) $(UISP_FLAGS) 2>&1 | tr '[:upper:]' '[:lower:]' | grep $($(TARGET).MCU)); then : ; else echo "Wrong architecture (mcu0 vs mcu1 ?)"; exit 1; fi
avr_clean:
rm -rf $(OBJDIR)
@@ -183,8 +183,8 @@ $(OBJDIR)/.depend:
@test -d $(OBJDIR) || mkdir -p $(OBJDIR)
$(Q)$(CC) -MM -MG $(CFLAGS) $($(TARGET).srcs) | sed 's|\([^\.]*\.o\)|$(OBJDIR)/\1|' > $@
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),erase)
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),erase)
-include $(OBJDIR)/.depend
endif
endif
+1 -1
View File
@@ -10,7 +10,7 @@
ARCHI=avr
ant.ARCHDIR = $(ARCHI)
ant.ARCH = atmega128
ant.MCU = atmega128
# 16MHz resonator
+2 -2
View File
@@ -6,7 +6,7 @@
ARCHI=avr
main.ARCHDIR=$(ARCHI)
main.ARCH = atmega128
main.MCU = atmega128
# internal RC 8MHz
LOW_FUSE = e4
@@ -44,4 +44,4 @@ main.srcs += $(SRC_ARCH)/bl_mc_pwm.c
</makefile>
</airframe>
</airframe>
+2 -2
View File
@@ -6,7 +6,7 @@
ARCHI=avr
main.ARCHDIR=$(ARCHI)
main.ARCH = atmega8
main.MCU = atmega8
# to check : 16MHz reso
main.LOW_FUSE = 2e
@@ -34,4 +34,4 @@ main.srcs += $(SRC_ARCH)/dc_mc_power.c
</makefile>
</airframe>
</airframe>
@@ -54,7 +54,6 @@ imu_srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c \
$(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c
# FIXME : that would lpc21
#ifeq ($(ap.ARCH), arm7tmdi)
ifeq ($(ARCHI), arm7)
imu_CFLAGS += -DSSP_VIC_SLOT=9
imu_CFLAGS += -DMAX1168_EOC_VIC_SLOT=8
+3 -3
View File
@@ -1,7 +1,7 @@
ARCHI=avr
ap.ARCHDIR = $(ARCHI)
ap.ARCH = atmega128
ap.MCU = atmega128
ap.LOW_FUSE = a0
ap.HIGH_FUSE = 99
ap.EXT_FUSE = ff
@@ -9,7 +9,7 @@ ap.LOCK_FUSE = ff
ap.CFLAGS += -DAP
fbw.ARCHDIR = $(ARCHI)
fbw.ARCH = atmega8
fbw.MCU = atmega8
fbw.LOW_FUSE = 2e
fbw.HIGH_FUSE = cb
fbw.EXT_FUSE = ff
@@ -17,5 +17,5 @@ fbw.LOCK_FUSE = ff
fbw.CFLAGS += -DFBW
tunnel.ARCHDIR = $(ARCHI)
tunnel.ARCH = atmega128
tunnel.MCU = atmega128
tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c