forked from pkgconf/pkgconf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.lite
More file actions
112 lines (93 loc) · 3.54 KB
/
Copy pathMakefile.lite
File metadata and controls
112 lines (93 loc) · 3.54 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Copyright (c) 2019 William Pitcock <nenolod@dereferenced.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# This software is provided 'as is' and without any warranty, express or
# implied. In no event shall the authors be liable for any damages arising
# from the use of this software.
# pkgconf-lite is a staticly-linked version of pkgconf that does not include
# all features, notably it does not include cross-compile support and MSVC
# support. It does not include the libpkgconf library.
LIBPKGCONF_SRCS = \
libpkgconf/argvsplit.c \
libpkgconf/audit.c \
libpkgconf/bsdstubs.c \
libpkgconf/buffer.c \
libpkgconf/bufferset.c \
libpkgconf/bytecode.c \
libpkgconf/cache.c \
libpkgconf/client.c \
libpkgconf/dependency.c \
libpkgconf/fileio.c \
libpkgconf/fragment.c \
libpkgconf/license.c \
libpkgconf/output.c \
libpkgconf/parser.c \
libpkgconf/path.c \
libpkgconf/personality.c \
libpkgconf/pkg.c \
libpkgconf/queue.c \
libpkgconf/tuple.c \
libpkgconf/variable.c \
libpkgconf/version.c \
CLI_CORE_SRCS = \
cli/getopt_long.c \
cli/core.c
CLI_MAIN_SRCS = \
cli/main.c
PKGCONF_SRCS = ${LIBPKGCONF_SRCS} ${CLI_CORE_SRCS} ${CLI_MAIN_SRCS}
PKGCONF_OBJS = ${PKGCONF_SRCS:.c=.o}
TEST_RUNNER_MAIN_SRCS = \
tests/test-runner.c
TEST_RUNNER_SRCS = ${LIBPKGCONF_SRCS} ${CLI_CORE_SRCS} ${TEST_RUNNER_MAIN_SRCS}
TEST_RUNNER_OBJS = ${TEST_RUNNER_SRCS:.c=.o}
CFLAGS += -Wno-unused-variable -Wno-unused-parameter
CPPFLAGS = -DPKGCONF_LITE -I. -Ilibpkgconf -Icli -DSYSTEM_LIBDIR=\"${SYSTEM_LIBDIR}\" -DSYSTEM_INCLUDEDIR=\"${SYSTEM_INCLUDEDIR}\" -DPKG_DEFAULT_PATH=\"${PKG_DEFAULT_PATH}\"
STRIP = strip
all: pkgconf-lite
libpkgconf/config.h:
@echo '#define PACKAGE_NAME "pkgconf-lite"' >> $@
@echo '#define PACKAGE_BUGREPORT "https://git.dereferenced.org/pkgconf/pkgconf/issues"' >> $@
@echo '#define PACKAGE_VERSION "2.5.1"' >> $@
@echo '#define PACKAGE PACKAGE_NAME " " PACKAGE_VERSION' >> $@
@echo '#define HAVE_DECL_STRNDUP 1' >> $@
@echo '#define HAVE_DECL_REALLOCARRAY 1' >> $@
pkgconf-lite: preflight libpkgconf/config.h ${PKGCONF_OBJS}
${CC} ${CFLAGS} ${STATIC} -o $@ ${PKGCONF_OBJS}
${STRIP} $@
test-runner-lite: preflight libpkgconf/config.h ${TEST_RUNNER_OBJS}
${CC} ${CFLAGS} ${STATIC} -o $@ ${TEST_RUNNER_OBJS}
${STRIP} $@
check: test-runner-lite
./test-runner-lite --test-fixtures ./tests ./t/basic
./test-runner-lite --test-fixtures ./tests ./t/ordering
./test-runner-lite --test-fixtures ./tests ./t/parser
./test-runner-lite --test-fixtures ./tests ./t/personality
./test-runner-lite --test-fixtures ./tests ./t/sbom
./test-runner-lite --test-fixtures ./tests ./t/solver
./test-runner-lite --test-fixtures ./tests ./t/sysroot
./test-runner-lite --test-fixtures ./tests ./t/tuple
clean:
rm -f libpkgconf/config.h
rm -f ${PKGCONF_OBJS}
rm -f pkgconf-lite
rm -f test-runner-lite
preflight: preflight-system-libdir preflight-system-includedir preflight-pkg-default-path
preflight-system-libdir:
@if test -z "${SYSTEM_LIBDIR}"; then \
echo "SYSTEM_LIBDIR not set."; \
exit 1; \
fi
preflight-system-includedir:
@if test -z "${SYSTEM_INCLUDEDIR}"; then \
echo "SYSTEM_INCLUDEDIR not set."; \
exit 1; \
fi
preflight-pkg-default-path:
@if test -z "${PKG_DEFAULT_PATH}"; then \
echo "PKG_DEFAULT_PATH not set."; \
exit 1; \
fi
.PHONY: preflight preflight-system-libdir preflight-system-includedir preflight-pkg-default-path clean