summaryrefslogtreecommitdiff
path: root/modules.mk
blob: 00c506e0b1814a852c17d942217372a174516492 (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
65
66
67
68
69
70
modules = \
	coreboot \
	grub \
	memtest86 \
	bucts \
	flashrom \
	seabios \
	grubinvaders \
	dejavu \
	i945pwm
# powertop only needs to be used when running './powertop.trisquel6'
all_modules = $(modules) powertop

getall: $(addprefix src/,$(modules))
builddeps: $(addprefix builddeps-,$(modules))
cleandeps: $(addprefix cleandeps-,$(all_modules))
	rm -rf bin/*

# The generic rules

$(foreach module,$(all_modules),$(eval src/$(module)/%: builddeps-$(module); test -e $$@))

src/%: get source-locations.sh
	./get $*
builddeps-%: src/%
	$(MAKE) -C $<
cleandeps-%:
	test ! -f src/$*/Makefile || $(MAKE) -C src/$* clean

# The overrides

builddeps-coreboot:: src/coreboot
	$(MAKE) -C $</util/cbfstool
	$(MAKE) -C $</util/nvramtool
	$(MAKE) -C $< crossgcc-i386
cleandeps-coreboot::
	test ! -f src/coreboot/Makefile || $(MAKE) -C src/coreboot clean
	test ! -f src/coreboot/Makefile || $(MAKE) -C src/coreboot/util/cbfstool clean
	test ! -f src/coreboot/Makefile || $(MAKE) -C src/coreboot/util/nvramtool clean
	test ! -f src/coreboot/Makefile || $(MAKE) -C src/coreboot crossgcc-clean

builddeps-flashrom:: src/flashrom
	$(MAKE) -C $< patchname=_normal PROGRAM=flashrom
	$(MAKE) -C $< patchname=_lenovobios_macronix
	$(MAKE) -C $< patchname=_sst

builddeps-grub:: src/grub
	cd $< && { test -x ./configure || ./autogen.sh; }
	cd $< && { test -f ./Makefile || ./configure --with-platform=coreboot; }
	$(MAKE) -C $<

builddeps-powertop:: src/powertop
	cd $< && { text -x ./configure || ./autogen.sh; }
	cd $< && { test -f ./Makefile || ./configure; }
	$(MAKE) -C $<

builddeps-grubinvaders:: src/grubinvaders
	cd $< && ./compile.sh
cleandeps-grubinvaders::
	test ! -d src/grubinvaders || { cd src/grubinvaders && ./clean.sh; }

builddeps-seabios:: src/seabios resources/seabios/config/config
	cp resources/seabios/config/config $</.config
	$(MAKE) -C $<

builddeps-dejavu:: src/dejavu ;
cleandeps-dejavu:: ;

cleandeps-i945pwm::
	rm -f src/i945pwm/i945-pwm