Skip to content

Commit

Permalink
make: Added makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Venries committed Mar 18, 2017
1 parent 09e0f6e commit 11c4ef0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ src/*
!src/lux.sh

!CONTRIBUTING.md
!Makefile
!LICENSE
!README.md
!.gitignore
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
MANDIR = $(DESTDIR)/usr/share/man/man1
LICENSEDIR = $(DESTDIR)/usr/share/licenses/lux
UDEVDIR = $(DESTDIR)/etc/udev/rules.d
BINDIR = $(DESTDIR)/usr/bin
UDEVRULE = rules.d/99-lux.rules
MANPAGE = lux.1.gz

$(MANPAGE):
help2man -n 'Shell script to easily control brightness on backlight controllers.' \
-N -h -h -v -v src/lux.sh | gzip - > $(MANPAGE)

install: $(MANPAGE)
mkdir -p $(MANDIR)
mkdir -p $(LICENSEDIR)
mkdir -p $(UDEVDIR)
mkdir -p $(BINDIR)
chmod 644 $<
chmod 644 LICENSE
chmod 644 $(UDEVRULE)
chmod 755 src/lux.sh
cp $< $(MANDIR)/$<
cp LICENSE $(LICENSEDIR)/LICENSE
cp $(UDEVRULE) $(UDEVDIR)/99-lux.rules
cp src/lux.sh $(BINDIR)/lux

uninstall:
$(RM) -r $(LICENSEDIR)
$(RM) $(MANDIR)/$(MANPAGE) $(UDEVDIR)/$(UDEVRULE) $(BINDIR)/lux

.PHONY: install uninstall

0 comments on commit 11c4ef0

Please sign in to comment.