summaryrefslogtreecommitdiffstats
path: root/usrp2/top/Makefile.common
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2010-06-10 11:34:18 -0700
committerMatt Ettus <matt@ettus.com>2010-06-10 11:34:18 -0700
commit45e5589ed9c555c604fb66be9f314c02ff5fb9e4 (patch)
tree06ec12796d2f60d4e6a01ae97356817202e13262 /usrp2/top/Makefile.common
parent8dbe0a6f5c4cb4d3d888d94287e788153762d14b (diff)
downloaduhd-45e5589ed9c555c604fb66be9f314c02ff5fb9e4.tar.gz
uhd-45e5589ed9c555c604fb66be9f314c02ff5fb9e4.tar.bz2
uhd-45e5589ed9c555c604fb66be9f314c02ff5fb9e4.zip
first attempt at cleaning up the build system
Diffstat (limited to 'usrp2/top/Makefile.common')
-rw-r--r--usrp2/top/Makefile.common84
1 files changed, 84 insertions, 0 deletions
diff --git a/usrp2/top/Makefile.common b/usrp2/top/Makefile.common
new file mode 100644
index 000000000..25c48d31a
--- /dev/null
+++ b/usrp2/top/Makefile.common
@@ -0,0 +1,84 @@
+#
+# Copyright 2008, 2009, 2010 Ettus Research LLC
+#
+
+##################################################
+# Constants
+##################################################
+BASE_DIR = $(abspath ..)
+ISE_HELPER = xtclsh /home/matt/sourcerepo/mobfleet/system_board/fpga/scripts/ise_helper.tcl
+#ISE_HELPER = xtclsh $(BASE_DIR)/tcl/ise_helper.tcl
+ISE_FILE = $(BUILD_DIR)/$(TOP_MODULE).ise
+BIN_FILE = $(BUILD_DIR)/$(TOP_MODULE).bit
+MAKE_ACE = $(BUILD_DIR)/make_ace.cmd
+ACE_FILE = $(BUILD_DIR)/xilinx.sys
+MCS_FILE = $(BUILD_DIR)/$(TOP_MODULE).mcs
+IMPACT_CMD = $(BUILD_DIR)/impact.cmd
+IMPACT_CDF = $(BUILD_DIR)/impact.cdf
+
+##################################################
+# Global Targets
+##################################################
+all: bin
+
+proj: $(ISE_FILE)
+
+check: $(ISE_FILE)
+ $(ISE_HELPER) "Check Syntax"
+
+synth: $(ISE_FILE)
+ $(ISE_HELPER) "Synthesize - XST"
+
+bin: $(BIN_FILE)
+
+ace: $(ACE_FILE)
+
+mcs: $(MCS_FILE)
+
+clean:
+ $(RM) -r $(BUILD_DIR)
+
+XIL_IMPACT_USE_LIBUSB=1
+jtag-install: $(IMPACT_CMD)
+ impact -batch $<
+
+.PHONY: all proj check synth bin ace mcs clean jtag-install
+
+##################################################
+# Dependency Targets
+##################################################
+$(ISE_FILE): $(SOURCES)
+ @echo $@
+ $(ISE_HELPER) ""
+
+$(BIN_FILE): $(ISE_FILE)
+ @echo $@
+ $(ISE_HELPER) "Generate Programming File"
+ touch $@
+
+$(MAKE_ACE): $(BASE_DIR)/scripts/make_ace.cmd.in
+ sed \
+ -e 's|@BUILD_DIR[@]|$(BUILD_DIR)|g' \
+ -e 's|@TOP_MODULE[@]|$(TOP_MODULE)|g' \
+ -e 's|@BIN_FILE[@]|$(BIN_FILE)|g' \
+ $< > $@
+
+$(ACE_FILE): $(BIN_FILE) $(MAKE_ACE)
+ @echo $@
+ impact -batch $(MAKE_ACE)
+
+$(MCS_FILE): $(BIN_FILE)
+ promgen -w -spi -p mcs -o $(MCS_FILE) -s 4096 -u 0 $(BIN_FILE)
+
+$(IMPACT_CDF): $(BASE_DIR)/scripts/impact.cdf.in
+ sed \
+ -e 's|@BIN_FILE[@]|$(BIN_FILE)|g' \
+ $< > $@
+
+$(IMPACT_CMD): $(BASE_DIR)/scripts/impact.cmd.in $(IMPACT_CDF)
+ sed \
+ -e 's|@PART_NAME[@]|xc5vsx50t|g' \
+ -e 's|@CDF_FILE[@]|$(IMPACT_CDF)|g' \
+ $< > $@
+
+.EXPORT_ALL_VARIABLES: