Add simple check target.

This will test the coz library and make sure it is linkable and
the resulting binary is runnable.

This test detects a problem with GCC 6 when combined with clang that
is missing with 4.9.
This commit is contained in:
Petter Reinholdtsen 2016-08-10 06:14:00 +00:00
parent 54c526d5c7
commit b6c844c6ec
2 changed files with 10 additions and 0 deletions

View File

@ -6,6 +6,9 @@ include $(ROOT)/common.mk
bench::
@for dir in benchmarks ; do make -C $$dir $@; done
check::
make -C libcoz $@
install::
$(INSTALL) -D coz $(DESTDIR)$(bindir)/coz
$(INSTALL) -D include/coz.h $(DESTDIR)$(incdir)/coz.h

View File

@ -7,5 +7,12 @@ PREREQS := $(ROOT)/deps/ccutil $(ROOT)/deps/libelfin
include $(ROOT)/common.mk
check:: libcoz.so
printf "int main(int argc, char *argv[])\n{\nreturn (0);\n}\n" > x.c
gcc -Wl,-rpath,`pwd` -o x x.c libcoz.so -ldl || ( $(RM) x x.c ; exit 1)
./x
if grep -q time= profile.coz; then echo success: coz profiler ran as it should.; fi
$(RM) -f x.c x profile.coz
install::
$(INSTALL) -D $(ROOT)/libcoz/libcoz.so $(DESTDIR)$(pkglibdir)/libcoz.so