Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Makefile fixes: #58

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,34 @@ ZSHDIR = $(PREFIX)/share/zsh/site-functions
RM = rm
Q = @

all: common/$(PN) doc/$(PN).1.gz
all: common/$(PN)

common/$(PN): common/$(PN).in
$(Q)echo -e '\033[1;32mSetting version\033[0m'
$(Q)sed -e 's/@VERSION@/'$(VERSION)'/' common/$(PN).in >common/$(PN)
$(Q)sed -i common/$(PN) -e 's|@SKELDIR@|'$(SKELDIR)'|'

doc/$(PN).1.gz: doc/$(PN).1
$(Q)echo -e '\033[1;32mCompressing manpage\033[0m'
gzip -9 -c doc/$(PN).1 > doc/$(PN).1.gz

clean:
$(RM) -f common/$(PN)
$(RM) -f doc/$(PN).1.gz

install-bin:
install-bin: common/$(PN)
$(Q)echo -e '\033[1;32mInstalling main script and config...\033[0m'
install -Dm755 common/$(PN) "$(DESTDIR)$(BINDIR)/$(PN)"
install -Dm644 common/config.skel "$(DESTDIR)$(SKELDIR)/config.skel"
install -p -dm755 "$(DESTDIR)$(ZSHDIR)"
install -Dm644 common/zsh-completion "$(DESTDIR)$(ZSHDIR)/_pulseaudio-ctl"
install -d -m755 "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(SKELDIR)" "$(DESTDIR)$(ZSHDIR)"
install -m755 common/$(PN) "$(DESTDIR)$(BINDIR)/$(PN)"
install -m644 common/config.skel "$(DESTDIR)$(SKELDIR)/config.skel"
install -m644 common/zsh-completion "$(DESTDIR)$(ZSHDIR)/_pulseaudio-ctl"

install-man:
$(Q)echo -e '\033[1;32mInstalling manpage...\033[0m'
install -Dm644 doc/$(PN).1.gz "$(DESTDIR)$(MANDIR)/$(PN).1.gz"
install -d -m755 "$(DESTDIR)$(MANDIR)"
install -m644 doc/$(PN).1 "$(DESTDIR)$(MANDIR)/$(PN).1"

uninstall:
$(RM) "$(DESTDIR)$(BINDIR)/$(PN)"
$(RM) "$(DESTDIR)$(MANDIR)/$(PN).1.gz"
$(RM) "$(DESTDIR)$(MANDIR)/$(PN).1"
$(RM) -rf "$(DESTDIR)$(SKELDIR)"
$(RM) "$(DESTDIR)$(ZSHDIR)/_pulseaudio-ctl"

install: all install-bin install-man
install: install-bin install-man

.PHONY: all clean install-bin install-man uninstall