$NetBSD: patch-ab,v 1.11 2009/05/25 20:56:38 drochner Exp $ --- Makefile.orig 2009-03-26 22:45:08.000000000 +0100 +++ Makefile @@ -40,9 +40,9 @@ endif ifdef ARCH_X86 ASFLAGS += -Icommon/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 -checkasm: tools/checkasm-a.o +checkasm: tools/checkasm-a.lo endif endif @@ -52,44 +52,49 @@ ALTIVECSRC += common/ppc/mc.c common/ppc common/ppc/quant.c common/ppc/deblock.c \ common/ppc/predict.c SRCS += $(ALTIVECSRC) -$(ALTIVECSRC:%.c=%.o): CFLAGS += $(ALTIVECFLAGS) +$(ALTIVECSRC:%.c=%.lo): CFLAGS += $(ALTIVECFLAGS) endif # VIS optims ifeq ($(ARCH),UltraSparc) ASMSRC += common/sparc/pixel.asm -OBJASM = $(ASMSRC:%.asm=%.o) +OBJASM = $(ASMSRC:%.asm=%.lo) endif ifneq ($(HAVE_GETOPT_LONG),1) SRCS += extras/getopt.c endif -OBJS = $(SRCS:%.c=%.o) -OBJCLI = $(SRCCLI:%.c=%.o) +OBJS = $(SRCS:%.c=%.lo) +OBJCLI = $(SRCCLI:%.c=%.lo) DEP = depend .PHONY: all default fprofiled clean distclean install uninstall dox test testclean default: $(DEP) x264$(EXE) -libx264.a: .depend $(OBJS) $(OBJASM) - $(AR) rc libx264.a $(OBJS) $(OBJASM) - $(RANLIB) libx264.a +%.lo: %.c + ${LIBTOOL} --mode=compile ${CC} -c ${CFLAGS} ${PICFLAGS} -o $@ $< + +libx264.la: .depend $(OBJS) $(OBJASM) + ${LIBTOOL} --mode=link \ + ${CC} -o libx264.la -rpath ${PREFIX}/lib -version-info 0 \ + $(OBJS) $(OBJASM) ${LDFLAGS} $(SONAME): .depend $(OBJS) $(OBJASM) $(CC) -shared -o $@ $(OBJS) $(OBJASM) $(SOFLAGS) $(LDFLAGS) -x264$(EXE): $(OBJCLI) libx264.a - $(CC) -o $@ $+ $(LDFLAGS) +x264$(EXE): $(OBJCLI) libx264.la + ${LIBTOOL} --mode=link $(CC) -o $@ $+ $(LDFLAGS) -checkasm: tools/checkasm.o libx264.a - $(CC) -o $@ $+ $(LDFLAGS) +checkasm: tools/checkasm.lo libx264.la + ${LIBTOOL} --mode=link $(CC) -o $@ $+ $(LDFLAGS) -%.o: %.asm - $(AS) $(ASFLAGS) -o $@ $< +%.lo: %.asm + ${LIBTOOL} --mode=compile --tag=CC \ + ./strip_fopt.sh $(AS) $(ASFLAGS) -o $@ $< # delete local/anonymous symbols, so they don't show up in oprofile - -@ $(STRIP) -x $@ + -@ $(STRIP) -x $(@:.lo=.o) .depend: config.mak rm -f .depend @@ -143,21 +148,16 @@ distclean: clean rm -f config.mak config.h x264.pc rm -rf test/ -install: x264$(EXE) $(SONAME) +install: x264$(EXE) libx264.la install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir) install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig install -m 644 x264.h $(DESTDIR)$(includedir) - install -m 644 libx264.a $(DESTDIR)$(libdir) + ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} libx264.la $(DESTDIR)$(libdir) install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig - install x264$(EXE) $(DESTDIR)$(bindir) - $(RANLIB) $(DESTDIR)$(libdir)/libx264.a + ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} x264$(EXE) $(DESTDIR)$(bindir) ifeq ($(SYS),MINGW) $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(bindir)) -else - $(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX)) - $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir)) endif - $(if $(IMPLIBNAME), install -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir)) uninstall: rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(libdir)/libx264.a