OpenCores
URL https://opencores.org/ocsvn/gecko4/gecko4/trunk

Subversion Repositories gecko4

[/] [gecko4/] [trunk/] [GECKO4com/] [spartan200_an/] [Makefile] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 ktt1
################################################################################
2
##            _   _            __   ____                                      ##
3
##           / / | |          / _| |  __|                                     ##
4
##           | |_| |  _   _  / /   | |_                                       ##
5
##           |  _  | | | | | | |   |  _|                                      ##
6
##           | | | | | |_| | \ \_  | |__                                      ##
7
##           |_| |_| \_____|  \__| |____| microLab                            ##
8
##                                                                            ##
9
##           Bern University of Applied Sciences (BFH)                        ##
10
##           Quellgasse 21                                                    ##
11
##           Room HG 4.33                                                     ##
12
##           2501 Biel/Bienne                                                 ##
13
##           Switzerland                                                      ##
14
##                                                                            ##
15
##           http://www.microlab.ch                                           ##
16
################################################################################
17
PROJECT_TOP=config/project.toplevel
18
PROJECT_LIST=config/project.files
19
PROJECT_FORCE=config/project.force
20
PROJECT_DEVICE=config/project.device
21
PROJECT_OPTIONS=config/project.options
22
PROJECT_UCF=config/project.ucf
23
PROJECT_XILINX=config/project.xilinx
24
 
25
REL_PATH=.
26
TOPLEVEL := $(shell cat $(REL_PATH)/$(PROJECT_TOP))
27
PROJECT_EDF=sandbox/$(TOPLEVEL).edf
28
 
29
.PHONY: default clean sim %
30
 
31
define do_modelsim
32
if test ! -f $(PROJECT_LIST); then\
33
echo ""; echo ""; echo "ERROR: No file $(PROJECT_LIST) found!"; else\
34
if test ! -f $(PROJECT_FORCE); then \
35
echo ""; echo ""; echo "ERROR: No file $(PROJECT_FORCE) found!"; else\
36
echo "INFO: Performing automated simulation...";\
37
mkdir -p sandbox;\
38
cd sandbox;\
39
echo "PROJECT_LIST=$(PROJECT_LIST)" >> Makefile.modelsim;\
40
echo "PROJECT_FORCE=$(PROJECT_FORCE)" >> Makefile.modelsim;\
41
echo "REL_PATH=.." >> Makefile.modelsim;\
42
cat ../Makefile.modelsim >> Makefile.modelsim;\
43
$(MAKE) -f Makefile.modelsim;\
44
fi; fi
45
endef #do modelsim
46
 
47
define do_synth
48
if test ! -f $(PROJECT_TOP); then\
49
echo ""; echo ""; echo "ERROR: No file $(PROJECT_TOP) found!"; else\
50
if test ! -f $(PROJECT_LIST); then\
51
echo ""; echo ""; echo "ERROR: No file $(PROJECT_LIST) found!"; else\
52
if test ! -f $(PROJECT_DEVICE); then \
53
echo ""; echo ""; echo "ERROR: No file $(PROJECT_DEVICE) found!"; else\
54
echo "INFO: Performing automated synthesis...";\
55
mkdir -p sandbox;\
56
cd sandbox;\
57
echo "PROJECT_TOP=$(PROJECT_TOP)" > Makefile.synthesis;\
58
echo "PROJECT_LIST=$(PROJECT_LIST)" >> Makefile.synthesis;\
59
echo "PROJECT_OPTIONS=$(PROJECT_OPTIONS)" >> Makefile.synthesis;\
60
echo "PROJECT_DEVICE=$(PROJECT_DEVICE)" >> Makefile.synthesis;\
61
echo "REL_PATH=.." >> Makefile.synthesis;\
62
cat ../Makefile.synthesis >> Makefile.synthesis;\
63
$(MAKE) -f Makefile.synthesis;\
64
fi; fi ; fi
65
endef
66
 
67
define make_xilinx_bit
68
if test ! -f $(PROJECT_TOP); then\
69
echo ""; echo ""; echo "ERROR: No file $(PROJECT_TOP) found!"; else\
70
if test ! -f $(PROJECT_UCF); then\
71
echo ""; echo ""; echo "ERROR: No file $(PROJECT_UCF) found!"; else\
72
if test ! -f $(PROJECT_DEVICE); then \
73
echo ""; echo ""; echo "ERROR: No file $(PROJECT_DEVICE) found!"; else\
74
if test ! -f $(PROJECT_XILINX); then \
75
echo ""; echo ""; echo "ERROR: No file $(PROJECT_XILINX) found!"; else\
76
echo "INFO: Performing automated xilinx bitfile generation...";\
77
mkdir -p sandbox;\
78
cd sandbox;\
79
echo "PROJECT_TOP=$(PROJECT_TOP)" > Makefile.xilinx;\
80
echo "PROJECT_UCF=$(PROJECT_UCF)" >> Makefile.xilinx;\
81
echo "PROJECT_XILINX=$(PROJECT_XILINX)" >> Makefile.xilinx;\
82
echo "PROJECT_DEVICE=$(PROJECT_DEVICE)" >> Makefile.xilinx;\
83
echo "REL_PATH=.." >> Makefile.xilinx;\
84
cat ../Makefile.xilinx >> Makefile.xilinx;\
85
$(MAKE) -f Makefile.xilinx;\
86
fi; fi ; fi ; fi
87
endef
88
 
89
define make_template
90
mkdir -p c_sources
91
mkdir -p config
92
mkdir -p doc
93
mkdir -p sandbox
94
mkdir -p scripts
95
mkdir -p vhdl
96
endef
97
 
98
default:
99
        @echo "==========================================================="
100
        @echo " Possible make targets are:"
101
        @echo ""
102
        @echo " clean: Remove all temporary files"
103
        @echo ""
104
        @echo " sim: Perform an automated simulation. The files"
105
        @echo "      project.files and project.force in the directory"
106
        @echo "      config/ must exist for this command to work"
107
        @echo ""
108
        @echo " synth: Perform an automated synthesis. The files"
109
        @echo "        project.files, project.device, and project.toplevel"
110
        @echo "        in the directory config/ must exist for this "
111
        @echo "        command to work"
112
        @echo ""
113
        @echo " xilinx_bit: Generate a Xilinx bitfile for download. The"
114
        @echo "             files project.ucf, project.device,"
115
        @echo "             project.toplevel, and project.xilinx"
116
        @echo "             in the directory config/ must exist for this "
117
        @echo "             command to work"
118
        @echo ""
119
        @echo "==========================================================="
120
 
121
clean:
122
        @cd sandbox; find -type d | grep -v svn | grep "/" | xargs rm -rf ; find -type f | grep -v svn | xargs rm -f
123
 
124
sim:
125
        @$(do_modelsim)
126
 
127
synth:
128
        @$(do_synth)
129
 
130
xilinx_bit: $(PROJECT_EDF)
131
        @$(make_xilinx_bit)
132
 
133
template:
134
        @$(make_template)
135
 
136
$(PROJECT_EDF) :
137
        @$(do_synth)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.