File: Makefile

package info (click to toggle)
distro-info 1.14
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 324 kB
  • sloc: ansic: 973; python: 959; sh: 860; haskell: 519; perl: 411; makefile: 69
file content (20 lines) | stat: -rw-r--r-- 765 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
PREFIX ?= /usr
VENDOR ?= $(shell dpkg-vendor --query Vendor | tr '[:upper:]' '[:lower:]')

build: debian-distro-info ubuntu-distro-info

%-distro-info: %-distro-info.in distro-info-util.sh
	sed -e '/^\. .*distro-info-util.sh\"$$/r distro-info-util.sh' $< | \
		sed -e '/^##/d;/^\. .*distro-info-util.sh\"$$/d' | \
		python3 -c 'import re,sys;print(re.sub("(?<=\n)#BEGIN \w*#\n(.|\n)*?\n#END \w*#\n", "", re.sub("(?<=\n)#(BEGIN|END) $*#\n", "", sys.stdin.read())), end="")' > $@
	chmod +x $@

install: debian-distro-info ubuntu-distro-info
	install -d $(DESTDIR)$(PREFIX)/bin
	install -m 755 $^ $(DESTDIR)$(PREFIX)/bin
	ln -s $(VENDOR)-distro-info $(DESTDIR)$(PREFIX)/bin/distro-info

clean:
	rm -f debian-distro-info ubuntu-distro-info

.PHONY: build clean install