2012-07-24 20:24:52 +00:00
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
|
|
|
bindir = @bindir@
|
2013-06-29 16:18:07 +00:00
|
|
|
srcdir = @srcdir@
|
2012-07-24 20:24:52 +00:00
|
|
|
libdir = @libdir@
|
|
|
|
datarootdir = @datarootdir@
|
|
|
|
datadir = @datadir@
|
|
|
|
includedir = @includedir@
|
|
|
|
system_includedir = @SYSTEM_INCLUDEDIR@
|
|
|
|
system_libdir = @SYSTEM_LIBDIR@
|
|
|
|
pkgconfigdir = @PKGCONFIGDIR@
|
|
|
|
|
|
|
|
CC = @CC@
|
2014-02-28 14:04:11 +00:00
|
|
|
INSTALL = @INSTALL@
|
2012-07-24 20:24:52 +00:00
|
|
|
PROG = pkgconf@EXEEXT@
|
2013-02-25 23:36:09 +00:00
|
|
|
SRCS = main.c cache.c pkg.c bsdstubs.c getopt_long.c fragment.c argvsplit.c fileio.c tuple.c dependency.c queue.c
|
2012-07-24 20:24:52 +00:00
|
|
|
OBJS = ${SRCS:.c=.o}
|
2013-02-24 12:26:56 +00:00
|
|
|
GCOV_OBJS = ${SRCS:.c=.og}
|
2013-03-01 18:17:16 +00:00
|
|
|
PROF_OBJS = ${SRCS:.c=.op}
|
2012-07-24 20:24:52 +00:00
|
|
|
CFLAGS = @CFLAGS@
|
|
|
|
LDFLAGS = @LDFLAGS@
|
|
|
|
CFLAGS += -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\" -DPKG_DEFAULT_PATH=\"${pkgconfigdir}\" -DSYSTEM_INCLUDEDIR=\"${system_includedir}\" -DSYSTEM_LIBDIR=\"${system_libdir}\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2
|
2013-12-27 11:13:55 +00:00
|
|
|
MANDIR = ${datarootdir}/man/man1
|
2011-07-25 02:03:17 +00:00
|
|
|
|
2012-07-23 19:49:22 +00:00
|
|
|
all: build
|
|
|
|
build: ${PROG}
|
2011-07-25 02:03:17 +00:00
|
|
|
|
2012-07-23 19:49:22 +00:00
|
|
|
clean:
|
2013-02-24 14:22:35 +00:00
|
|
|
rm -f *.o *.og *.gcda *.gcno *.gcov
|
|
|
|
rm -f $(PROG)
|
2011-07-25 05:06:37 +00:00
|
|
|
|
2012-07-23 19:49:22 +00:00
|
|
|
install:
|
2012-09-09 09:11:36 +00:00
|
|
|
mkdir -p $(DESTDIR)$(bindir)
|
2014-02-28 14:04:11 +00:00
|
|
|
@INSTALL_PROGRAM@ $(PROG) $(DESTDIR)$(bindir)/$(PROG)
|
2012-09-09 09:11:36 +00:00
|
|
|
mkdir -p $(DESTDIR)$(datarootdir)/aclocal
|
2014-02-28 14:04:11 +00:00
|
|
|
@INSTALL_DATA@ $(srcdir)/pkg.m4 $(DESTDIR)$(datarootdir)/aclocal/pkg.m4
|
2013-12-27 11:13:55 +00:00
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)
|
2014-02-28 14:04:11 +00:00
|
|
|
@INSTALL_DATA@ $(srcdir)/pkgconf.1 $(DESTDIR)$(MANDIR)/pkgconf.1
|
2012-04-30 05:43:46 +00:00
|
|
|
|
2012-05-03 06:50:57 +00:00
|
|
|
check: $(PROG)
|
|
|
|
$(SHELL) tests/run.sh ./$(PROG)
|
|
|
|
|
2012-05-07 02:18:03 +00:00
|
|
|
valgrind-check: $(PROG)
|
|
|
|
$(SHELL) tests/run.sh 'valgrind --leak-check=full --show-reachable=yes ./$(PROG)'
|
|
|
|
|
2013-06-29 16:18:07 +00:00
|
|
|
%.o: $(srcdir)/%.c
|
|
|
|
$(CC) -c $(CFLAGS) -I. $(CPPFLAGS) $< -o $@
|
|
|
|
|
2012-07-23 19:49:22 +00:00
|
|
|
$(PROG): $(OBJS)
|
2012-07-24 06:10:35 +00:00
|
|
|
${CC} ${LDFLAGS} -o $@ $(OBJS)
|
2012-07-23 19:49:22 +00:00
|
|
|
|
2013-02-24 12:26:56 +00:00
|
|
|
$(PROG)-gcov: $(GCOV_OBJS)
|
|
|
|
${CC} ${LDFLAGS} -fprofile-arcs -ftest-coverage -o $@ $(GCOV_OBJS)
|
|
|
|
|
|
|
|
gcov-check: $(PROG)-gcov
|
|
|
|
$(SHELL) tests/run.sh ./$(PROG)-gcov
|
|
|
|
@echo "gcov(1) reporting data should now be generated..."
|
|
|
|
|
2013-03-01 18:17:16 +00:00
|
|
|
$(PROG)-profile: $(PROF_OBJS)
|
|
|
|
${CC} ${LDFLAGS} -pg -o $@ $(PROF_OBJS)
|
|
|
|
|
|
|
|
profile-check: $(PROG)-profile
|
|
|
|
$(SHELL) tests/run.sh ./$(PROG)-profile
|
|
|
|
@echo "gprof(1) reporting data should now be generated..."
|
|
|
|
|
2012-07-23 19:49:22 +00:00
|
|
|
.c.o:
|
|
|
|
${CC} ${CFLAGS} -c $< -o $@
|
2013-02-24 12:26:56 +00:00
|
|
|
|
|
|
|
.c.og:
|
|
|
|
${CC} ${CFLAGS} -fprofile-arcs -ftest-coverage -c $< -o $@
|
2013-03-01 18:17:16 +00:00
|
|
|
|
|
|
|
.c.op:
|
|
|
|
${CC} ${CFLAGS} -pg -c $< -o $@
|
|
|
|
|
|
|
|
.SUFFIXES: .og .op
|