File: common-py.mk

package info (click to toggle)
gimp-plugin-registry 7.20140602
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 55,856 kB
  • ctags: 4,984
  • sloc: ansic: 46,100; lisp: 20,560; python: 14,721; sh: 3,306; cpp: 2,528; makefile: 1,023; xml: 546
file content (30 lines) | stat: -rw-r--r-- 645 bytes parent folder | download | duplicates (5)
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

PYDEFAULT := $(shell pyversions -vd)
PYCOMPILE := $(shell which pycompile| grep -v 'not found')

ifndef SCRIPT_SRCDIR
 SCRIPT_SRCDIR := $(CURDIR)
endif

ifdef PYCOMPILE
build: $(SCRIPT:%=$(SCRIPT_SRCDIR)/%c)

$(SCRIPT_SRCDIR)/%c: $(SCRIPT_SRCDIR)/%
	pycompile -V $(PYDEFAULT) $*
else
build:
	#nothing to do without pycompile
endif

install: $(SCRIPT:%=$(DESTDIR)$(PLUGINSCRIPTDIR)/%)

$(DESTDIR)$(PLUGINSCRIPTDIR)/%: $(SCRIPT_SRCDIR)/%
	if ! test -d $(DESTDIR)$(PLUGINSCRIPTDIR); then \
		install -d -m 755 $(DESTDIR)$(PLUGINSCRIPTDIR) ;\
	fi
	install -m 755 $(SCRIPT_SRCDIR)/$* $@

clean:
	rm -f $(SCRIPT_SRCDIR)/*.pyc

.PHONY: build install