makefile 3.54 KB
Newer Older
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
1
2
3
4
5
6
7
8
9
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
## ----------------------------------------------------------------------------
## Script     : makefile
## ----------------------------------------------------------------------------
## Author     : Johann Faerber
## Company    : University of Applied Sciences Augsburg
## ----------------------------------------------------------------------------
## Description: see end of file
## ----------------------------------------------------------------------------

###################################################################
# 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
## |       de1_mux2to1_structure.vhd
## |       invgate_equation.vhd
## |       mux2to1_structure.vhd
## |       or2gate_equation.vhd
## |       t_mux2to1.vhd
## |       
## +---pnr
## |   +---de1_mux2to1
## |           makefile
## |           de1_mux2to1.qpf
## |           de1_mux2to1.qpf
## |
## +---scripts
## |       quartus_project_settings.tcl
## |       makefile.quartus_template
## |       makefile.modelsim_template
## |       de1_mux2to1_pins.tcl
## |       modelsim_project_settings.tcl
## |       modelsim.ini
## |       de1_pin_assignments_minimumio.csv
## |       de1_pin_assignments_minimumio.tcl
## |       
## \---sim
##     +---mux2to1
##             makefile
##             mux2to1.mpf
##             modelsim.ini
## 
## ----------------------------------------------------------------------------
## Modifications: makefile template from Altera Quartus scripting modified:
## --------------
##              - added help target
##              - removed target for timing analysis
##              - added target project for initial creation of a quartus project
##              - modified target all to compile
##              - modified target clean to remove quartus project files *.qpf *.qfs
##              - added target prog to configure a programmable device
##              - added target quartus to start quartus graphical user interface
## ----------------------------------------------------------------------------
## Revisions:
## ----------
## $Id:$
## ----------------------------------------------------------------------------