Makefile 1.94 KB
Newer Older
1 2
include dir_list.mk

3
SYN_TOP = $(TOP)syn/cute_wr/wr_core_demo
4 5 6
EB_TGT = $(EB_DIR)/api/libetherbone.a
BIT_TGT = $(SYN_TOP)/cute_top_wrc.bit
WRC_TGT = $(FW_DIR)/wrc.elf
Qiang Du's avatar
Qiang Du committed
7
SDB_TGT = $(SDB_DIR)/lib/libsdbfs.a
8

Qiang Du's avatar
Qiang Du committed
9
.PHONY: all install clean distclean etherbone etherbone-clean etherbone-install tools tools-clean tools-install toolchain firmware gateware firmware-clean gateware-clean program program-clean sdbfs sdbfs-clean
10 11 12 13 14 15 16 17 18 19 20 21 22 23

all:	    etherbone tools firmware gateware

install:    etherbone-install tools-install

clean:	    etherbone-clean tools-clean toolchain-clean firmware-clean gateware-clean program-clean

distclean: clean
	git clean -xfd .
	for i in gateware firmware; do cd submodules/$$i; git clean -xfd .; cd $(TOP); done

etherbone: $(EB_TGT)
firmware: $(WRC_TGT)
gateware: $(BIT_TGT)
Qiang Du's avatar
Qiang Du committed
24
sdbfs: $(SDB_TGT)
25 26 27 28 29 30 31 32 33 34

$(EB_TGT):
	$(MAKE) -C $(EB_DIR)/api all

etherbone-clean:
	$(MAKE) -C $(EB_DIR)/api clean

etherbone-install:
	$(MAKE) -C $(EB_DIR)/api install

35
tools: $(EB_TGT)
36 37 38 39 40 41 42 43
	$(MAKE) -C tools EB=$(EB_DIR)/api all

tools-clean:
	$(MAKE) -C tools EB=$(EB_DIR)/api clean

tools-install:
	$(MAKE) -C tools EB=$(EB_DIR)/api install

Qiang Du's avatar
Qiang Du committed
44 45 46 47 48 49
$(SDB_TGT):
	$(MAKE) -C $(SDB_DIR) DIRS="lib userspace" all

sdbfs-clean:
	$(MAKE) -C $(SDB_DIR) DIRS="lib userspace" clean

50 51 52
$(FW_DIR)/.config:
	$(MAKE) -C $(FW_DIR) etherbone_defconfig

Qiang Du's avatar
Qiang Du committed
53 54
$(WRC_TGT): $(EB_TGT) $(SDB_TGT) $(FW_DIR)/.config
	$(MAKE) -C $(FW_DIR) EB=$(EB_DIR)/api SDBFS=$(CURDIR)/$(SDB_DIR)/userspace all
55 56

firmware-clean:
Qiang Du's avatar
Qiang Du committed
57
	$(MAKE) -C $(FW_DIR) EB=$(EB_DIR)/api SDBFS=$(CURDIR)/$(SDB_DIR)/userspace clean
58

59
$(BIT_TGT): $(WRC_TGT)
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
	$(MAKE) -C $(SYN_TOP) all

gateware-clean:
	$(MAKE) -C $(SYN_TOP) clean

program: $(BIT_TGT)
	./tools/impact_cutewr $<

program-clean:
	rm -f *.bit
	rm -f _impactbatch.log

# not for 64 bit arch
gcc-4.5.3-lm32.tar.xz:
	wget http://www.ohwr.org/attachments/1301/gcc-4.5.3-lm32.tar.xz

toolchain:  gcc-4.5.3-lm32.tar.xz
	tar xvJf gcc-4.5.3-lm32.tar.xz
	mv lm32 toolchain
	touch toolchain

toolchain-clean:
	rm -rf toolchain