makefile 2.76 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
## ----------------------------------------------------------------------------

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

help:
	@echo '"make" does intentionally nothing. Type:'
19
	@echo '  "make compile" synthesize the design'
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
20
21
22
23
	@echo '  "make prog" to configure programmable device'
	@echo '  "make quartus" to start quartus graphical user interface'
	@echo '  "make clean" to remove all generated files'

24
compile: flowsummary.log
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
25
26
27
28
29
30
31
32

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
33
	quartus_sh -t ../../scripts/quartus_project_settings.tcl -projectname $(PROJECT) -family $(FAMILY) -device $(DEVICE)
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

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
58
59
60
61
62
63
64
65
66
## |       de1_mux2to1_structure.vhd
## |
## +---sim
## |   |   makefile
## |   |
## |   \---mux2to1
## |           makefile
## |           makefile.sources
## |
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
67
## +---pnr
68
69
70
71
## |   |   makefile
## |   |
## |   \---de1_mux2to1
## |           de1_mux2to1_pins.tcl
Friedrich Beckmann's avatar
first  
Friedrich Beckmann committed
72
73
## |           makefile
## |
74
75
76
77
78
## \---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
79
## ----------------------------------------------------------------------------
80