aboutsummaryrefslogtreecommitdiff
blob: 4875465e12683bf59e194ac10865e5ce98cfee40 (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
INSTALL    	= @INSTALL@
INSTALL_PY 	= @INSTALL_DATA@ -D -g portage -o 0
PORTAGE_PYM	= @PORTAGE_BASE@/pym
DESTDIR 	= @DESTDIR@
INSTALL_PYTHON_SOURCES = @INSTALL_PYTHON_SOURCES@

compile:
	python -c 'import compileall; compileall.compile_dir(".")' || exit 1
clean:
	find . -type f -name '*.pyc' -exec rm {} \;

install:	compile
	$(INSTALL) -d -m755 -o 0 -g portage $(DESTDIR)/$(PORTAGE_PYM) || exit 1
	if test -n "$(INSTALL_PYTHON_SOURCES)"; then \
		find . -type f -name '*.py' -exec $(INSTALL_PY) {} $(DESTDIR)/$(PORTAGE_PYM)/{} \; || exit 1; \
	fi
	find . -type f -name '*.pyc' -exec $(INSTALL_PY) {} $(DESTDIR)/$(PORTAGE_PYM)/{} \; || exit 1

all: 	compile

distdir:
	find  -type f -name '*.py' -exec $(INSTALL) -D {} $(distdir)/{} \;
		
.PHONY:	distdir install clean