Debian Codegraph @

Makefile

raw symbols SCIP
1 NAME := alsa-scarlett-gui
2 VERSION := $(shell git describe --abbrev=4 --always --tags | sed 's/-rc/~rc/g; s/-/./g')
3 NAMEVER := $(NAME)-$(VERSION)
4 TAR_FILE := $(NAMEVER).tar
5 TARGZ_FILE := $(TAR_FILE).gz
6 SPEC_FILE := $(NAME).spec
7
8 default:
9 @echo "alsa-scarlett-gui"
10 @echo
11 @echo "If you want to build and install from source, please try:"
12 @echo " cd src"
13 @echo " make -j$(shell nproc)"
14 @echo " sudo make install"
15 @echo
16 @echo "This Makefile knows about packaging:"
17 @echo " make tar"
18 @echo " make rpm"
19 @echo " make deb"
20 @echo " make arch"
21
22 tar: $(TARGZ_FILE)
23
24 $(TARGZ_FILE):
25 git archive --format=tar --prefix=$(NAMEVER)/ HEAD > $(TAR_FILE)
26 sed 's_VERSION$$_$(VERSION)_' < $(SPEC_FILE).template > $(SPEC_FILE)
27 tar --append -f $(TAR_FILE) \
28 --transform s_^_$(NAMEVER)/_ \
29 --owner=root --group=root \
30 $(SPEC_FILE)
31 rm -f $(SPEC_FILE)
32 gzip < $(TAR_FILE) > $(TARGZ_FILE)
33 rm -f $(TAR_FILE)
34
35 rpm: $(TARGZ_FILE)
36 rpmbuild -tb $(TARGZ_FILE)
37
38 deb:
39 $(MAKE) -C src VERSION=$(VERSION) PREFIX=/usr
40 mkdir -p deb-build/DEBIAN \
41 deb-build/usr/bin \
42 deb-build/usr/share/applications \
43 deb-build/usr/share/icons/hicolor/256x256/apps \
44 deb-build/usr/share/doc/$(NAME)
45 cp src/alsa-scarlett-gui deb-build/usr/bin/
46 cp src/vu.b4.alsa-scarlett-gui.desktop deb-build/usr/share/applications/
47 cp src/img/vu.b4.alsa-scarlett-gui.png deb-build/usr/share/icons/hicolor/256x256/apps/
48 cp -r README.md FAQ.md RELEASE-NOTES.md demo docs img deb-build/usr/share/doc/$(NAME)/
49 sed "s/VERSION/$(VERSION)/g" debian/control > deb-build/DEBIAN/control
50 dpkg-deb --root-owner-group --build deb-build $(NAME)_$(VERSION).deb
51 rm -rf deb-build
52
53 arch:
54 sed 's/VERSION/$(VERSION)/g' PKGBUILD.template > PKGBUILD