# # Copyright 2008, 2009, 2010 Ettus Research LLC # ################################################## # Constants ################################################## ISE_VER = $(shell xtclsh -h | head -n1 | cut -f2 -d" " | cut -f1 -d.) ifeq ($(ISE_VER),10) ISE_EXT = ise else ISE_EXT = xise endif BASE_DIR = $(abspath ..) ISE_HELPER = xtclsh $(BASE_DIR)/tcl/ise_helper.tcl ISE_FILE = $(BUILD_DIR)/$(TOP_MODULE).$(ISE_EXT) BIN_FILE = $(BUILD_DIR)/$(TOP_MODULE).bin MCS_FILE = $(BUILD_DIR)/$(TOP_MODULE).mcs ################################################## # Global Targets ################################################## all: bin proj: $(ISE_FILE) check: $(ISE_FILE) $(ISE_HELPER) "Check Syntax" synth: $(ISE_FILE) $(ISE_HELPER) "Synthesize - XST" bin: $(BIN_FILE) mcs: $(MCS_FILE) clean: $(RM) -r $(BUILD_DIR) .PHONY: all proj check synth bin mcs clean ################################################## # Dependency Targets ################################################## .SECONDEXPANSION: $(ISE_FILE): $$(SOURCES) $$(MAKEFILE_LIST) @echo $@ $(ISE_HELPER) "" $(BIN_FILE): $(ISE_FILE) @echo $@ $(ISE_HELPER) "Generate Programming File" touch $@ $(MCS_FILE): $(BIN_FILE) promgen -w -spi -p mcs -o $(MCS_FILE) -s 4096 -u 0 $(BIN_FILE) .EXPORT_ALL_VARIABLES: