[x264-devel] [PATCH 31/32] Duplicate checkasm targets

Vittorio Giovara vittorio.giovara at gmail.com
Fri Jan 20 15:20:56 CET 2017


Each bitdepth needs different compilation rules, so split the
main checkasm target in two executables.
---
 Makefile       | 35 +++++++++++++++++++++++++----------
 tools/api.list |  3 +++
 2 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index b1844f0..b249341 100644
--- a/Makefile
+++ b/Makefile
@@ -35,14 +35,14 @@ SRCCLI = x264.c input/input.c input/timecode.c input/raw.c input/y4m.c \
 
 SRCCLIBD = filters/video/depth.c filters/video/cache.c
 
+SRCCHK = tools/checkasm.c
+
 SRCSO =
 
 OBJS =
 OBJSO =
 OBJCLI =
 
-OBJCHK = tools/checkasm.o
-
 OBJEXAMPLE = example.o
 
 CONFIG := $(shell cat config.h)
@@ -114,7 +114,7 @@ OBJASM += $(ASMSRC:%.asm=10bit/%.o) $(ASMSRC10:%.asm=10bit/%.o)
 endif
 
 $(OBJASM): common/x86/x86inc.asm common/x86/x86util.asm
-OBJCHK += tools/checkasm-a.o
+SRCCHK += tools/checkasm-a.c
 endif
 endif
 
@@ -142,7 +142,7 @@ ifneq ($(findstring HAVE_BITDEPTH10, $(CONFIG)),)
 OBJASM += $(ASMSRC:%.S=10bit/%.o)
 endif
 
-OBJCHK += tools/checkasm-arm.o
+SRCCHK += tools/checkasm-arm.c
 endif
 endif
 
@@ -168,7 +168,7 @@ ifneq ($(findstring HAVE_BITDEPTH10, $(CONFIG)),)
 OBJASM += $(ASMSRC:%.S=10bit/%.o)
 endif
 
-OBJCHK += tools/checkasm-aarch64.o
+SRCCHK += tools/checkasm-aarch64.c
 endif
 endif
 
@@ -214,10 +214,13 @@ OBJSO  += $(SRCSO:%.c=%.o)
 ifneq ($(findstring HAVE_BITDEPTH8, $(CONFIG)),)
 OBJS += $(SRCS:%.c=8bit/%.o)
 OBJCLI += $(SRCCLIBD:%.c=8bit/%.o)
+OBJCHK8 = $(SRCCHK:%.c=8bit/%.o)
 endif
 ifneq ($(findstring HAVE_BITDEPTH10, $(CONFIG)),)
 OBJS += $(SRCS:%.c=10bit/%.o)
 OBJCLI += $(SRCCLIBD:%.c=10bit/%.o)
+$(info ${SRCCHK})
+OBJCHK10 = $(SRCCHK:%.c=10bit/%.o)
 endif
 
 .PHONY: all default fprofiled clean distclean install install-* uninstall cli lib-* etags
@@ -235,22 +238,34 @@ $(SONAME): $(GENERATED) .depend $(OBJS) $(OBJASM) $(OBJSO)
 	$(LD)$@ $(OBJS) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS)
 
 ifneq ($(EXE),)
-.PHONY: x264 checkasm example
+.PHONY: x264 checkasm8 checkasm10 example
 x264: x264$(EXE)
-checkasm: checkasm$(EXE)
+ifneq ($(findstring HAVE_BITDEPTH8, $(CONFIG)),)
+checkasm8: checkasm8$(EXE)
+endif
+ifneq ($(findstring HAVE_BITDEPTH10, $(CONFIG)),)
+checkasm10: checkasm10$(EXE)
+endif
 example: example$(EXE)
 endif
 
 x264$(EXE): $(GENERATED) .depend $(OBJCLI) $(CLI_LIBX264)
 	$(LD)$@ $(OBJCLI) $(CLI_LIBX264) $(LDFLAGSCLI) $(LDFLAGS)
 
-checkasm$(EXE): $(GENERATED) .depend $(OBJCHK) $(LIBX264)
-	$(LD)$@ $(OBJCHK) $(LIBX264) $(LDFLAGS)
+ifneq ($(findstring HAVE_BITDEPTH8, $(CONFIG)),)
+checkasm8$(EXE): $(GENERATED) .depend $(OBJCHK8) $(LIBX264)
+	$(LD)$@ $(OBJCHK8) $(LIBX264) $(LDFLAGS)
+endif
+
+ifneq ($(findstring HAVE_BITDEPTH10, $(CONFIG)),)
+checkasm10$(EXE): $(GENERATED) .depend $(OBJCHK10) $(LIBX264)
+	$(LD)$@ $(OBJCHK10) $(LIBX264) $(LDFLAGS)
+endif
 
 example$(EXE): $(GENERATED) .depend $(OBJEXAMPLE) $(LIBX264)
 	$(LD)$@ $(OBJEXAMPLE) $(LIBX264) $(LDFLAGS)
 
-$(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK) $(OBJEXAMPLE): .depend
+$(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK8) $(OBJCHK10) $(OBJEXAMPLE): .depend
 
 %.o: %.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
diff --git a/tools/api.list b/tools/api.list
index 76c7303..114609b 100644
--- a/tools/api.list
+++ b/tools/api.list
@@ -70,6 +70,8 @@ cavlc_mvd
 cavlc_partition_luma_residual
 cavlc_qp_delta
 check_encapsulated_buffer
+checkasm_call
+checkasm_stack_clobber
 chroma_size_cabac
 chroma_size_cavlc
 coeff0_token
@@ -408,6 +410,7 @@ sps_init
 sps_init_reconfigurable
 sps_write
 ssim
+stack_pagealign
 strcat_filename
 subpartition_size_cabac
 subpartition_size_cavlc
-- 
2.10.0



More information about the x264-devel mailing list