Files
2016-01-21 23:42:40 +01:00

104 lines
3.4 KiB
Plaintext

$NetBSD: patch-ab,v 1.22 2015/07/18 11:08:22 adam Exp $
--- Makefile.orig 2015-07-17 20:45:05.000000000 +0000
+++ Makefile
@@ -99,9 +99,9 @@ endif
ifdef ARCH_X86
SRCS += common/x86/mc-c.c common/x86/predict-c.c
-OBJASM = $(ASMSRC:%.asm=%.o)
+OBJASM = $(ASMSRC:%.asm=%.lo)
$(OBJASM): common/x86/x86inc.asm common/x86/x86util.asm
-OBJCHK += tools/checkasm-a.o
+OBJCHK += tools/checkasm-a.lo
endif
endif
@@ -121,7 +121,7 @@ ASMSRC += common/arm/cpu-a.S common/arm/
common/arm/dct-a.S common/arm/quant-a.S common/arm/deblock-a.S \
common/arm/predict-a.S
SRCS += common/arm/mc-c.c common/arm/predict-c.c
-OBJASM = $(ASMSRC:%.S=%.o)
+OBJASM = $(ASMSRC:%.S=%.lo)
endif
endif
@@ -162,20 +162,23 @@ GENERATED += common/oclobj.h
SRCS += common/opencl.c encoder/slicetype-cl.c
endif
-OBJS += $(SRCS:%.c=%.o)
-OBJCLI += $(SRCCLI:%.c=%.o)
+OBJS += $(SRCS:%.c=%.lo)
+OBJCLI += $(SRCCLI:%.c=%.lo)
OBJSO += $(SRCSO:%.c=%.o)
.PHONY: all default fprofiled clean distclean install install-* uninstall cli lib-* etags
+%.lo: %.c
+ ${LIBTOOL} --mode=compile ${CC} -c ${CFLAGS} ${PICFLAGS} -o $@ $<
+
cli: x264$(EXE)
-lib-static: $(LIBX264)
+lib-static: libx264.la
lib-shared: $(SONAME)
-$(LIBX264): $(GENERATED) .depend $(OBJS) $(OBJASM)
- rm -f $(LIBX264)
- $(AR)$@ $(OBJS) $(OBJASM)
- $(if $(RANLIB), $(RANLIB) $@)
+libx264.la: $(GENERATED) .depend $(OBJS) $(OBJASM)
+ ${LIBTOOL} --mode=link \
+ ${CC} -o libx264.la -rpath ${PREFIX}/lib -version-info 0 \
+ $(OBJS) $(OBJASM) ${LDFLAGS}
$(SONAME): $(GENERATED) .depend $(OBJS) $(OBJASM) $(OBJSO)
$(LD)$@ $(OBJS) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS)
@@ -187,20 +190,19 @@ checkasm: checkasm$(EXE)
example: example$(EXE)
endif
-x264$(EXE): $(GENERATED) .depend $(OBJCLI) $(CLI_LIBX264)
- $(LD)$@ $(OBJCLI) $(CLI_LIBX264) $(LDFLAGSCLI) $(LDFLAGS)
+x264$(EXE): $(GENERATED) .depend $(OBJCLI) libx264.la
+ ${LIBTOOL} --mode=link $(LD)$@ $(OBJCLI) libx264.la $(LDFLAGSCLI) $(LDFLAGS)
-checkasm$(EXE): $(GENERATED) .depend $(OBJCHK) $(LIBX264)
- $(LD)$@ $(OBJCHK) $(LIBX264) $(LDFLAGS)
+checkasm$(EXE): $(GENERATED) .depend $(OBJCHK) libx264.la
+ ${LIBTOOL} --mode=link $(LD)$@ $+ $(LDFLAGS)
example$(EXE): $(GENERATED) .depend $(OBJEXAMPLE) $(LIBX264)
$(LD)$@ $(OBJEXAMPLE) $(LIBX264) $(LDFLAGS)
$(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK) $(OBJEXAMPLE): .depend
-%.o: %.asm common/x86/x86inc.asm common/x86/x86util.asm
- $(AS) $(ASFLAGS) -o $@ $<
- -@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
+%.lo: %.asm common/x86/x86inc.asm common/x86/x86util.asm
+ ${LIBTOOL} --mode=compile --tag=CC ./strip_fopt.sh $(AS) $(ASFLAGS) -o $@ $<
%.o: %.S
$(AS) $(ASFLAGS) -o $@ $<
@@ -270,8 +272,7 @@ distclean: clean
rm -f config.mak x264_config.h config.h config.log x264.pc x264.def conftest*
install-cli: cli
- $(INSTALL) -d $(DESTDIR)$(bindir)
- $(INSTALL) x264$(EXE) $(DESTDIR)$(bindir)
+ ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} x264 $(DESTDIR)$(bindir)/x264
install-lib-dev:
$(INSTALL) -d $(DESTDIR)$(includedir)
@@ -282,8 +283,7 @@ install-lib-dev:
$(INSTALL) -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
install-lib-static: lib-static install-lib-dev
- $(INSTALL) -m 644 $(LIBX264) $(DESTDIR)$(libdir)
- $(if $(RANLIB), $(RANLIB) $(DESTDIR)$(libdir)/$(LIBX264))
+ ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} libx264.la $(DESTDIR)$(libdir)
install-lib-shared: lib-shared install-lib-dev
ifneq ($(IMPLIBNAME),)