Mercurial > libbuf
annotate Makefile @ 26:0cc98943f6e2
tests: switch to rexo
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 12 Oct 2021 09:24:18 +0200 |
parents | b7690784cd17 |
children | 4c5538271f2b |
rev | line source |
---|---|
0 | 1 # |
2 # Makefile -- simple string buffer for C | |
3 # | |
22
d87e84936795
misc: update copyright years
David Demelier <markand@malikania.fr>
parents:
18
diff
changeset
|
4 # Copyright (c) 2019-2021 David Demelier <markand@malikania.fr> |
0 | 5 # |
6 # Permission to use, copy, modify, and/or distribute this software for any | |
7 # purpose with or without fee is hereby granted, provided that the above | |
8 # copyright notice and this permission notice appear in all copies. | |
9 # | |
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 # | |
18 | |
19 .POSIX: | |
20 | |
21 .SUFFIXES: | |
22 .SUFFIXES: .o .c | |
23 | |
24 CC= cc | |
25 AR= ar | |
26 CFLAGS= -O3 -DNDEBUG | |
27 | |
28 PREFIX= /usr/local | |
29 INCDIR= ${PREFIX}/include | |
30 LIBDIR= ${PREFIX}/lib | |
31 MANDIR= ${PREFIX}/share/man | |
32 | |
23
b7690784cd17
misc: update before 0.3.0
David Demelier <markand@malikania.fr>
parents:
22
diff
changeset
|
33 VERSION= 0.3.0 |
8
167277f57ce6
misc: update before 0.1.0
David Demelier <markand@malikania.fr>
parents:
3
diff
changeset
|
34 |
23
b7690784cd17
misc: update before 0.3.0
David Demelier <markand@malikania.fr>
parents:
22
diff
changeset
|
35 SRCS= buf.c |
0 | 36 OBJS= ${SRCS:.c=.o} |
37 | |
38 MAN= buf_clear.3 \ | |
39 buf_dup.3 \ | |
40 buf_erase.3 \ | |
41 buf_finish.3 \ | |
42 buf_init.3 \ | |
43 buf_printf.3 \ | |
44 buf_putc.3 \ | |
45 buf_puts.3 \ | |
46 buf_reserve.3 \ | |
47 buf_resize.3 \ | |
48 buf_shrink.3 \ | |
49 buf_sub.3 \ | |
50 buf_vprintf.3 \ | |
51 libbuf.3 | |
52 | |
53 TESTS= test/test-clear.c \ | |
54 test/test-dup.c \ | |
55 test/test-erase.c \ | |
56 test/test-finish.c \ | |
57 test/test-init.c \ | |
58 test/test-printf.c \ | |
59 test/test-putc.c \ | |
60 test/test-puts.c \ | |
61 test/test-reserve.c \ | |
62 test/test-resize.c \ | |
63 test/test-shrink.c \ | |
64 test/test-sub.c | |
65 TESTS_OBJS= ${TESTS:.c=} | |
66 | |
67 .c: | |
26 | 68 ${CC} -Iextern/librexo -I. ${CFLAGS} $< -o $@ libbuf.a |
0 | 69 |
70 all: libbuf.a | |
71 | |
72 libbuf.a: ${OBJS} | |
73 ${AR} -rc $@ ${OBJS} | |
74 | |
75 clean: | |
76 rm -f libbuf.a ${OBJS} | |
77 rm -f ${TESTS_OBJS} | |
78 | |
8
167277f57ce6
misc: update before 0.1.0
David Demelier <markand@malikania.fr>
parents:
3
diff
changeset
|
79 dist: |
167277f57ce6
misc: update before 0.1.0
David Demelier <markand@malikania.fr>
parents:
3
diff
changeset
|
80 rm -rf libbuf-${VERSION} |
167277f57ce6
misc: update before 0.1.0
David Demelier <markand@malikania.fr>
parents:
3
diff
changeset
|
81 mkdir libbuf-${VERSION} |
167277f57ce6
misc: update before 0.1.0
David Demelier <markand@malikania.fr>
parents:
3
diff
changeset
|
82 cp -R test extern libbuf-${VERSION} |
23
b7690784cd17
misc: update before 0.3.0
David Demelier <markand@malikania.fr>
parents:
22
diff
changeset
|
83 cp ${SRCS} buf.h libbuf-${VERSION} |
8
167277f57ce6
misc: update before 0.1.0
David Demelier <markand@malikania.fr>
parents:
3
diff
changeset
|
84 cp ${MAN} libbuf-${VERSION} |
15 | 85 cp INSTALL.md LICENSE.md README.md Makefile libbuf-${VERSION} |
8
167277f57ce6
misc: update before 0.1.0
David Demelier <markand@malikania.fr>
parents:
3
diff
changeset
|
86 tar -cjf libbuf-${VERSION}.tar.xz libbuf-${VERSION} |
167277f57ce6
misc: update before 0.1.0
David Demelier <markand@malikania.fr>
parents:
3
diff
changeset
|
87 rm -rf libbuf-${VERSION} |
167277f57ce6
misc: update before 0.1.0
David Demelier <markand@malikania.fr>
parents:
3
diff
changeset
|
88 |
0 | 89 install: |
90 mkdir -p ${DESTDIR}${INCDIR} | |
91 mkdir -p ${DESTDIR}${LIBDIR} | |
92 mkdir -p ${DESTDIR}${MANDIR}/man3 | |
93 cp buf.h ${DESTDIR}${INCDIR} | |
94 cp libbuf.a ${DESTDIR}${LIBDIR} | |
95 cp ${MAN} ${DESTDIR}${MANDIR}/man3 | |
96 | |
97 ${TESTS_OBJS}: libbuf.a | |
98 | |
99 test: ${TESTS_OBJS} | |
100 for t in ${TESTS_OBJS}; do ./$$t; done | |
101 | |
15 | 102 .PHONY: all clean dist install test |