1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #!/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)
-
- BUILT_SOURCES = \$(CHILD)
-
- clean-local:
- -rm -rf *.gcov *.gcda *.gcno
-
- \$(CHILD):
- make -C \$(top_builddir) \$(CHILD_NAME)
-
- \$(TESTLIB):
- make -C \$(top_builddir) \$(TESTLIB_NAME)
-
- .PHONY: \$(TESTLIB) \$(CHILD)
- __EOF__
-
- for p in $progs
- do
- cat << __EOF__ >> Makefile.am
- ${p}_SOURCES = ${p}.c
- ${p}_CFLAGS = @CHECK_CFLAGS@ -fprofile-arcs -ftest-coverage
- ${p}_LDADD = \$(TESTLIB) @CHECK_LIBS@
- __EOF__
-
- done
|