openbsd-ports/multimedia/x264/patches/patch-Makefile
ajacoutot 2effdf8b9c Update to x264-20120520.
from Brad (maintainer)
2012-05-25 07:45:33 +00:00

84 lines
2.9 KiB
Plaintext

$OpenBSD: patch-Makefile,v 1.10 2012/05/25 07:45:33 ajacoutot Exp $
--- Makefile.orig Sun May 20 16:45:03 2012
+++ Makefile Sun May 20 20:23:07 2012
@@ -100,7 +100,9 @@ ifdef ARCH_X86
ASFLAGS += -I$(SRCPATH)/common/x86/
SRCS += common/x86/mc-c.c common/x86/predict-c.c
OBJASM = $(ASMSRC:%.asm=%.o)
+SOBJASM = $(ASMSRC:%.asm=%.so)
$(OBJASM): common/x86/x86inc.asm common/x86/x86util.asm
+$(SOBJASM): common/x86/x86inc.asm common/x86/x86util.asm
OBJCHK += tools/checkasm-a.o
endif
endif
@@ -146,8 +148,10 @@ endif
endif
OBJS += $(SRCS:%.c=%.o)
+SOBJS += $(SRCS:%.c=%.so)
OBJCLI += $(SRCCLI:%.c=%.o)
OBJSO += $(SRCSO:%.c=%.o)
+SOBJSO += $(SRCSO:%.c=%.so)
.PHONY: all default fprofiled clean distclean install uninstall lib-static lib-shared cli install-lib-dev install-lib-static install-lib-shared install-cli
@@ -160,8 +164,8 @@ $(LIBX264): .depend $(OBJS) $(OBJASM)
$(AR)$@ $(OBJS) $(OBJASM)
$(if $(RANLIB), $(RANLIB) $@)
-$(SONAME): .depend $(OBJS) $(OBJASM) $(OBJSO)
- $(LD)$@ $(OBJS) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS)
+$(SONAME): .depend $(SOBJS) $(SOBJASM) $(SOBJSO)
+ $(LD)$@ $(SOBJS) $(SOBJASM) $(SOBJSO) $(SOFLAGS) $(LDFLAGS)
ifneq ($(EXE),)
.PHONY: x264 checkasm
@@ -170,7 +174,7 @@ checkasm: checkasm$(EXE)
endif
x264$(EXE): .depend $(OBJCLI) $(CLI_LIBX264)
- $(LD)$@ $(OBJCLI) $(CLI_LIBX264) $(LDFLAGSCLI) $(LDFLAGS)
+ $(LD)$@ $(OBJCLI) -L. -lx264 $(LDFLAGSCLI) $(LDFLAGS)
checkasm$(EXE): .depend $(OBJCHK) $(LIBX264)
$(LD)$@ $(OBJCHK) $(LIBX264) $(LDFLAGS)
@@ -181,10 +185,21 @@ $(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK): .depen
$(AS) $(ASFLAGS) -o $@ $<
-@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
+%.so: %.asm
+ $(AS) $(ASFLAGS) -DPIC -o $@ $<
+ -@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
+
%.o: %.S
$(AS) $(ASFLAGS) -o $@ $<
-@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
+%.so: %.S
+ $(AS) $(ASFLAGS) -DPIC -o $@ $<
+ -@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
+
+%.so: %.c
+ $(CC) $(CFLAGS) -fPIC -c -o $@ $<
+
%.dll.o: %.rc x264.h
$(RC) $(RCFLAGS)$@ -DDLL $<
@@ -230,7 +245,7 @@ fprofiled:
endif
clean:
- rm -f $(OBJS) $(OBJASM) $(OBJCLI) $(OBJSO) $(SONAME) *.a *.lib *.exp *.pdb x264 x264.exe .depend TAGS
+ rm -f $(OBJS) $(SOBJS) $(OBJASM) $(SOBJASM) $(OBJCLI) $(OBJSO) $(SOBJSO) $(SONAME) *.a *.lib *.exp *.pdb x264 x264.exe .depend TAGS
rm -f checkasm checkasm.exe $(OBJCHK)
rm -f $(SRC2:%.c=%.gcda) $(SRC2:%.c=%.gcno) *.dyn pgopti.dpi pgopti.dpi.lock
@@ -259,7 +274,6 @@ ifneq ($(IMPLIBNAME),)
install -m 755 $(SONAME) $(DESTDIR)$(bindir)
install -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir)
else ifneq ($(SONAME),)
- ln -f -s $(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX)
install -m 755 $(SONAME) $(DESTDIR)$(libdir)
endif