12345678910111213141516171819202122232425262728293031323334353637 |
- #!/bin/bash
-
- cd $(dirname "$0")
- echo "Generating $(pwd)/Makefile.am"
-
- progs="$(echo *.c | sed -e 's/\.c / /g' -e 's/\.c$//')"
- cat << __EOF__ > Makefile.am
- TESTS = $progs
- check_PROGRAMS = $progs
- noinst_HEADERS = asmsh_check.h
- EXTRA_DIST = samples
- SUBDIRS = samples
-
- TESTLIB_NAME=libcheck_asmsh.a
- TESTLIB=\$(top_builddir)/\$(TESTLIB_NAME)
- CHILD_NAME=child
- CHILD=\$(top_builddir)/\$(CHILD_NAME)
- CHILD_OBJNAME=child_bin.o
- CHILD_OBJ=\$(top_builddir)/\$(CHILD_OBJNAME)
-
- BUILT_SOURCES = \$(CHILD)
-
- clean-local:
- -rm -rf *.gcov *.gcda *.gcno
-
- __EOF__
-
- for p in $progs
- do
- cat << __EOF__ >> Makefile.am
- ${p}_SOURCES = ${p}.c
- ${p}_CFLAGS = @CHECK_CFLAGS@ --coverage
- ${p}_LDFLAGS = @LDFLAGS@
- ${p}_LDADD = \$(TESTLIB) \$(CHILD_OBJ) @CHECK_LIBS@ -ldl -lgcov
- __EOF__
-
- done
|