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

0
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #
24
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
2 # Makefile -- basic makefile for backlight
0
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 #
19
0de3886f98ad misc: minor updates
David Demelier <markand@malikania.fr>
parents: 13
diff changeset
4 # Copyright (c) 2010-2020 David Demelier <markand@malikania.fr>
0
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 #
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # Permission to use, copy, modify, and distribute this software for any
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # purpose with or without fee is hereby granted, provided that the above
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 # copyright notice and this permission notice appear in all copies.
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 #
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 #
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
13
62ac42bd4851 make: simplify makefile, advertise clang
David Demelier <markand@malikania.fr>
parents: 12
diff changeset
19 .POSIX:
62ac42bd4851 make: simplify makefile, advertise clang
David Demelier <markand@malikania.fr>
parents: 12
diff changeset
20
23
6081cc143d37 backlight: add OpenBSD support
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
21 CC= cc
22
1778aac34198 make: simplify
David Demelier <markand@malikania.fr>
parents: 19
diff changeset
22 CFLAGS= -O3 -DNDEBUG
0
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
23
6
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
24 PREFIX= /usr/local
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
25 BINDIR= ${PREFIX}/bin
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
26 MANDIR= ${PREFIX}/share/man
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
27 LIBDIR= ${PREFIX}/lib
0
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
28
24
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
29 VERSION= 1.0.0
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
30
6
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
31 PROG= backlight
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
32 SRCS= backlight.c
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
33 MAN1= backlight.1
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
34 OBJS= ${SRCS:.c=.o}
0
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
35
6
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
36 all: ${PROG}
0
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
37
6
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
38 ${PROG}: ${OBJS}
22
1778aac34198 make: simplify
David Demelier <markand@malikania.fr>
parents: 19
diff changeset
39 ${CC} -o ${PROG} ${OBJS} ${LDFLAGS}
0
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
40
6
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
41
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
42 install: ${PROG}
8
23faf720d186 make: use POSIX only commands
David Demelier <markand@malikania.fr>
parents: 6
diff changeset
43 mkdir -p ${DESTDIR}${BINDIR}
23faf720d186 make: use POSIX only commands
David Demelier <markand@malikania.fr>
parents: 6
diff changeset
44 mkdir -p ${DESTDIR}${MANDIR}/man1
23faf720d186 make: use POSIX only commands
David Demelier <markand@malikania.fr>
parents: 6
diff changeset
45 cp ${PROG} ${DESTDIR}${BINDIR}/${PROG}
23faf720d186 make: use POSIX only commands
David Demelier <markand@malikania.fr>
parents: 6
diff changeset
46 cp ${MAN1} ${DESTDIR}${MANDIR}/man1
0
73a371432d36 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
47
8
23faf720d186 make: use POSIX only commands
David Demelier <markand@malikania.fr>
parents: 6
diff changeset
48 install-udev: install
23faf720d186 make: use POSIX only commands
David Demelier <markand@malikania.fr>
parents: 6
diff changeset
49 chmod 755 ${DESTDIR}${BINDIR}/${PROG}
23faf720d186 make: use POSIX only commands
David Demelier <markand@malikania.fr>
parents: 6
diff changeset
50 mkdir -p ${DESTDIR}${LIBDIR}/udev/rules.d
23faf720d186 make: use POSIX only commands
David Demelier <markand@malikania.fr>
parents: 6
diff changeset
51 cp 50-brightness.rules ${DESTDIR}${LIBDIR}/udev/rules.d
6
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
52
8
23faf720d186 make: use POSIX only commands
David Demelier <markand@malikania.fr>
parents: 6
diff changeset
53 install-setuid: install
23faf720d186 make: use POSIX only commands
David Demelier <markand@malikania.fr>
parents: 6
diff changeset
54 chmod 4755 ${DESTDIR}${BINDIR}/${PROG}
6
77ea2359f3e4 misc: refactor
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
55
24
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
56 dist: clean
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
57 mkdir backlight-${VERSION}
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
58 cp CHANGES.md INSTALL.md LICENSE.md Makefile README.md 50-brightness.rules backlight.1 backlight.c backlight-${VERSION}
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
59 tar -cJf backlight-${VERSION}.tar.xz backlight-${VERSION}
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
60 rm -rf backlight-${VERSION}
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
61
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
62 clean:
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
63 rm -f ${OBJS} ${PROG}
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
64
2da99b7156de misc: update before 1.0.0
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
65 .PHONY: all clean dist install install-udev install-setuid

mercurial