makefile 2.81 KB
Newer Older
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
1
2
3
## ----------------------------------------------------------------------------
## Script     : makefile
## ----------------------------------------------------------------------------
4
## Author     : Johann Faerber, Friedrich Beckmann
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
5
6
## Company    : University of Applied Sciences Augsburg
## ----------------------------------------------------------------------------
7
8
9
## Description: This makefile allows automating design flow with Quartus,
##              it is based on a design directory structure shown at 
##              the end of this file.
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
## ----------------------------------------------------------------------------

###################################################################
# Main Targets
#
###################################################################

help:
	@echo '"make" does intentionally nothing. Type:'
	@echo '  "make qproject" to create a new quartus project'
	@echo '  "make compile" to process through all design steps: map, fit, asm'
	@echo '  "make prog" to configure programmable device'
	@echo '  "make quartus" to start quartus graphical user interface'
	@echo '  "make clean" to remove all generated files'

qproject: flowsummary.log

flowsummary.log: $(SOURCE_FILES)  
	# assign VHDL design files
	rm -rf quartus_vhdl_source_files.tcl
	for source_file in $(SOURCE_FILES); do \
		echo set_global_assignment -name VHDL_FILE $$source_file >> quartus_vhdl_source_files.tcl; \
	done
	# create and compile quartus project
	quartus_sh -t ../../scripts/quartus_project_settings.tcl -projectname $(PROJECT)

clean:
	rm -rf *.rpt *.chg *.log quartus_vhdl_source_files.tcl *.htm *.eqn *.pin *.sof *.pof db incremental_db *.qpf *.qsf *.summary $(PROJECT).*

prog: flowsummary.log
	quartus_pgm -c USB-Blaster --mode jtag --operation="p;$(PROJECT).sof"

quartus: flowsummary.log
	# create quartus project
	quartus $(PROJECT).qpf &

## ----------------------------------------------------------------------------
## Description: 
## ------------
## assumes the following design directory structure as prerequisite
## 
## DigitaltechnikPraktikum
## |   
## +---src
## |       and2gate_equation.vhd
## |       invgate_equation.vhd
## |       mux2to1_structure.vhd
## |       or2gate_equation.vhd
## |       t_mux2to1.vhd
59
60
61
62
63
64
65
66
67
## |       de1_mux2to1_structure.vhd
## |
## +---sim
## |   |   makefile
## |   |
## |   \---mux2to1
## |           makefile
## |           makefile.sources
## |
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
68
## +---pnr
69
70
71
72
## |   |   makefile
## |   |
## |   \---de1_mux2to1
## |           de1_mux2to1_pins.tcl
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
73
74
## |           makefile
## |
75
76
77
78
79
## \---scripts
##         de1_pin_assignments_minimumio.csv
##         de1_pin_assignments_minimumio.tcl
##         modelsim.ini
##         quartus_project_settings.tcl
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
80
## ----------------------------------------------------------------------------
81