mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
Obtained from https://github.com/pkgconf/pkgconf/archive/refs/tags/pkgconf-3.0.9.tar.gz SHA1: a390f016a7a5ff419c9eef9e2b2c01fe86c11971 - SHA256: 32310a33bb97425ebc0707cb5af59f9dc05d10282dcd4db628a45ed904993dc6 - SHA512: 30776d31f860910286b96fbf60a19b5a6d1e73cb6a1077a019d763ae6e5ed1e8d81bc3649978c83f40e5e90ae779f7e530c513b700c8e73bb6399883dd6ef7ab - Sponsored by: The FreeBSD Foundation
124 lines
4.6 KiB
Makefile
124 lines
4.6 KiB
Makefile
# Copyright (c) 2019 William Pitcock <[email protected]>
|
|
#
|
|
# 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 = -D_DEFAULT_SOURCE -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 "3.0.9"' >> $@
|
|
@echo '#define PACKAGE PACKAGE_NAME " " PACKAGE_VERSION' >> $@
|
|
|
|
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/link-abi
|
|
./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 is not set."; \
|
|
echo " Set it to the compiler's default library directory (e.g. /usr/lib)."; \
|
|
echo " pkgconf strips this path from --libs output so a package does not emit"; \
|
|
echo " a redundant -L for a directory already on the linker's search path."; \
|
|
echo " Example: make -f Makefile.lite SYSTEM_LIBDIR=/usr/lib ..."; \
|
|
exit 1; \
|
|
fi
|
|
|
|
preflight-system-includedir:
|
|
@if test -z "${SYSTEM_INCLUDEDIR}"; then \
|
|
echo "SYSTEM_INCLUDEDIR is not set."; \
|
|
echo " Set it to the compiler's default include directory (e.g. /usr/include)."; \
|
|
echo " pkgconf strips this path from --cflags output so a package does not emit"; \
|
|
echo " a redundant -I for a directory already on the compiler's search path."; \
|
|
echo " Example: make -f Makefile.lite SYSTEM_INCLUDEDIR=/usr/include ..."; \
|
|
exit 1; \
|
|
fi
|
|
|
|
preflight-pkg-default-path:
|
|
@if test -z "${PKG_DEFAULT_PATH}"; then \
|
|
echo "PKG_DEFAULT_PATH is not set."; \
|
|
echo " Set it to the colon-separated (semicolon on Windows) list of directories where this"; \
|
|
echo " system installs .pc files; it is the default search path pkgconf uses when"; \
|
|
echo " PKG_CONFIG_PATH is unset. Without it pkgconf cannot locate any package."; \
|
|
echo " Example: make -f Makefile.lite PKG_DEFAULT_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig ..."; \
|
|
exit 1; \
|
|
fi
|
|
|
|
.PHONY: preflight preflight-system-libdir preflight-system-includedir preflight-pkg-default-path clean
|