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
104
105
106
107
108
109
110
|
$NetBSD: patch-ab,v 1.19 2014/03/04 13:59:11 adam Exp $
--- Makefile.orig 2014-03-03 21:45:04.000000000 +0000
+++ Makefile
@@ -100,9 +100,9 @@ endif
ifdef ARCH_X86
ASFLAGS += -I$(SRCPATH)/common/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
@@ -122,7 +122,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
@@ -130,7 +130,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
@@ -153,20 +153,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 uninstall lib-static lib-shared cli install-lib-dev install-lib-static install-lib-shared install-cli
+%.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)
@@ -177,17 +180,17 @@ x264: x264$(EXE)
checkasm: checkasm$(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)
$(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 $@ $<
@@ -246,8 +249,7 @@ distclean: clean
rm -f config.mak x264_config.h config.h config.log x264.pc x264.def
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)
@@ -258,8 +260,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),)
|