Add support for arm64 assembly source files in mktargets.py

Disambiguate between arm and arm64 sources by checking the directory
names.

The arm assembly sources can be assembled on arm64 and vice versa
without any effect since all of the implementation is hidden behind
the HAVE_NEON and HAVE_NEON_AARCH64 defines, but it still is cleaner
to not build extra empty object files than to build all *.S files
on all arm variants. (The iOS project files build all of the arm
assembly files, regardless of the target architecture, since
individual files can't easily be excluded based on the target
architecture there.)
This commit is contained in:
Martin Storsjö 2014-04-23 10:49:30 +03:00
parent 764f787dcb
commit c8901c7dcd

View File

@ -112,6 +112,14 @@ cpp = sorted(cpp, key=lambda s: s.lower())
asm = sorted(asm, key=lambda s: s.lower())
cfiles = sorted(cfiles, key=lambda s: s.lower())
sfiles = sorted(sfiles, key=lambda s: s.lower())
armfiles = []
arm64files = []
for file in sfiles:
c = file.split('/')
if 'arm64' in c:
arm64files.append(file)
elif 'arm' in c:
armfiles.append(file)
@ -140,15 +148,24 @@ if len(asm) > 0:
f.write("%s_OBJS += $(%s_ASM_SRCS:.asm=.$(OBJ))\n"%(PREFIX, PREFIX))
f.write("endif\n\n")
if len(sfiles) > 0:
if len(armfiles) > 0:
f.write("ifeq ($(ASM_ARCH), arm)\n")
f.write("%s_ASM_ARM_SRCS=\\\n"%(PREFIX))
for c in sfiles:
for c in armfiles:
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
f.write("\n")
f.write("%s_OBJS += $(%s_ASM_ARM_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
f.write("endif\n\n")
if len(arm64files) > 0:
f.write("ifeq ($(ASM_ARCH), arm64)\n")
f.write("%s_ASM_ARM64_SRCS=\\\n"%(PREFIX))
for c in arm64files:
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
f.write("\n")
f.write("%s_OBJS += $(%s_ASM_ARM64_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
f.write("endif\n\n")
f.write("OBJS += $(%s_OBJS)\n"%PREFIX)
write_cpp_rule_pattern(f)