Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

Commit

Permalink
Makefile: Cleanup the targets a little.
Browse files Browse the repository at this point in the history
Makes things a bit more consistent.
  • Loading branch information
mithro committed Mar 12, 2017
1 parent 88bdc84 commit 3bee9b7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
35 changes: 23 additions & 12 deletions Makefile
Expand Up @@ -63,17 +63,20 @@ third_party/%/.git: .gitmodules
git submodule update --recursive --init $$(dirname $@)
touch $@ -r .gitmodules

# Image
# Image - a combination of multiple parts (gateware+bios+firmware+more?)
# --------------------------------------
image:
$(PYTHON) mkimage.py

image-load: image image-load-$(PLATFORM)
true
@true

image-flash: image image-flash-$(PLATFORM)
@true

.PHONY: image image-load
.PHONY: image image-load image-flash

# Gateware
# Gateware - the stuff which configures the FPGA.
# --------------------------------------
GATEWARE_MODULES=litex litedram liteeth litepcie litesata litescope liteusb litevideo litex
gateware-submodules: $(addsuffix /.git,$(addprefix third_party/,$(GATEWARE_MODULES)))
Expand All @@ -89,14 +92,17 @@ else
endif

gateware-load: gateware-load-$(PLATFORM)
true
@true

gateware-flash: gateware-flash-$(PLATFORM)
@true

gateware-clean:
rm -rf $(TARGET_BUILD_DIR)/gateware

.PHONY: gateware gateware-load gateware-clean
.PHONY: gateware gateware-load gateware-flash gateware-clean

# Firmware
# Firmware - the stuff which runs in the soft CPU inside the FPGA.
# --------------------------------------
firmware:
mkdir -p $(TARGET_BUILD_DIR)
Expand All @@ -108,15 +114,18 @@ else
endif

firmware-load: firmware firmware-load-$(PLATFORM)
true
@true

firmware-flash: firmware firmware-flash-$(PLATFORM)
@true

firmware-connect: firmware-load-$(PLATFORM)
true
@true

firmware-clean:
rm -rf $(TARGET_BUILD_DIR)/software

.PHONY: firmware firmware-load firmware-connect firmware-clean
.PHONY: firmware firmware-load firmware-flash firmware-connect firmware-clean

# TFTP booting stuff
# --------------------------------------
Expand All @@ -138,6 +147,9 @@ tftpd_start:

# Extra targets
# --------------------------------------
flash: flash-$(PLATFORM)
@true

help:
@echo "Environment:"
@echo " PLATFORM=$(shell ls targets/ | grep -v ".py" | grep -v "common" | sed -e"s+targets/++" -e's/$$/ OR/')" | sed -e's/ OR$$//'
Expand All @@ -151,7 +163,6 @@ help:
@echo " make all"
@echo " make gateware"
@echo " make firmware"
@echo " make load"
@echo " make flash"
@for T in $(TARGETS); do make -s help-$$T; done
@echo " make clean"
Expand All @@ -163,7 +174,7 @@ clean:
dist-clean:
rm -rf build

.PHONY: help clean dist-clean
.PHONY: flash help clean dist-clean

# Tests
# --------------------------------------
Expand Down
12 changes: 11 additions & 1 deletion targets/mimasv2/Makefile.mk
Expand Up @@ -7,18 +7,28 @@ BAUD ?= 19200

gateware-load-mimasv2:
@echo "MimasV2 doesn't support loading, use the flash target instead."
@echo "make gateware-flash-mimasv2"
@echo "make gateware-flash"
@false

gateware-flash-mimasv2:
$(PYTHON) $$(which MimasV2Config.py) $(PORT) $(TARGET_BUILD_DIR)/gateware/top.bin

image-load-mimasv2:
@echo "MimasV2 doesn't support loading, use the flash target instead."
@echo "make image-flash"
@false

image-flash-mimasv2:
$(PYTHON) $$(which MimasV2Config.py) $(PORT) $(TARGET_BUILD_DIR)/flash.bin

firmware-load-mimasv2:
flterm --port=$(PORT) --kernel=$(TARGET_BUILD_DIR)/software/firmware/firmware.bin --speed=$(BAUD)

firmware-flash-mimasv2:
@echo "MimasV2 doesn't support just flashing firmware, use image target instead."
@echo "make image-flash"
@false

firmware-connect-mimasv2:
flterm --port=$(PORT) --speed=$(BAUD)

Expand Down

0 comments on commit 3bee9b7

Please sign in to comment.