mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 23:49:00 +08:00
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:
+1
-1
@@ -55,7 +55,7 @@ COPY = cp
|
|||||||
Q=@
|
Q=@
|
||||||
|
|
||||||
# MCU name and submodel
|
# MCU name and submodel
|
||||||
MCU = $($(TARGET).ARCH)
|
MCU = arm7tdmi
|
||||||
THUMB = -mthumb
|
THUMB = -mthumb
|
||||||
THUMB_IW = -mthumb-interwork
|
THUMB_IW = -mthumb-interwork
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -1,5 +1,5 @@
|
|||||||
# Hey Emacs, this is a -*- makefile -*-
|
# Hey Emacs, this is a -*- makefile -*-
|
||||||
#
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
# Copyright (C) 2003-2005 Pascal Brisset, Antoine Drouin
|
# Copyright (C) 2003-2005 Pascal Brisset, Antoine Drouin
|
||||||
#
|
#
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with paparazzi; see the file COPYING. If not, write to
|
# along with paparazzi; see the file COPYING. If not, write to
|
||||||
# the Free Software Foundation, 59 Temple Place - Suite 330,
|
# 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
|
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)
|
LD = $(CC) $(ATMEL_LIBPATH)
|
||||||
SIZE = $(ATMELBIN)/avr-size
|
SIZE = $(ATMELBIN)/avr-size
|
||||||
OBJCOPY = $(ATMELBIN)/avr-objcopy
|
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
|
@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.
|
# Define all object files.
|
||||||
COBJ = $(SRC:%.c=$(OBJDIR)/%.o)
|
COBJ = $(SRC:%.c=$(OBJDIR)/%.o)
|
||||||
COBJAVR = $(SRCAVR:%.c=$(OBJDIR)/%.o)
|
COBJAVR = $(SRCAVR:%.c=$(OBJDIR)/%.o)
|
||||||
|
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/../Makefile.ac
|
|||||||
|
|
||||||
|
|
||||||
%.install: $(OBJDIR)/%.hex check_arch
|
%.install: $(OBJDIR)/%.hex check_arch
|
||||||
# stk200 needs to be erased first
|
# stk200 needs to be erased first
|
||||||
$(UISP) $(UISP_FLAGS) --erase
|
$(UISP) $(UISP_FLAGS) --erase
|
||||||
@echo SIZE
|
@echo SIZE
|
||||||
$(Q)$(SIZE) $<
|
$(Q)$(SIZE) $<
|
||||||
@@ -166,9 +166,9 @@ erase: check_arch
|
|||||||
$(UISP) $(ISP_FLAGS) --erase
|
$(UISP) $(ISP_FLAGS) --erase
|
||||||
|
|
||||||
check_arch :
|
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)$(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:
|
avr_clean:
|
||||||
rm -rf $(OBJDIR)
|
rm -rf $(OBJDIR)
|
||||||
@@ -183,8 +183,8 @@ $(OBJDIR)/.depend:
|
|||||||
@test -d $(OBJDIR) || mkdir -p $(OBJDIR)
|
@test -d $(OBJDIR) || mkdir -p $(OBJDIR)
|
||||||
$(Q)$(CC) -MM -MG $(CFLAGS) $($(TARGET).srcs) | sed 's|\([^\.]*\.o\)|$(OBJDIR)/\1|' > $@
|
$(Q)$(CC) -MM -MG $(CFLAGS) $($(TARGET).srcs) | sed 's|\([^\.]*\.o\)|$(OBJDIR)/\1|' > $@
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
ifneq ($(MAKECMDGOALS),erase)
|
ifneq ($(MAKECMDGOALS),erase)
|
||||||
-include $(OBJDIR)/.depend
|
-include $(OBJDIR)/.depend
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
ARCHI=avr
|
ARCHI=avr
|
||||||
ant.ARCHDIR = $(ARCHI)
|
ant.ARCHDIR = $(ARCHI)
|
||||||
ant.ARCH = atmega128
|
ant.MCU = atmega128
|
||||||
|
|
||||||
|
|
||||||
# 16MHz resonator
|
# 16MHz resonator
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
ARCHI=avr
|
ARCHI=avr
|
||||||
|
|
||||||
main.ARCHDIR=$(ARCHI)
|
main.ARCHDIR=$(ARCHI)
|
||||||
main.ARCH = atmega128
|
main.MCU = atmega128
|
||||||
|
|
||||||
# internal RC 8MHz
|
# internal RC 8MHz
|
||||||
LOW_FUSE = e4
|
LOW_FUSE = e4
|
||||||
@@ -44,4 +44,4 @@ main.srcs += $(SRC_ARCH)/bl_mc_pwm.c
|
|||||||
|
|
||||||
</makefile>
|
</makefile>
|
||||||
|
|
||||||
</airframe>
|
</airframe>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
ARCHI=avr
|
ARCHI=avr
|
||||||
|
|
||||||
main.ARCHDIR=$(ARCHI)
|
main.ARCHDIR=$(ARCHI)
|
||||||
main.ARCH = atmega8
|
main.MCU = atmega8
|
||||||
|
|
||||||
# to check : 16MHz reso
|
# to check : 16MHz reso
|
||||||
main.LOW_FUSE = 2e
|
main.LOW_FUSE = 2e
|
||||||
@@ -34,4 +34,4 @@ main.srcs += $(SRC_ARCH)/dc_mc_power.c
|
|||||||
|
|
||||||
</makefile>
|
</makefile>
|
||||||
|
|
||||||
</airframe>
|
</airframe>
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ imu_srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c \
|
|||||||
$(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c
|
$(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c
|
||||||
|
|
||||||
# FIXME : that would lpc21
|
# FIXME : that would lpc21
|
||||||
#ifeq ($(ap.ARCH), arm7tmdi)
|
|
||||||
ifeq ($(ARCHI), arm7)
|
ifeq ($(ARCHI), arm7)
|
||||||
imu_CFLAGS += -DSSP_VIC_SLOT=9
|
imu_CFLAGS += -DSSP_VIC_SLOT=9
|
||||||
imu_CFLAGS += -DMAX1168_EOC_VIC_SLOT=8
|
imu_CFLAGS += -DMAX1168_EOC_VIC_SLOT=8
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
ARCHI=avr
|
ARCHI=avr
|
||||||
|
|
||||||
ap.ARCHDIR = $(ARCHI)
|
ap.ARCHDIR = $(ARCHI)
|
||||||
ap.ARCH = atmega128
|
ap.MCU = atmega128
|
||||||
ap.LOW_FUSE = a0
|
ap.LOW_FUSE = a0
|
||||||
ap.HIGH_FUSE = 99
|
ap.HIGH_FUSE = 99
|
||||||
ap.EXT_FUSE = ff
|
ap.EXT_FUSE = ff
|
||||||
@@ -9,7 +9,7 @@ ap.LOCK_FUSE = ff
|
|||||||
ap.CFLAGS += -DAP
|
ap.CFLAGS += -DAP
|
||||||
|
|
||||||
fbw.ARCHDIR = $(ARCHI)
|
fbw.ARCHDIR = $(ARCHI)
|
||||||
fbw.ARCH = atmega8
|
fbw.MCU = atmega8
|
||||||
fbw.LOW_FUSE = 2e
|
fbw.LOW_FUSE = 2e
|
||||||
fbw.HIGH_FUSE = cb
|
fbw.HIGH_FUSE = cb
|
||||||
fbw.EXT_FUSE = ff
|
fbw.EXT_FUSE = ff
|
||||||
@@ -17,5 +17,5 @@ fbw.LOCK_FUSE = ff
|
|||||||
fbw.CFLAGS += -DFBW
|
fbw.CFLAGS += -DFBW
|
||||||
|
|
||||||
tunnel.ARCHDIR = $(ARCHI)
|
tunnel.ARCHDIR = $(ARCHI)
|
||||||
tunnel.ARCH = atmega128
|
tunnel.MCU = atmega128
|
||||||
tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c
|
tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c
|
||||||
|
|||||||
Reference in New Issue
Block a user