Makefile

Thu, 17 Dec 2020 09:55:32 +0100

author
David Demelier <markand@malikania.fr>
date
Thu, 17 Dec 2020 09:55:32 +0100
changeset 24
2da99b7156de
parent 23
6081cc143d37
child 27
25155025900d
permissions
-rw-r--r--

misc: update before 1.0.0

#
# Makefile -- basic makefile for backlight
#
# Copyright (c) 2010-2020 David Demelier <markand@malikania.fr>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

.POSIX:

CC=             cc
CFLAGS=         -O3 -DNDEBUG

PREFIX=         /usr/local
BINDIR=         ${PREFIX}/bin
MANDIR=         ${PREFIX}/share/man
LIBDIR=         ${PREFIX}/lib

VERSION=        1.0.0

PROG=           backlight
SRCS=           backlight.c
MAN1=           backlight.1
OBJS=           ${SRCS:.c=.o}

all: ${PROG}

${PROG}: ${OBJS}
	${CC} -o ${PROG} ${OBJS} ${LDFLAGS}


install: ${PROG}
	mkdir -p ${DESTDIR}${BINDIR}
	mkdir -p ${DESTDIR}${MANDIR}/man1
	cp ${PROG} ${DESTDIR}${BINDIR}/${PROG}
	cp ${MAN1} ${DESTDIR}${MANDIR}/man1

install-udev: install
	chmod 755 ${DESTDIR}${BINDIR}/${PROG}
	mkdir -p ${DESTDIR}${LIBDIR}/udev/rules.d
	cp 50-brightness.rules ${DESTDIR}${LIBDIR}/udev/rules.d

install-setuid: install
	chmod 4755 ${DESTDIR}${BINDIR}/${PROG}

dist: clean
	mkdir backlight-${VERSION}
	cp CHANGES.md INSTALL.md LICENSE.md Makefile README.md 50-brightness.rules backlight.1 backlight.c backlight-${VERSION}
	tar -cJf backlight-${VERSION}.tar.xz backlight-${VERSION}
	rm -rf backlight-${VERSION}

clean:
	rm -f ${OBJS} ${PROG}

.PHONY: all clean dist install install-udev install-setuid

mercurial