$NetBSD$ --- Makefile.orig 2010-02-02 06:45:06.000000000 +0900 +++ Makefile 2011-01-10 10:18:47.000000000 +0900 @@ -108,20 +108,21 @@ endif OBJS = $(SRCS:%.c=%.o) +OBJSLO = $(SRCS:%.c=%.lo) OBJCLI = $(SRCCLI:%.c=%.o) OBJSO = $(SRCSO:%.c=%.o) DEP = depend .PHONY: all default fprofiled clean distclean install uninstall dox test testclean -default: $(DEP) x264$(EXE) +default: $(DEP) x264$(EXE) libx264.la libx264.a: .depend $(OBJS) $(OBJASM) $(AR) rc libx264.a $(OBJS) $(OBJASM) $(RANLIB) libx264.a $(SONAME): .depend $(OBJS) $(OBJASM) $(OBJSO) - $(CC) -shared -o $@ $(OBJS) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS) + ${LIBTOOL} --mode=link $(CC) -shared -o $@ $(OBJSLO) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS) x264$(EXE): $(OBJCLI) libx264.a $(CC) -o $@ $+ $(LDFLAGS) $(LDFLAGSCLI) @@ -129,6 +130,17 @@ checkasm: tools/checkasm.o libx264.a $(CC) -o $@ $+ $(LDFLAGS) +libx264.la: $(OBJSLO) + ${LIBTOOL} --mode=link $(CC) -o $@ $(LDFLAGS) $< + +%.o: %.c + echo $@ + ${LIBTOOL} --mode=compile $(CC) -c $(CFLAGS) $< + +#%.lo: %.c +# echo $@ +# ${LIBTOOL} --mode=compile $(CC) -o $?.o $(CFLAGS) $< + %.o: %.asm $(AS) $(ASFLAGS) -o $@ $< -@ $(STRIP) -x $@ # delete local/anonymous symbols, so they don't show up in oprofile @@ -193,7 +205,7 @@ 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 install -m 644 libx264.a $(DESTDIR)$(libdir) install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig install x264$(EXE) $(DESTDIR)$(bindir) $(RANLIB) $(DESTDIR)$(libdir)/libx264.a @@ -201,9 +213,9 @@ $(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)) + $(if $(SONAME), ${LIBTOOL} --mode=install install -m 755 $(SONAME) $(DESTDIR)$(libdir)) endif - $(if $(IMPLIBNAME), install -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir)) + $(if $(IMPLIBNAME), ${LIBTOOL} --mode=install install -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir)) uninstall: rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(libdir)/libx264.a