Makefile

Tue, 13 Apr 2021 21:30:13 +0200

author
David Demelier <markand@malikania.fr>
date
Tue, 13 Apr 2021 21:30:13 +0200
changeset 12
40adb00674ba
parent 10
9ab498c63f57
permissions
-rw-r--r--

misc: added signature for changeset 737e7df59283

0
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #
10
9ab498c63f57 misc: update before 2.0.0
David Demelier <markand@malikania.fr>
parents: 9
diff changeset
2 # Makefile -- basic Makefile for bcc
0
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 #
9
ab5c41277358 misc: update copyright years
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
4 # Copyright (c) 2020-2021 David Demelier <markand@malikania.fr>
0
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 #
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # Permission to use, copy, modify, and/or distribute this software for any
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # purpose with or without fee is hereby granted, provided that the above
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 # copyright notice and this permission notice appear in all copies.
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 #
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 #
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 .POSIX:
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
20
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 # User options.
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 CC= cc
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 CFLAGS= -Wall -Wextra -DNDEBUG -D_XOPEN_SOURCE=700 -O3 -std=c11 -pedantic
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
24
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 # Installation paths.
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 PREFIX= /usr/local
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 BINDIR= ${PREFIX}/bin
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 MANDIR= ${PREFIX}/share/man
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
29
10
9ab498c63f57 misc: update before 2.0.0
David Demelier <markand@malikania.fr>
parents: 9
diff changeset
30 VERSION= 2.0.0
0
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 SRCS= bcc.c
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 OBJS= ${SRCS:.c=.o}
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
33
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 .SUFFIXES:
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 .SUFFIXES: .o .c
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
36
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 all: bcc
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
38
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 .c.o:
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
40 ${CC} ${CFLAGS} -c $< -o $@
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
41
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 bcc: ${OBJS}
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 ${CC} -o $@ ${OBJS}${LDFLAGS}
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
44
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
45 dist: clean
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 mkdir bcc-${VERSION}
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
47 cp CHANGES.md INSTALL.md LICENSE.md Makefile README.md bcc.1 bcc.c bcc-${VERSION}
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 tar -cJf bcc-${VERSION}.tar.xz bcc-${VERSION}
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
49 rm -rf bcc-${VERSION}
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
50
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
51 install:
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 mkdir -p ${DESTDIR}${BINDIR}
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
53 cp bcc ${DESTDIR}${BINDIR}
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
54 mkdir -p ${DESTDIR}${MANDIR}/man1
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
55 cp bcc.1 ${DESTDIR}${MANDIR}/man1
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
56
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
57 clean:
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
58 rm -f bcc ${OBJS} bcc-${VERSION}.tar.xz
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
59
e5fc6565dce0 misc: initial import
David Demelier <markand@malikania.fr>
parents:
diff changeset
60 .PHONY: all clean dist install

mercurial