1# Copyright (c) 2019 William Pitcock <nenolod@dereferenced.org> 2# 3# Permission to use, copy, modify, and/or distribute this software for any 4# purpose with or without fee is hereby granted, provided that the above 5# copyright notice and this permission notice appear in all copies. 6# 7# This software is provided 'as is' and without any warranty, express or 8# implied. In no event shall the authors be liable for any damages arising 9# from the use of this software. 10 11# pkgconf-lite is a staticly-linked version of pkgconf that does not include 12# all features, notably it does not include cross-compile support and MSVC 13# support. It does not include the libpkgconf library. 14 15LIBPKGCONF_SRCS = \ 16 libpkgconf/argvsplit.c \ 17 libpkgconf/audit.c \ 18 libpkgconf/bsdstubs.c \ 19 libpkgconf/buffer.c \ 20 libpkgconf/bufferset.c \ 21 libpkgconf/bytecode.c \ 22 libpkgconf/cache.c \ 23 libpkgconf/client.c \ 24 libpkgconf/dependency.c \ 25 libpkgconf/fileio.c \ 26 libpkgconf/fragment.c \ 27 libpkgconf/license.c \ 28 libpkgconf/output.c \ 29 libpkgconf/parser.c \ 30 libpkgconf/path.c \ 31 libpkgconf/personality.c \ 32 libpkgconf/pkg.c \ 33 libpkgconf/queue.c \ 34 libpkgconf/tuple.c \ 35 libpkgconf/variable.c \ 36 libpkgconf/version.c \ 37 38CLI_CORE_SRCS = \ 39 cli/getopt_long.c \ 40 cli/core.c 41 42CLI_MAIN_SRCS = \ 43 cli/main.c 44 45PKGCONF_SRCS = ${LIBPKGCONF_SRCS} ${CLI_CORE_SRCS} ${CLI_MAIN_SRCS} 46PKGCONF_OBJS = ${PKGCONF_SRCS:.c=.o} 47 48TEST_RUNNER_MAIN_SRCS = \ 49 tests/test-runner.c 50 51TEST_RUNNER_SRCS = ${LIBPKGCONF_SRCS} ${CLI_CORE_SRCS} ${TEST_RUNNER_MAIN_SRCS} 52TEST_RUNNER_OBJS = ${TEST_RUNNER_SRCS:.c=.o} 53 54CFLAGS += -Wno-unused-variable -Wno-unused-parameter 55CPPFLAGS = -D_DEFAULT_SOURCE -DPKGCONF_LITE -I. -Ilibpkgconf -Icli -DSYSTEM_LIBDIR=\"${SYSTEM_LIBDIR}\" -DSYSTEM_INCLUDEDIR=\"${SYSTEM_INCLUDEDIR}\" -DPKG_DEFAULT_PATH=\"${PKG_DEFAULT_PATH}\" 56STRIP = strip 57 58all: pkgconf-lite 59 60libpkgconf/config.h: 61 @echo '#define PACKAGE_NAME "pkgconf-lite"' >> $@ 62 @echo '#define PACKAGE_BUGREPORT "https://git.dereferenced.org/pkgconf/pkgconf/issues"' >> $@ 63 @echo '#define PACKAGE_VERSION "2.9.93"' >> $@ 64 @echo '#define PACKAGE PACKAGE_NAME " " PACKAGE_VERSION' >> $@ 65 66pkgconf-lite: preflight libpkgconf/config.h ${PKGCONF_OBJS} 67 ${CC} ${CFLAGS} ${STATIC} -o $@ ${PKGCONF_OBJS} 68 ${STRIP} $@ 69 70test-runner-lite: preflight libpkgconf/config.h ${TEST_RUNNER_OBJS} 71 ${CC} ${CFLAGS} ${STATIC} -o $@ ${TEST_RUNNER_OBJS} 72 ${STRIP} $@ 73 74check: test-runner-lite 75 ./test-runner-lite --test-fixtures ./tests ./t/basic 76 ./test-runner-lite --test-fixtures ./tests ./t/link-abi 77 ./test-runner-lite --test-fixtures ./tests ./t/ordering 78 ./test-runner-lite --test-fixtures ./tests ./t/parser 79 ./test-runner-lite --test-fixtures ./tests ./t/personality 80 ./test-runner-lite --test-fixtures ./tests ./t/sbom 81 ./test-runner-lite --test-fixtures ./tests ./t/solver 82 ./test-runner-lite --test-fixtures ./tests ./t/sysroot 83 ./test-runner-lite --test-fixtures ./tests ./t/tuple 84 85clean: 86 rm -f libpkgconf/config.h 87 rm -f ${PKGCONF_OBJS} 88 rm -f pkgconf-lite 89 rm -f test-runner-lite 90 91preflight: preflight-system-libdir preflight-system-includedir preflight-pkg-default-path 92 93preflight-system-libdir: 94 @if test -z "${SYSTEM_LIBDIR}"; then \ 95 echo "SYSTEM_LIBDIR is not set."; \ 96 echo " Set it to the compiler's default library directory (e.g. /usr/lib)."; \ 97 echo " pkgconf strips this path from --libs output so a package does not emit"; \ 98 echo " a redundant -L for a directory already on the linker's search path."; \ 99 echo " Example: make -f Makefile.lite SYSTEM_LIBDIR=/usr/lib ..."; \ 100 exit 1; \ 101 fi 102 103preflight-system-includedir: 104 @if test -z "${SYSTEM_INCLUDEDIR}"; then \ 105 echo "SYSTEM_INCLUDEDIR is not set."; \ 106 echo " Set it to the compiler's default include directory (e.g. /usr/include)."; \ 107 echo " pkgconf strips this path from --cflags output so a package does not emit"; \ 108 echo " a redundant -I for a directory already on the compiler's search path."; \ 109 echo " Example: make -f Makefile.lite SYSTEM_INCLUDEDIR=/usr/include ..."; \ 110 exit 1; \ 111 fi 112 113preflight-pkg-default-path: 114 @if test -z "${PKG_DEFAULT_PATH}"; then \ 115 echo "PKG_DEFAULT_PATH is not set."; \ 116 echo " Set it to the colon-separated (semicolon on Windows) list of directories where this"; \ 117 echo " system installs .pc files; it is the default search path pkgconf uses when"; \ 118 echo " PKG_CONFIG_PATH is unset. Without it pkgconf cannot locate any package."; \ 119 echo " Example: make -f Makefile.lite PKG_DEFAULT_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig ..."; \ 120 exit 1; \ 121 fi 122 123.PHONY: preflight preflight-system-libdir preflight-system-includedir preflight-pkg-default-path clean 124