Project

General

Profile

« Previous | Next » 

Revision fd9f2fc4

Added by koszko over 1 year ago

fix out-of-source builds

View differences:

Makefile.in
17 17

  
18 18
version = <<VERSION>>
19 19
extension_files = background/ common/ content/ html/ licenses/ \
20
        copyright default_settings.json manifest.json
20
	icons/ copyright default_settings.json manifest.json
21 21

  
22
metafiles = build.sh configure Makefile.in process_html_file.sh README.txt \
22

  
23
metafiles = build.sh configure Makefile.in compute_scripts.awk README.txt \
23 24
        re-generate_icons.sh shell_utils.sh upload_amo.sh write_makefile.sh
24 25

  
25 26
# Configuration gets included here by write_makefile.sh
......
47 48
unpacked: $(default_target)-unpacked Makefile
48 49
all-unpacked: mozilla-unpacked chromium-unpacked
49 50
%-unpacked: $(extension_files) icons/haketilo16.png
50
	$(srcdir)/build.sh $* $(srcdir) $(UPDATE_URL)
51
	"$(srcdir)/build.sh" $* $(srcdir) $(UPDATE_URL)
51 52

  
52 53
install install-strip: $(default_target)-unpacked
53 54
	cp -R $(default_target)-unpacked \
54
	"$(DESTDIR)/{6fe13369-88e9-440f-b837-5012fb3bedec}"
55
		"$(DESTDIR)/{6fe13369-88e9-440f-b837-5012fb3bedec}"
55 56

  
56 57
uninstall:
57 58
	rm -r "$(DESTDIR)/{6fe13369-88e9-440f-b837-5012fb3bedec}"
......
59 60
%-build.zip: %-unpacked Makefile
60 61
	cd $< && zip -q -r ../$@ *
61 62

  
62
test/:
63
	mkdir $@
64

  
65
test/certs/: | test/
63
certs/:
66 64
	mkdir $@
67 65

  
68
test/certs/%.key: | test/certs/
66
certs/%.key: | certs/
69 67
	openssl genrsa -out $@ 2048
70 68

  
71
test/certs/rootCA.pem: test/certs/rootCA.key
69
certs/rootCA.pem: certs/rootCA.key
72 70
	openssl req -x509 -new -nodes -key $< -days 1024 -out $@ \
73 71
		 -subj "/CN=Haketilo Test"
74 72

  
75
test: test/certs/rootCA.pem test/certs/site.key $(default_target)-build.zip
76
	MOZ_HEADLESS=whatever $(PYTHON) -m pytest
73
pytest.ini: pytest.ini.in
74
	sed "s|<<SRCDIR>>|$(srcdir)|" <$< > $@
77 75

  
78
test-environment: test/certs/rootCA.pem test/certs/site.key
79
	python3 -m test
76
test: certs/rootCA.pem certs/site.key $(default_target)-build.zip \
77
		pytest.ini
78
	PYTHONPYCACHEPREFIX=$$(pwd)/test__pycache__ MOZ_HEADLESS=whatever \
79
		"$(PYTHON)" -m pytest
80 80

  
81
test-environment-with-haketilo: test/certs/rootCA.pem test/certs/site.key \
81
test-environment: certs/rootCA.pem certs/site.key
82
	"$(PYTHON)" -m test
83

  
84
test-environment-with-haketilo: certs/rootCA.pem certs/site.key \
82 85
		$(default_target)-build.zip
83
	python3 -m test --load-haketilo
86
	"$(PYTHON)" -m test --load-haketilo
84 87

  
85 88
# helper targets
86 89
clean mostlyclean:
87 90
	rm -rf mozilla-unpacked chromium-unpacked haketilo-[1-9]*
88 91
	rm -f mozilla-build.zip chromium-build.zip exports_init.js
89
	rm -rf test/certs
90
	rm -rf $$(find . -name geckodriver.log)
91
	rm -rf $$(find . -type d -name __pycache__)
92
	rm -rf $$(find . -type d -name injected_scripts)
92
	rm -rf pytest.ini certs injected_scripts geckodriver.log
93
	rm -rf certs/ test__pycache__/ .pytest_cache/
93 94

  
94 95
distclean: clean
95 96
	rm -f Makefile config.status record.conf
......
99 100
	@echo 'deletes files that may need special tools to rebuild.'
100 101
	rm -f "$(srcdir)"/icons/*.png
101 102

  
102
dist: $(extension_files) $(metafiles) icons/haketilo16.png
103
	test -d haketilo-$(version) || mkdir haketilo-$(version)
104
	for file in $(extension_files) $(metafiles) icons/; do \
105
	    cp -R "$(srcdir)"/$$file haketilo-$(version); \
106
	done
107
	tar cf haketilo-$(version).tar haketilo-$(version)
108
	gzip haketilo-$(version).tar
109

  
110 103
# Files for constructing the makefile
111 104
Makefile: config.status Makefile.in record.conf
112 105
	./config.status
......
115 108
	cp "$(srcdir)"/write_makefile.sh config.status
116 109

  
117 110
# Unused GNU-specified targets
111
dist:
118 112
install-html:
119 113
install-dvi:
120 114
install-pdf:

Also available in: Unified diff