2015-07-26 09:30:04 -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.
|
|
|
|
#
|
|
|
|
|
|
|
|
PATH_BOOTSTRAP=bootstrap
|
2015-07-29 23:38:40 -04:00
|
|
|
PATH_APPLICATION=application
|
|
|
|
PATH_BASEBAND=baseband
|
2015-11-20 01:59:09 -05:00
|
|
|
PATH_BASEBAND_TX=baseband-tx
|
2015-07-26 09:30:04 -04:00
|
|
|
|
|
|
|
TARGET=portapack-h1-firmware
|
|
|
|
|
|
|
|
TARGET_BOOTSTRAP=$(PATH_BOOTSTRAP)/bootstrap
|
2015-07-30 13:01:12 -04:00
|
|
|
TARGET_HACKRF_FIRMWARE=hackrf_one_usb_ram
|
2015-07-29 23:38:40 -04:00
|
|
|
TARGET_APPLICATION=$(PATH_APPLICATION)/build/application
|
|
|
|
TARGET_BASEBAND=$(PATH_BASEBAND)/build/baseband
|
2015-11-20 01:59:09 -05:00
|
|
|
TARGET_BASEBAND_TX=$(PATH_BASEBAND_TX)/build/baseband-tx
|
2015-07-26 09:30:04 -04:00
|
|
|
|
2015-08-25 17:30:38 -04:00
|
|
|
MAKE_SPI_IMAGE=tools/make_spi_image.py
|
2015-11-20 01:59:09 -05:00
|
|
|
MAKE_MODULES_FILE=tools/make_baseband_file.py
|
2015-08-25 17:30:38 -04:00
|
|
|
|
2015-07-26 09:30:04 -04:00
|
|
|
DFU_HACKRF=hackrf_one_usb_ram.dfu
|
|
|
|
LICENSE=../LICENSE
|
|
|
|
|
2015-08-25 19:33:52 -04:00
|
|
|
GIT_REVISION=$(shell git log -n 1 --format=%h)
|
2015-07-26 09:30:04 -04:00
|
|
|
|
|
|
|
CP=arm-none-eabi-objcopy
|
|
|
|
|
2015-11-20 01:59:09 -05:00
|
|
|
MODULES = $(PATH_BASEBAND) \
|
|
|
|
$(PATH_BASEBAND_TX)
|
|
|
|
|
|
|
|
all: $(TARGET).bin modules
|
2015-07-26 09:30:04 -04:00
|
|
|
|
|
|
|
release: $(TARGET).bin $(DFU_HACKRF) $(LICENSE)
|
|
|
|
# TODO: Bad hack to fix location of LICENSE file for tar.
|
|
|
|
cp $(LICENSE) LICENSE
|
2015-09-01 17:21:40 -04:00
|
|
|
tar -c -j -f $(TARGET)-$(GIT_REVISION).tar.bz2 $(TARGET).bin $(DFU_HACKRF) LICENSE
|
|
|
|
zip -9 -q $(TARGET)-$(GIT_REVISION).zip $(TARGET).bin $(DFU_HACKRF) LICENSE
|
2015-07-26 09:30:04 -04:00
|
|
|
rm -f LICENSE
|
|
|
|
|
2015-11-20 01:59:09 -05:00
|
|
|
program: $(TARGET).bin modules
|
2015-07-30 01:17:50 -04:00
|
|
|
dfu-util --device 1fc9:000c --download hackrf_one_usb_ram.dfu --reset
|
2015-07-26 09:30:04 -04:00
|
|
|
sleep 1s
|
|
|
|
hackrf_spiflash -w $(TARGET).bin
|
2015-11-20 01:59:09 -05:00
|
|
|
|
2016-01-05 05:47:46 -05:00
|
|
|
modules: $(TARGET_BASEBAND).bin $(TARGET_BASEBAND_TX).bin
|
2015-11-20 01:59:09 -05:00
|
|
|
$(MAKE_MODULES_FILE) $(MODULES)
|
2015-07-26 09:30:04 -04:00
|
|
|
|
2015-11-20 01:59:09 -05:00
|
|
|
$(TARGET).bin: modules $(MAKE_SPI_IMAGE) $(TARGET_BOOTSTRAP).bin $(TARGET_HACKRF_FIRMWARE).dfu $(TARGET_BASEBAND).bin $(TARGET_BASEBAND_TX).bin $(TARGET_APPLICATION).bin
|
2016-01-05 05:47:46 -05:00
|
|
|
$(MAKE_SPI_IMAGE) $(TARGET_BOOTSTRAP).bin $(TARGET_HACKRF_FIRMWARE).dfu $(TARGET_BASEBAND_TX).bin $(TARGET_APPLICATION).bin $(TARGET).bin
|
2015-07-26 09:30:04 -04:00
|
|
|
|
2015-08-25 17:30:38 -04:00
|
|
|
$(TARGET_BOOTSTRAP).bin: $(TARGET_BOOTSTRAP).elf
|
|
|
|
$(CP) -O binary $(TARGET_BOOTSTRAP).elf $(TARGET_BOOTSTRAP).bin
|
2015-07-30 01:30:16 -04:00
|
|
|
|
2015-08-25 17:30:38 -04:00
|
|
|
$(TARGET_BASEBAND).bin: $(TARGET_BASEBAND).elf
|
|
|
|
$(CP) -O binary $(TARGET_BASEBAND).elf $(TARGET_BASEBAND).bin
|
2015-11-20 01:59:09 -05:00
|
|
|
|
|
|
|
$(TARGET_BASEBAND_TX).bin: $(TARGET_BASEBAND_TX).elf
|
|
|
|
$(CP) -O binary $(TARGET_BASEBAND_TX).elf $(TARGET_BASEBAND_TX).bin
|
2015-07-26 09:30:04 -04:00
|
|
|
|
2015-07-29 23:38:40 -04:00
|
|
|
$(TARGET_APPLICATION).bin: $(TARGET_APPLICATION).elf
|
|
|
|
$(CP) -O binary $(TARGET_APPLICATION).elf $(TARGET_APPLICATION).bin
|
2015-07-26 09:30:04 -04:00
|
|
|
|
2015-07-29 23:38:40 -04:00
|
|
|
$(TARGET_BASEBAND).elf: always_check
|
2015-08-25 19:33:52 -04:00
|
|
|
@$(MAKE) -s -e GIT_REVISION=$(GIT_REVISION) -C $(PATH_BASEBAND)
|
2015-11-20 01:59:09 -05:00
|
|
|
|
|
|
|
$(TARGET_BASEBAND_TX).elf: always_check
|
|
|
|
@$(MAKE) -s -e GIT_REVISION=$(GIT_REVISION) -C $(PATH_BASEBAND_TX)
|
2015-07-26 09:30:04 -04:00
|
|
|
|
2015-07-29 23:38:40 -04:00
|
|
|
$(TARGET_APPLICATION).elf: always_check
|
2015-08-25 19:33:52 -04:00
|
|
|
@$(MAKE) -s -e GIT_REVISION=$(GIT_REVISION) -C $(PATH_APPLICATION)
|
2015-07-26 09:30:04 -04:00
|
|
|
|
2015-07-29 21:21:47 -04:00
|
|
|
$(TARGET_BOOTSTRAP).elf: always_check
|
2015-08-25 19:33:52 -04:00
|
|
|
@$(MAKE) -s -e GIT_REVISION=$(GIT_REVISION) -C $(PATH_BOOTSTRAP)
|
2015-07-26 09:30:04 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(TARGET).bin
|
2015-08-25 17:30:38 -04:00
|
|
|
rm -f $(TARGET_BOOTSTRAP).bin
|
|
|
|
rm -f $(TARGET_BASEBAND).bin
|
2015-07-29 23:38:40 -04:00
|
|
|
rm -f $(TARGET_APPLICATION).bin
|
|
|
|
$(MAKE) -C $(PATH_BASEBAND) clean
|
|
|
|
$(MAKE) -C $(PATH_APPLICATION) clean
|
2015-07-26 09:30:04 -04:00
|
|
|
$(MAKE) -C $(PATH_BOOTSTRAP) clean
|
2015-07-29 21:21:47 -04:00
|
|
|
|
|
|
|
always_check:
|
|
|
|
@true
|