blob: 5d39d024f059fe56419b252a78be2d0d11bec0fd (
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
43
44
45
46
47
48
49
50
51
52
|
#
# Copyright (C) 2022-2023 Alessandro Iezzi <aiezzi AT alessandroiezzi PERIOD it>
#
# This file is part of libutils.
#
# libutils is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# libutils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with libutils. If not, see <https://www.gnu.org/licenses/>.
#
CC = cc
SRC != find * -name '*.c'
OBJ = ${SRC:.c=.o}
LIBNAME = utils
SHARED = ../lib${LIBNAME}.so
#WARNINGS = -Wall -Werror -pedantic
STANDARD = -std=c99
CFLAGS = ${WARNINGS} -I../src/
LFLAGS = -l${LIBNAME} -L../ -Wl,-rpath=../
NAME = test1
all: ${SHARED} ${NAME}
@echo
@echo '+-----------------+'
@echo '| Executing tests |'
@echo '+-----------------+'
@echo
./${NAME}
${SHARED}:
@make -C ..
.c.o:
${CC} ${CFLAGS} -c $< -o $@
${NAME}: ${OBJ}
${CC} ${LFLAGS} -o $@ ${OBJ}
clean:
rm -f ${OBJ} ${NAME} *.core
|