Commit 76182f60 authored by Niels Möller's avatar Niels Möller

Use a separate make rule for m4 preprocessing of assembly files.

parent 26cdf2af
2013-02-06 Niels Möller <nisse@lysator.liu.se>
* config.make.in: Added .s to the suffix list.
* Makefile.in (.asm.s): Use a separate make target for .asm
preprocessing. Include asm.d, which the corresponding
dependencies.
* configure.ac (asm_file_list): Collect assembly files into this
variable.
(asm.d): Make config.status write dependencies for .s files into
asm.d.
* asm.m4: Use changecom to disable m4 quoting. Use divert to
suppress output.
......
......@@ -241,17 +241,15 @@ $(des_headers): desdata.c
des.$(OBJEXT): des.c des.h $(des_headers)
.asm.$(OBJEXT):
$(M4) $(srcdir)/asm.m4 machine.m4 config.m4 \
$< >$*.s
$(COMPILE) $(CCPIC_MAYBE) -c $*.s
echo "$@ : $< $(srcdir)/asm.m4 machine.m4 config.m4" >$@.d
.asm.p$(OBJEXT):
$(M4) $(srcdir)/asm.m4 machine.m4 config.m4 \
$< >$*.s
$(COMPILE) $(SHLIBCFLAGS) -c $*.s -o $@
echo "$@ : $< $(srcdir)/asm.m4 machine.m4 config.m4" >$@.d
.asm.s:
$(M4) $(srcdir)/asm.m4 machine.m4 config.m4 $< >$@T \
&& test -s $@T && mv -f $@T $@
.s.$(OBJEXT):
$(COMPILE) $(CCPIC_MAYBE) -c $<
.s.p$(OBJEXT):
$(COMPILE) $(SHLIBCFLAGS) -c $< -o $@
# Texinfo rules
.texinfo.info:
......@@ -507,5 +505,5 @@ maintainer-clean-here:
tags-here:
etags -o $(srcdir)/TAGS $(srcdir)/*.c $(srcdir)/*.h
DEP_FILES = $(SOURCES:.c=.$(OBJEXT).d) $(SOURCES:.c=.p$(OBJEXT).d)
DEP_FILES = $(SOURCES:.c=.$(OBJEXT).d) $(SOURCES:.c=.p$(OBJEXT).d) asm.d
@DEP_INCLUDE@ $(DEP_FILES)
......@@ -81,7 +81,7 @@ default: all
# compile was broken when .SUFFIXES was moved here from Makefile.in.
.SUFFIXES:
.SUFFIXES: .asm .c .$(OBJEXT) .p$(OBJEXT) .html .dvi .info .exe .pdf .ps .texinfo
.SUFFIXES: .asm .s .c .$(OBJEXT) .p$(OBJEXT) .html .dvi .info .exe .pdf .ps .texinfo
# Disable builtin rule
%$(EXEEXT) : %.c
......
......@@ -235,11 +235,11 @@ if test "x$enable_assembler" = xyes ; then
esac
fi
# echo "enable_assembler: $enable_assembler, asm_path: $asm_path"
asm_file_list=""
if test "x$enable_assembler" = xyes ; then
if test -n "$asm_path"; then
AC_MSG_NOTICE([Looking for assembler files in $asm_path/.])
found=no
for tmp_f in aes-encrypt-internal.asm aes-decrypt-internal.asm \
arcfour-crypt.asm camellia-crypt-internal.asm \
md5-compress.asm memxor.asm \
......@@ -249,17 +249,33 @@ if test "x$enable_assembler" = xyes ; then
# echo "Looking for $srcdir/$asm_path/$tmp_f"
if test -f "$srcdir/$asm_path/$tmp_f"; then
# echo found
found=yes
asm_file_list="$asm_file_list $tmp_f"
AC_CONFIG_LINKS($tmp_f:$asm_path/$tmp_f)
fi
done
if test "$found" = no; then
if test -z "$asm_file_list"; then
enable_assembler=no
AC_MSG_WARN([No assembler files found.])
fi
fi
fi
# Besides getting correct dependencies, the explicit rules also tell
# make that the .s files "ought to exist", so they are preferred over
# .c files.
AC_CONFIG_COMMANDS([asm.d],
[ for f in $asm_file_list
do
case $f in
*.asm)
echo "`basename $f .asm`.s : $f "'$(srcdir)/asm.m4 machine.m4 config.m4'
;;
esac
done > asm.d
],
[ asm_file_list="$asm_file_list" ]
)
LSH_CCPIC
SHLIBCFLAGS="$CCPIC"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment