1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
$NetBSD: patch-ab,v 1.15 2012/01/09 17:04:03 drochner Exp $
--- Makefile.orig 2011-12-07 21:45:03.000000000 +0000
+++ Makefile
@@ -88,9 +88,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
-OBJCHK += tools/checkasm-a.o
+OBJCHK += tools/checkasm-a.lo
endif
endif
@@ -110,7 +110,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
@@ -118,7 +118,7 @@ endif
ifeq ($(ARCH),UltraSPARC)
ifeq ($(findstring HIGH_BIT_DEPTH, $(CONFIG)),)
ASMSRC += common/sparc/pixel.asm
-OBJASM = $(ASMSRC:%.asm=%.o)
+OBJASM = $(ASMSRC:%.asm=%.lo)
endif
endif
@@ -132,8 +132,8 @@ SRCSO += x264dll.c
endif
endif
-OBJS = $(SRCS:%.c=%.o)
-OBJCLI = $(SRCCLI:%.c=%.o)
+OBJS = $(SRCS:%.c=%.lo)
+OBJCLI = $(SRCCLI:%.c=%.lo)
OBJSO = $(SRCSO:%.c=%.o)
DEP = depend
@@ -141,14 +141,17 @@ DEP = depend
default: $(DEP)
+%.lo: %.c
+ ${LIBTOOL} --mode=compile ${CC} -c ${CFLAGS} ${PICFLAGS} -o $@ $<
+
cli: x264$(EXE)
-lib-static: $(LIBX264)
+lib-static: libx264.la
lib-shared: $(SONAME)
-$(LIBX264): .depend $(OBJS) $(OBJASM)
- rm -f $(LIBX264)
- $(AR)$@ $(OBJS) $(OBJASM)
- $(if $(RANLIB), $(RANLIB) $@)
+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) $(OBJSO)
$(LD)$@ $(OBJS) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS)
@@ -159,17 +162,17 @@ x264: x264$(EXE)
checkasm: checkasm$(EXE)
endif
-x264$(EXE): .depend $(OBJCLI) $(CLI_LIBX264)
- $(LD)$@ $(OBJCLI) $(CLI_LIBX264) $(LDFLAGSCLI) $(LDFLAGS)
+x264$(EXE): .depend $(OBJCLI) libx264.la
+ ${LIBTOOL} --mode=link $(LD)$@ $(OBJCLI) libx264.la $(LDFLAGSCLI) $(LDFLAGS)
-checkasm$(EXE): .depend $(OBJCHK) $(LIBX264)
- $(LD)$@ $(OBJCHK) $(LIBX264) $(LDFLAGS)
+checkasm$(EXE): .depend $(OBJCHK) libx264.la
+ ${LIBTOOL} --mode=link $(LD)$@ $+ $(LDFLAGS)
$(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK): .depend
-%.o: %.asm
- $(AS) $(ASFLAGS) -o $@ $<
- -@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
+%.lo: %.asm
+ ${LIBTOOL} --mode=compile --tag=CC \
+ ./strip_fopt.sh $(AS) $(ASFLAGS) -o $@ $<
%.o: %.S
$(AS) $(ASFLAGS) -o $@ $<
@@ -234,8 +237,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),)
|