diff --git a/asn1c/tests/check-assembly.sh b/asn1c/tests/check-assembly.sh index fc371a23..90e35867 100755 --- a/asn1c/tests/check-assembly.sh +++ b/asn1c/tests/check-assembly.sh @@ -49,14 +49,11 @@ ln -fns "../${source_full}" "${testdir}" asn_module=$(echo "${abs_top_srcdir}/tests/${testno}"-*.asn1) -# Create a BSD or GNU Makefile for the project. -produce_makefile() { - local make_type=$1 - local make_file="$testdir/${make_type}makefile" +AUTOGENERATED="# This file is autogenerated by $0 ${source_full} ${AFLAGS}" -# 1/3 part of the Makefile. -cat > "${make_file}" < "${testdir}/Makefile.targets" +${AUTOGENERATED} COMMON_FLAGS= -I. -I${abs_top_srcdir}/skeletons CFLAGS = \${COMMON_FLAGS} ${CFLAGS:-} -g -O0 @@ -66,21 +63,6 @@ LDFLAGS = ${LDFLAGS:-} CC ?= ${CC} -PREAMBLE - -# 2/3 part of the Makefile. -if [ ${make_type} = "BSD" ]; then - cat >> ${make_file} <<-OBJECTS - SRCS!=find . -name \*.c - OBJS=\${SRCS:.c=.o} - OBJECTS -else - echo 'OBJS=$(patsubst %.c,%.o,$(wildcard *.c))' >> ${make_file} -fi - -# 3/3 part of the Makefile. -cat >> "${make_file}" <> ${make_file} + ${AUTOGENERATED} + SRCS!=find . -name \*.c + OBJS=\${SRCS:.c=.o} + .sinclude Makefile.targets + OBJECTS + else + cat <<-OBJECTS >> ${make_file} + ${AUTOGENERATED} + OBJS=\$(patsubst %.c,%.o,\$(wildcard *.c)) + -include Makefile.targets + OBJECTS + fi + } -produce_makefile BSD -produce_makefile GNU +produce_specific_makefile BSD +produce_specific_makefile GNU # Perform building and checking ${TEST_DRIVER} make -C "$testdir" check