forked from ariadne/pkgconf
buildsys: add support for building a profiled executable
parent
d6fb7881d4
commit
1a49758792
|
@ -1,6 +1,7 @@
|
||||||
*.h.in~
|
*.h.in~
|
||||||
*.o
|
*.o
|
||||||
*.og
|
*.og
|
||||||
|
*.op
|
||||||
*.gcno
|
*.gcno
|
||||||
*.gcda
|
*.gcda
|
||||||
*.gcov
|
*.gcov
|
||||||
|
@ -27,5 +28,6 @@ core
|
||||||
/configure
|
/configure
|
||||||
/pkgconf
|
/pkgconf
|
||||||
/pkgconf-gcov
|
/pkgconf-gcov
|
||||||
|
/pkgconf-profile
|
||||||
|
|
||||||
Makefile
|
Makefile
|
||||||
|
|
13
Makefile.in
13
Makefile.in
|
@ -14,6 +14,7 @@ PROG = pkgconf@EXEEXT@
|
||||||
SRCS = main.c cache.c pkg.c bsdstubs.c getopt_long.c fragment.c argvsplit.c fileio.c tuple.c dependency.c queue.c
|
SRCS = main.c cache.c pkg.c bsdstubs.c getopt_long.c fragment.c argvsplit.c fileio.c tuple.c dependency.c queue.c
|
||||||
OBJS = ${SRCS:.c=.o}
|
OBJS = ${SRCS:.c=.o}
|
||||||
GCOV_OBJS = ${SRCS:.c=.og}
|
GCOV_OBJS = ${SRCS:.c=.og}
|
||||||
|
PROF_OBJS = ${SRCS:.c=.op}
|
||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
LDFLAGS = @LDFLAGS@
|
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
|
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
|
||||||
|
@ -47,8 +48,20 @@ gcov-check: $(PROG)-gcov
|
||||||
$(SHELL) tests/run.sh ./$(PROG)-gcov
|
$(SHELL) tests/run.sh ./$(PROG)-gcov
|
||||||
@echo "gcov(1) reporting data should now be generated..."
|
@echo "gcov(1) reporting data should now be generated..."
|
||||||
|
|
||||||
|
$(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..."
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
${CC} ${CFLAGS} -c $< -o $@
|
${CC} ${CFLAGS} -c $< -o $@
|
||||||
|
|
||||||
.c.og:
|
.c.og:
|
||||||
${CC} ${CFLAGS} -fprofile-arcs -ftest-coverage -c $< -o $@
|
${CC} ${CFLAGS} -fprofile-arcs -ftest-coverage -c $< -o $@
|
||||||
|
|
||||||
|
.c.op:
|
||||||
|
${CC} ${CFLAGS} -pg -c $< -o $@
|
||||||
|
|
||||||
|
.SUFFIXES: .og .op
|
||||||
|
|
Loading…
Reference in New Issue