blob: c3edc8cf1cf50990efbf67c2bb824c5a2754f20f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# See LICENSE file for copyright and license details.
include libs.mk
CC = cc
SRC != find src -name "*.c"
OBJ = ${SRC:.c=.o}
LIBNAME = liblog
CFLAGS = -Wall -ansi --std=c89 -pedantic ${OPT} -I${LIBINC}
LDFLAGS = ${LIBS}
dist:
@make OPT='-O2 -pipe -Werror' all
static: clean libs
@make OPT='-O2 -pipe -Werror' ${LIBNAME:=.a}
shared: clean libs
@make OPT='-O2 -pipe -Werror -fPIC' ${LIBNAME:=.so}
debug:
@make OPT=-g all
all: ${LIBNAME:=.so} ${LIBNAME:=.a}
${LIBNAME:=.so}: ${OBJ}
${CC} ${LDFLAGS} -fPIC -shared ${OBJ} -o $@
${LIBNAME:=.a}: ${OBJ}
ar rcs $@ ${OBJ}
.c.o:
${CC} ${CFLAGS} -fPIC -c $< -o $@
clean:
rm -f ${OBJ} ${LIBNAME}.* *.core
cd test && make clean
tests: all
cd test && make clean tests
|