Merge pull request #63 from petterreinholdtsen/selftest

Add simple check target.
This commit is contained in:
Charlie Curtsinger 2016-08-15 10:54:34 -05:00 committed by GitHub
commit 3818ed2e7e
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