2015-07-08 11:39:24 -04:00
|
|
|
#
|
|
|
|
# Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
|
|
|
|
#
|
|
|
|
# This file is part of PortaPack.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# 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. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; see the file COPYING. If not, write to
|
|
|
|
# the Free Software Foundation, Inc., 51 Franklin Street,
|
|
|
|
# Boston, MA 02110-1301, USA.
|
|
|
|
#
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Build global options
|
|
|
|
# NOTE: Can be overridden externally.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Compiler options here.
|
|
|
|
ifeq ($(USE_OPT),)
|
|
|
|
USE_OPT = -mthumb \
|
|
|
|
-O3 -ggdb3 \
|
|
|
|
-ffunction-sections \
|
|
|
|
-fdata-sections \
|
|
|
|
-fno-builtin \
|
|
|
|
-falign-functions=16 \
|
|
|
|
-fno-math-errno \
|
|
|
|
--specs=nano.specs
|
|
|
|
#-fomit-frame-pointer
|
|
|
|
endif
|
|
|
|
|
|
|
|
# C specific options here (added to USE_OPT).
|
|
|
|
ifeq ($(USE_COPT),)
|
|
|
|
USE_COPT = -std=gnu99
|
|
|
|
endif
|
|
|
|
|
|
|
|
# C++ specific options here (added to USE_OPT).
|
|
|
|
ifeq ($(USE_CPPOPT),)
|
|
|
|
USE_CPPOPT = -std=c++11 -fno-rtti -fno-exceptions
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Enable this if you want the linker to remove unused code and data
|
|
|
|
ifeq ($(USE_LINK_GC),)
|
|
|
|
USE_LINK_GC = yes
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Linker extra options here.
|
|
|
|
ifeq ($(USE_LDOPT),)
|
|
|
|
USE_LDOPT =
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Enable this if you want link time optimizations (LTO)
|
|
|
|
ifeq ($(USE_LTO),)
|
|
|
|
USE_LTO = no
|
|
|
|
endif
|
|
|
|
|
|
|
|
# If enabled, this option allows to compile the application in THUMB mode.
|
|
|
|
ifeq ($(USE_THUMB),)
|
|
|
|
USE_THUMB = yes
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Enable this if you want to see the full log while compiling.
|
|
|
|
ifeq ($(USE_VERBOSE_COMPILE),)
|
|
|
|
USE_VERBOSE_COMPILE = no
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build global options
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Architecture or project specific options
|
|
|
|
#
|
|
|
|
|
|
|
|
# Enables the use of FPU on Cortex-M4 (no, softfp, hard).
|
|
|
|
ifeq ($(USE_FPU),)
|
|
|
|
USE_FPU = hard
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Architecture or project specific options
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Project, sources and paths
|
|
|
|
#
|
|
|
|
|
|
|
|
# Define project name here
|
|
|
|
PROJECT = baseband
|
|
|
|
|
|
|
|
# Imported source files and paths
|
|
|
|
CHIBIOS = ../chibios
|
|
|
|
CHIBIOS_PORTAPACK = ../chibios-portapack
|
|
|
|
include $(CHIBIOS_PORTAPACK)/boards/GSG_HACKRF_ONE/board.mk
|
|
|
|
include $(CHIBIOS_PORTAPACK)/os/hal/platforms/LPC43xx_M4/platform.mk
|
|
|
|
include $(CHIBIOS)/os/hal/hal.mk
|
|
|
|
include $(CHIBIOS_PORTAPACK)/os/ports/GCC/ARMCMx/LPC43xx_M4/port.mk
|
|
|
|
include $(CHIBIOS)/os/kernel/kernel.mk
|
|
|
|
|
|
|
|
include $(CHIBIOS)/test/test.mk
|
|
|
|
|
|
|
|
# Define linker script file here
|
|
|
|
LDSCRIPT= $(PORTLD)/LPC43xx_M4.ld
|
|
|
|
|
|
|
|
# C sources that can be compiled in ARM or THUMB mode depending on the global
|
|
|
|
# setting.
|
|
|
|
CSRC = $(PORTSRC) \
|
|
|
|
$(KERNSRC) \
|
|
|
|
$(TESTSRC) \
|
|
|
|
$(HALSRC) \
|
|
|
|
$(PLATFORMSRC) \
|
|
|
|
$(BOARDSRC)
|
|
|
|
|
|
|
|
|
|
|
|
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
|
|
|
|
# setting.
|
|
|
|
CPPSRC = main.cpp \
|
|
|
|
message_queue.cpp \
|
2016-01-04 15:54:05 -05:00
|
|
|
event.cpp \
|
2016-01-13 00:49:29 -05:00
|
|
|
event_m4.cpp \
|
2015-07-08 11:39:24 -04:00
|
|
|
gpdma.cpp \
|
|
|
|
baseband_dma.cpp \
|
2016-01-10 13:23:39 -05:00
|
|
|
baseband_sgpio.cpp \
|
2015-07-08 11:39:24 -04:00
|
|
|
portapack_shared_memory.cpp \
|
2015-12-10 18:53:54 -05:00
|
|
|
baseband_thread.cpp \
|
2015-08-27 14:11:08 -04:00
|
|
|
baseband_processor.cpp \
|
2016-01-04 14:49:39 -05:00
|
|
|
baseband_stats_collector.cpp \
|
2015-07-08 11:39:24 -04:00
|
|
|
dsp_decimate.cpp \
|
|
|
|
dsp_demodulate.cpp \
|
2015-10-03 01:42:42 -04:00
|
|
|
matched_filter.cpp \
|
2015-08-27 16:07:07 -04:00
|
|
|
proc_am_audio.cpp \
|
2015-08-27 16:14:45 -04:00
|
|
|
proc_nfm_audio.cpp \
|
2015-12-11 15:26:45 -05:00
|
|
|
spectrum_collector.cpp \
|
2015-08-27 16:19:34 -04:00
|
|
|
proc_wfm_audio.cpp \
|
2015-11-10 17:07:07 -05:00
|
|
|
proc_ais.cpp \
|
2015-08-27 16:57:31 -04:00
|
|
|
proc_wideband_spectrum.cpp \
|
2015-11-10 18:19:56 -05:00
|
|
|
proc_tpms.cpp \
|
2015-12-01 14:24:48 -05:00
|
|
|
proc_ert.cpp \
|
2015-08-27 12:59:03 -04:00
|
|
|
dsp_squelch.cpp \
|
2015-07-08 11:39:24 -04:00
|
|
|
clock_recovery.cpp \
|
|
|
|
packet_builder.cpp \
|
|
|
|
dsp_fft.cpp \
|
|
|
|
dsp_fir_taps.cpp \
|
2015-12-31 13:52:28 -05:00
|
|
|
dsp_iir.cpp \
|
2015-07-08 11:39:24 -04:00
|
|
|
fxpt_atan2.cpp \
|
|
|
|
rssi.cpp \
|
|
|
|
rssi_dma.cpp \
|
2015-12-10 19:03:22 -05:00
|
|
|
rssi_thread.cpp \
|
2015-07-08 11:39:24 -04:00
|
|
|
audio.cpp \
|
2016-01-10 23:25:24 -05:00
|
|
|
audio_output.cpp \
|
2015-07-08 11:39:24 -04:00
|
|
|
audio_dma.cpp \
|
2016-01-04 12:25:43 -05:00
|
|
|
audio_stats_collector.cpp \
|
2015-07-08 11:39:24 -04:00
|
|
|
touch_dma.cpp \
|
|
|
|
../common/utility.cpp \
|
2015-10-15 18:17:40 -04:00
|
|
|
../common/chibios_cpp.cpp \
|
2015-07-08 11:39:24 -04:00
|
|
|
../common/debug.cpp \
|
|
|
|
../common/gcc.cpp
|
|
|
|
|
|
|
|
# C sources to be compiled in ARM mode regardless of the global setting.
|
|
|
|
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
|
|
# option that results in lower performance and larger code size.
|
|
|
|
ACSRC =
|
|
|
|
|
|
|
|
# C++ sources to be compiled in ARM mode regardless of the global setting.
|
|
|
|
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
|
|
# option that results in lower performance and larger code size.
|
|
|
|
ACPPSRC =
|
|
|
|
|
|
|
|
# C sources to be compiled in THUMB mode regardless of the global setting.
|
|
|
|
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
|
|
# option that results in lower performance and larger code size.
|
|
|
|
TCSRC =
|
|
|
|
|
|
|
|
# C sources to be compiled in THUMB mode regardless of the global setting.
|
|
|
|
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
|
|
# option that results in lower performance and larger code size.
|
|
|
|
TCPPSRC =
|
|
|
|
|
|
|
|
# List ASM source files here
|
|
|
|
ASMSRC = $(PORTASM)
|
|
|
|
|
|
|
|
INCDIR = ../common $(PORTINC) $(KERNINC) $(TESTINC) \
|
|
|
|
$(HALINC) $(PLATFORMINC) $(BOARDINC) \
|
|
|
|
$(CHIBIOS)/os/various
|
|
|
|
|
|
|
|
#
|
|
|
|
# Project, sources and paths
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Compiler settings
|
|
|
|
#
|
|
|
|
|
|
|
|
MCU = cortex-m4
|
|
|
|
|
|
|
|
#TRGT = arm-elf-
|
|
|
|
TRGT = arm-none-eabi-
|
|
|
|
CC = $(TRGT)gcc
|
|
|
|
CPPC = $(TRGT)g++
|
|
|
|
# Enable loading with g++ only if you need C++ runtime support.
|
|
|
|
# NOTE: You can use C++ even without C++ support if you are careful. C++
|
|
|
|
# runtime support makes code size explode.
|
|
|
|
#LD = $(TRGT)gcc
|
|
|
|
LD = $(TRGT)g++
|
|
|
|
CP = $(TRGT)objcopy
|
|
|
|
AS = $(TRGT)gcc -x assembler-with-cpp
|
|
|
|
OD = $(TRGT)objdump
|
|
|
|
SZ = $(TRGT)size
|
|
|
|
HEX = $(CP) -O ihex
|
|
|
|
BIN = $(CP) -O binary
|
|
|
|
|
|
|
|
# ARM-specific options here
|
|
|
|
AOPT =
|
|
|
|
|
|
|
|
# THUMB-specific options here
|
|
|
|
TOPT = -mthumb -DTHUMB
|
|
|
|
|
|
|
|
# Define C warning options here
|
|
|
|
CWARN = -Wall -Wextra -Wstrict-prototypes
|
|
|
|
|
|
|
|
# Define C++ warning options here
|
|
|
|
CPPWARN = -Wall -Wextra
|
|
|
|
|
|
|
|
#
|
|
|
|
# Compiler settings
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Start of default section
|
|
|
|
#
|
|
|
|
|
|
|
|
# List all default C defines here, like -D_DEBUG=1
|
|
|
|
# TODO: Switch -DCRT0_INIT_DATA depending on load from RAM or SPIFI?
|
|
|
|
# NOTE: _RANDOM_TCC to kill a GCC 4.9.3 error with std::max argument types
|
|
|
|
DDEFS = -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE \
|
2015-08-25 19:33:52 -04:00
|
|
|
-DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 \
|
|
|
|
-DGIT_REVISION=\"$(GIT_REVISION)\"
|
2015-07-08 11:39:24 -04:00
|
|
|
|
|
|
|
# List all default ASM defines here, like -D_DEBUG=1
|
|
|
|
DADEFS =
|
|
|
|
|
|
|
|
# List all default directories to look for include files here
|
|
|
|
DINCDIR =
|
|
|
|
|
|
|
|
# List the default directory to look for the libraries here
|
|
|
|
DLIBDIR =
|
|
|
|
|
|
|
|
# List all default libraries here
|
|
|
|
DLIBS =
|
|
|
|
|
|
|
|
#
|
|
|
|
# End of default section
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Start of user section
|
|
|
|
#
|
|
|
|
|
|
|
|
# List all user C define here, like -D_DEBUG=1
|
|
|
|
UDEFS =
|
|
|
|
|
|
|
|
# Define ASM defines here
|
|
|
|
UADEFS =
|
|
|
|
|
|
|
|
# List all user directories here
|
|
|
|
UINCDIR =
|
|
|
|
|
|
|
|
# List the user directory to look for the libraries here
|
|
|
|
ULIBDIR =
|
|
|
|
|
|
|
|
# List all user libraries here
|
|
|
|
ULIBS =
|
|
|
|
|
|
|
|
#
|
|
|
|
# End of user defines
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
RULESPATH = $(CHIBIOS)/os/ports/GCC/ARMCMx
|
|
|
|
include $(RULESPATH)/rules.mk
|