summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: bb1159ff56bc1acc4424b2274a13337c1fc42932 (plain)
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
PREFIX=${PWD}


default:src/tools.stamp src/evb-yosys-demo.stamp

src/evb-yosys-demo.stamp: src/tools.stamp
	${MAKE} -C src/evb-yosys-demo/ice40hx8k-evb 
	${MAKE} -C src/evb-yosys-demo/ice40-io-video
	touch $@

src/tools.stamp: src/nextpnr.stamp src/yosys.stamp src/flashrom.stamp
	touch $@

src/yosys.stamp:#src/yosys/Makefile
	# the muppets did not make this easy
	if [ -d src/yosys/abc]; then ln -s ../abc src/yosys/abc; fi
	(cd src/abc && rm -f .gitcommit && git checkout .gitcommit && git log -1 --pretty=format:"%h" > .gitcommit )
	${MAKE} -C src/yosys PREFIX=${PREFIX} -j 16 
	${MAKE} -C src/yosys PREFIX=${PREFIX} install
	(cd src/abc && rm -f .gitcommit && git checkout .gitcommit)
	/bin/rm -f src/abc/abc-*
	touch $@

#src/yosys/Makefile:
#	git clone https://github.com/YosysHQ/yosys src/yosys


src/nextpnr.stamp: src/nextpnr/build/Makefile
	${MAKE} -C src/nextpnr/build 
	${MAKE} -C src/nextpnr/build install
	touch $@

src/nextpnr/build/Makefile:src/icestorm.stamp #src/nextpnr/CMakeLists.txt
	mkdir -p src/nextpnr/build
	(cd src/nextpnr/build && cmake .. -DARCH=ice40 -DICESTORM_INSTALL_PREFIX=${PREFIX} -DCMAKE_INSTALL_PREFIX=${PREFIX})


#src/nextpnr/CMakeLists.tdxt:
#	git clone https://github.com/YosysHQ/nextpnr src/nextpnr
#	(cd src/nextpnr && git submodule init)
#	(cd src/nextpnr && git submodule update)


src/icestorm.stamp: #src/icestorm/config.mk
	${MAKE} -C src/icestorm PREFIX=${PREFIX}
	${MAKE} -C src/icestorm PREFIX=${PREFIX} install
	touch $@
	
src/flashrom.stamp: #src/flashrom/Makefile
	${MAKE} -C src/flashrom PREFIX=${PREFIX}
	if [ ! -d src/flashrom/man8 ]; then ln -s . src/flashrom/man8; fi
	${MAKE} -C src/flashrom PREFIX=${PREFIX} install
	/bin/rm -f src/flashrom/man8
	touch $@



	


#icestorm/config.mk:
#	git clone https://github.com/YosysHQ/icestorm src/icestorm