Makefile 13.1 KB
Newer Older
1
# Makefile
2

3 4
include config.mak

Oka Motofumi's avatar
Oka Motofumi committed
5 6 7 8
vpath %.c $(SRCPATH)
vpath %.h $(SRCPATH)
vpath %.S $(SRCPATH)
vpath %.asm $(SRCPATH)
Henrik Gramner's avatar
Henrik Gramner committed
9
vpath %.rc $(SRCPATH)
Oka Motofumi's avatar
Oka Motofumi committed
10

11 12 13
CFLAGS += $(CFLAGSPROF)
LDFLAGS += $(LDFLAGSPROF)

Steve Borho's avatar
Steve Borho committed
14 15
GENERATED =

16
all: default
Henrik Gramner's avatar
Henrik Gramner committed
17
default:
18

19 20 21 22 23 24 25 26 27 28 29 30 31
SRCS = common/osdep.c common/base.c common/cpu.c common/tables.c \
       encoder/api.c

SRCS_X = common/mc.c common/predict.c common/pixel.c common/macroblock.c \
         common/frame.c common/dct.c common/cabac.c \
         common/common.c common/rectangle.c \
         common/set.c common/quant.c common/deblock.c common/vlc.c \
         common/mvpred.c common/bitstream.c \
         encoder/analyse.c encoder/me.c encoder/ratecontrol.c \
         encoder/set.c encoder/macroblock.c encoder/cabac.c \
         encoder/cavlc.c encoder/encoder.c encoder/lookahead.c

SRCS_8 =
Laurent Aimar's avatar
Laurent Aimar committed
32

33 34
SRCCLI = x264.c autocomplete.c input/input.c input/timecode.c input/raw.c \
         input/y4m.c output/raw.c output/matroska.c output/matroska_ebml.c \
35 36
         output/flv.c output/flv_bytestream.c filters/filters.c \
         filters/video/video.c filters/video/source.c filters/video/internal.c \
37 38 39 40
         filters/video/resize.c filters/video/fix_vfr_pts.c \
         filters/video/select_every.c filters/video/crop.c

SRCCLI_X = filters/video/cache.c filters/video/depth.c
41

42
SRCSO =
43 44 45 46 47

SRCCHK_X = tools/checkasm.c

SRCEXAMPLE = example.c

Henrik Gramner's avatar
Henrik Gramner committed
48
OBJS =
49
OBJASM =
Henrik Gramner's avatar
Henrik Gramner committed
50 51
OBJSO =
OBJCLI =
52 53 54 55
OBJCHK =
OBJCHK_8 =
OBJCHK_10 =
OBJEXAMPLE =
Anton Mitrofanov's avatar
Anton Mitrofanov committed
56

Diogo Franco's avatar
Diogo Franco committed
57
CONFIG := $(shell cat config.h)
58

59
# Optional module sources
60
ifneq ($(findstring HAVE_AVS 1, $(CONFIG)),)
61
SRCCLI += input/avs.c
62 63
endif

64
ifneq ($(findstring HAVE_THREAD 1, $(CONFIG)),)
65 66
SRCS_X   += common/threadpool.c
SRCCLI_X += input/thread.c
67 68
endif

69 70 71 72
ifneq ($(findstring HAVE_WIN32THREAD 1, $(CONFIG)),)
SRCS += common/win32thread.c
endif

73
ifneq ($(findstring HAVE_LAVF 1, $(CONFIG)),)
74 75 76
SRCCLI += input/lavf.c
endif

77
ifneq ($(findstring HAVE_FFMS 1, $(CONFIG)),)
78 79 80
SRCCLI += input/ffms.c
endif

81
ifneq ($(findstring HAVE_GPAC 1, $(CONFIG)),)
82 83
SRCCLI += output/mp4.c
endif
Loren Merritt's avatar
Loren Merritt committed
84

85 86 87 88
ifneq ($(findstring HAVE_LSMASH 1, $(CONFIG)),)
SRCCLI += output/mp4_lsmash.c
endif

89
ifneq ($(AS),)
90

91 92
# MMX/SSE optims
SRCASM_X =
93
ifeq ($(SYS_ARCH),X86)
Loren Merritt's avatar
Loren Merritt committed
94
ARCH_X86 = yes
95 96
SRCASM_X += common/x86/dct-32.asm \
            common/x86/pixel-32.asm
97
endif
98
ifeq ($(SYS_ARCH),X86_64)
Loren Merritt's avatar
Loren Merritt committed
99
ARCH_X86 = yes
100 101
SRCASM_X += common/x86/dct-64.asm \
            common/x86/trellis-64.asm
Loren Merritt's avatar
Loren Merritt committed
102 103 104
endif

ifdef ARCH_X86
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
SRCASM_X += common/x86/bitstream-a.asm \
            common/x86/const-a.asm \
            common/x86/cabac-a.asm \
            common/x86/dct-a.asm \
            common/x86/deblock-a.asm \
            common/x86/mc-a.asm \
            common/x86/mc-a2.asm \
            common/x86/pixel-a.asm \
            common/x86/predict-a.asm \
            common/x86/quant-a.asm
SRCS_X   += common/x86/mc-c.c \
            common/x86/predict-c.c

OBJASM += common/x86/cpu-a.o
ifneq ($(findstring HAVE_BITDEPTH8 1, $(CONFIG)),)
OBJASM += $(SRCASM_X:%.asm=%-8.o) common/x86/sad-a-8.o
endif
ifneq ($(findstring HAVE_BITDEPTH10 1, $(CONFIG)),)
OBJASM += $(SRCASM_X:%.asm=%-10.o) common/x86/sad16-a-10.o
Loren Merritt's avatar
Loren Merritt committed
124
endif
125 126

OBJCHK += tools/checkasm-a.o
127
endif
Loren Merritt's avatar
Loren Merritt committed
128

129
# AltiVec optims
130
ifeq ($(SYS_ARCH),PPC)
131 132 133 134 135 136
SRCS_X += common/ppc/dct.c \
          common/ppc/deblock.c \
          common/ppc/mc.c \
          common/ppc/pixel.c \
          common/ppc/predict.c \
          common/ppc/quant.c
137
endif
138

139
# NEON optims
140
ifeq ($(SYS_ARCH),ARM)
141 142 143 144 145 146 147 148 149 150 151 152 153
SRCASM_X  = common/arm/bitstream-a.S \
            common/arm/dct-a.S \
            common/arm/deblock-a.S \
            common/arm/mc-a.S \
            common/arm/pixel-a.S \
            common/arm/predict-a.S \
            common/arm/quant-a.S
SRCS_X   += common/arm/mc-c.c \
            common/arm/predict-c.c

OBJASM += common/arm/cpu-a.o
ifneq ($(findstring HAVE_BITDEPTH8 1, $(CONFIG)),)
OBJASM += $(SRCASM_X:%.S=%-8.o)
154
endif
155 156 157 158 159
ifneq ($(findstring HAVE_BITDEPTH10 1, $(CONFIG)),)
OBJASM += $(SRCASM_X:%.S=%-10.o)
endif

OBJCHK += tools/checkasm-arm.o
160 161
endif

Janne Grunau's avatar
Janne Grunau committed
162
# AArch64 NEON optims
163
ifeq ($(SYS_ARCH),AARCH64)
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
SRCASM_X  = common/aarch64/bitstream-a.S \
            common/aarch64/cabac-a.S \
            common/aarch64/dct-a.S \
            common/aarch64/deblock-a.S \
            common/aarch64/mc-a.S \
            common/aarch64/pixel-a.S \
            common/aarch64/predict-a.S \
            common/aarch64/quant-a.S
SRCS_X   += common/aarch64/asm-offsets.c \
            common/aarch64/mc-c.c \
            common/aarch64/predict-c.c

OBJASM +=
ifneq ($(findstring HAVE_BITDEPTH8 1, $(CONFIG)),)
OBJASM += $(SRCASM_X:%.S=%-8.o)
endif
ifneq ($(findstring HAVE_BITDEPTH10 1, $(CONFIG)),)
OBJASM += $(SRCASM_X:%.S=%-10.o)
Janne Grunau's avatar
Janne Grunau committed
182
endif
183 184

OBJCHK += tools/checkasm-aarch64.o
Janne Grunau's avatar
Janne Grunau committed
185 186
endif

Rishikesh More's avatar
Rishikesh More committed
187 188 189
# MSA optims
ifeq ($(SYS_ARCH),MIPS)
ifneq ($(findstring HAVE_MSA 1, $(CONFIG)),)
190 191 192 193 194 195
SRCS_X += common/mips/dct-c.c \
          common/mips/deblock-c.c \
          common/mips/mc-c.c \
          common/mips/pixel-c.c \
          common/mips/predict-c.c \
          common/mips/quant-c.c
Rishikesh More's avatar
Rishikesh More committed
196 197 198
endif
endif

199 200
endif

201
ifneq ($(HAVE_GETOPT_LONG),1)
202
SRCCLI += extras/getopt.c
203 204
endif

Steven Walters's avatar
Steven Walters committed
205
ifeq ($(SYS),WINDOWS)
Henrik Gramner's avatar
Henrik Gramner committed
206 207 208 209
OBJCLI += $(if $(RC), x264res.o)
ifneq ($(SONAME),)
SRCSO  += x264dll.c
OBJSO  += $(if $(RC), x264res.dll.o)
210 211 212
endif
endif

Steve Borho's avatar
Steve Borho committed
213 214
ifeq ($(HAVE_OPENCL),yes)
common/oclobj.h: common/opencl/x264-cl.h $(wildcard $(SRCPATH)/common/opencl/*.cl)
215
	cat $^ | $(SRCPATH)/tools/cltostr.sh $@
Steve Borho's avatar
Steve Borho committed
216
GENERATED += common/oclobj.h
217
SRCS_8 += common/opencl.c encoder/slicetype-cl.c
Steve Borho's avatar
Steve Borho committed
218 219
endif

Henrik Gramner's avatar
Henrik Gramner committed
220 221 222
OBJS   += $(SRCS:%.c=%.o)
OBJCLI += $(SRCCLI:%.c=%.o)
OBJSO  += $(SRCSO:%.c=%.o)
223
OBJEXAMPLE += $(SRCEXAMPLE:%.c=%.o)
Laurent Aimar's avatar
Laurent Aimar committed
224

225 226 227 228 229 230 231 232 233 234 235 236 237 238
ifneq ($(findstring HAVE_BITDEPTH8 1, $(CONFIG)),)
OBJS      += $(SRCS_X:%.c=%-8.o) $(SRCS_8:%.c=%-8.o)
OBJCLI    += $(SRCCLI_X:%.c=%-8.o)
OBJCHK_8  += $(SRCCHK_X:%.c=%-8.o)
checkasm: checkasm8$(EXE)
endif
ifneq ($(findstring HAVE_BITDEPTH10 1, $(CONFIG)),)
OBJS      += $(SRCS_X:%.c=%-10.o)
OBJCLI    += $(SRCCLI_X:%.c=%-10.o)
OBJCHK_10 += $(SRCCHK_X:%.c=%-10.o)
checkasm: checkasm10$(EXE)
endif

.PHONY: all default fprofiled clean distclean install install-* uninstall cli lib-* checkasm etags
239

Nikoli's avatar
Nikoli committed
240 241 242
cli: x264$(EXE)
lib-static: $(LIBX264)
lib-shared: $(SONAME)
Laurent Aimar's avatar
Laurent Aimar committed
243

Steve Borho's avatar
Steve Borho committed
244
$(LIBX264): $(GENERATED) .depend $(OBJS) $(OBJASM)
Anton Mitrofanov's avatar
Anton Mitrofanov committed
245
	rm -f $(LIBX264)
Steven Walters's avatar
Steven Walters committed
246 247
	$(AR)$@ $(OBJS) $(OBJASM)
	$(if $(RANLIB), $(RANLIB) $@)
Laurent Aimar's avatar
Laurent Aimar committed
248

Steve Borho's avatar
Steve Borho committed
249
$(SONAME): $(GENERATED) .depend $(OBJS) $(OBJASM) $(OBJSO)
Steven Walters's avatar
Steven Walters committed
250
	$(LD)$@ $(OBJS) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS)
251

252 253
$(IMPLIBNAME): $(SONAME)

Anton Mitrofanov's avatar
Anton Mitrofanov committed
254
ifneq ($(EXE),)
255
.PHONY: x264 checkasm8 checkasm10 example
Anton Mitrofanov's avatar
Anton Mitrofanov committed
256
x264: x264$(EXE)
257 258
checkasm8: checkasm8$(EXE)
checkasm10: checkasm10$(EXE)
Anton Mitrofanov's avatar
Anton Mitrofanov committed
259
example: example$(EXE)
Anton Mitrofanov's avatar
Anton Mitrofanov committed
260 261
endif

Steve Borho's avatar
Steve Borho committed
262
x264$(EXE): $(GENERATED) .depend $(OBJCLI) $(CLI_LIBX264)
Nikoli's avatar
Nikoli committed
263
	$(LD)$@ $(OBJCLI) $(CLI_LIBX264) $(LDFLAGSCLI) $(LDFLAGS)
Loren Merritt's avatar
Loren Merritt committed
264

265 266 267 268 269
checkasm8$(EXE): $(GENERATED) .depend $(OBJCHK) $(OBJCHK_8) $(LIBX264)
	$(LD)$@ $(OBJCHK) $(OBJCHK_8) $(LIBX264) $(LDFLAGS)

checkasm10$(EXE): $(GENERATED) .depend $(OBJCHK) $(OBJCHK_10) $(LIBX264)
	$(LD)$@ $(OBJCHK) $(OBJCHK_10) $(LIBX264) $(LDFLAGS)
Anton Mitrofanov's avatar
Anton Mitrofanov committed
270

Anton Mitrofanov's avatar
Anton Mitrofanov committed
271 272 273
example$(EXE): $(GENERATED) .depend $(OBJEXAMPLE) $(LIBX264)
	$(LD)$@ $(OBJEXAMPLE) $(LIBX264) $(LDFLAGS)

274 275 276
$(OBJS) $(OBJSO): CFLAGS += $(CFLAGSSO)
$(OBJCLI): CFLAGS += $(CFLAGSCLI)

277 278 279 280 281 282 283 284 285 286
$(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK) $(OBJCHK_8) $(OBJCHK_10) $(OBJEXAMPLE): .depend

%.o: %.c
	$(CC) $(CFLAGS) -c $< $(CC_O)

%-8.o: %.c
	$(CC) $(CFLAGS) -c $< $(CC_O) -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8

%-10.o: %.c
	$(CC) $(CFLAGS) -c $< $(CC_O) -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=10
Laurent Aimar's avatar
Laurent Aimar committed
287

288
%.o: %.asm common/x86/x86inc.asm common/x86/x86util.asm
Laurent Aimar's avatar
Laurent Aimar committed
289
	$(AS) $(ASFLAGS) -o $@ $<
Steven Walters's avatar
Steven Walters committed
290
	-@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
291

292 293 294 295 296 297 298 299
%-8.o: %.asm common/x86/x86inc.asm common/x86/x86util.asm
	$(AS) $(ASFLAGS) -o $@ $< -DBIT_DEPTH=8 -Dprivate_prefix=x264_8
	-@ $(if $(STRIP), $(STRIP) -x $@)

%-10.o: %.asm common/x86/x86inc.asm common/x86/x86util.asm
	$(AS) $(ASFLAGS) -o $@ $< -DBIT_DEPTH=10 -Dprivate_prefix=x264_10
	-@ $(if $(STRIP), $(STRIP) -x $@)

300 301
%.o: %.S
	$(AS) $(ASFLAGS) -o $@ $<
Steven Walters's avatar
Steven Walters committed
302
	-@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
303

304 305 306 307 308 309 310 311
%-8.o: %.S
	$(AS) $(ASFLAGS) -o $@ $< -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
	-@ $(if $(STRIP), $(STRIP) -x $@)

%-10.o: %.S
	$(AS) $(ASFLAGS) -o $@ $< -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=10
	-@ $(if $(STRIP), $(STRIP) -x $@)

Henrik Gramner's avatar
Henrik Gramner committed
312
%.dll.o: %.rc x264.h
313
	$(RC) $(RCFLAGS)$@ -DDLL $<
Henrik Gramner's avatar
Henrik Gramner committed
314 315

%.o: %.rc x264.h
316
	$(RC) $(RCFLAGS)$@ $<
Henrik Gramner's avatar
Henrik Gramner committed
317

318
.depend: config.mak
319
	@rm -f .depend
Steven Walters's avatar
Steven Walters committed
320 321
	@echo 'dependency file generation...'
ifeq ($(COMPILER),CL)
322 323 324 325 326 327 328
	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS) $(SRCCLI) $(SRCSO) $(SRCEXAMPLE)), $(SRCPATH)/tools/msvsdepend.sh "$(CC)" "$(CFLAGS)" "$(SRC)" "$(SRC:$(SRCPATH)/%.c=%.o)" 1>> .depend;)
ifneq ($(findstring HAVE_BITDEPTH8 1, $(CONFIG)),)
	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS_X) $(SRCS_8) $(SRCCLI_X) $(SRCCHK_X)), $(SRCPATH)/tools/msvsdepend.sh "$(CC)" "$(CFLAGS)" "$(SRC)" "$(SRC:$(SRCPATH)/%.c=%-8.o)" 1>> .depend;)
endif
ifneq ($(findstring HAVE_BITDEPTH10 1, $(CONFIG)),)
	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS_X) $(SRCCLI_X) $(SRCCHK_X)), $(SRCPATH)/tools/msvsdepend.sh "$(CC)" "$(CFLAGS)" "$(SRC)" "$(SRC:$(SRCPATH)/%.c=%-10.o)" 1>> .depend;)
endif
Steven Walters's avatar
Steven Walters committed
329
else
330 331 332 333 334 335 336
	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS) $(SRCCLI) $(SRCSO) $(SRCEXAMPLE)), $(CC) $(CFLAGS) $(SRC) $(DEPMT) $(SRC:$(SRCPATH)/%.c=%.o) $(DEPMM) 1>> .depend;)
ifneq ($(findstring HAVE_BITDEPTH8 1, $(CONFIG)),)
	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS_X) $(SRCS_8) $(SRCCLI_X) $(SRCCHK_X)), $(CC) $(CFLAGS) $(SRC) $(DEPMT) $(SRC:$(SRCPATH)/%.c=%-8.o) $(DEPMM) 1>> .depend;)
endif
ifneq ($(findstring HAVE_BITDEPTH10 1, $(CONFIG)),)
	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS_X) $(SRCCLI_X) $(SRCCHK_X)), $(CC) $(CFLAGS) $(SRC) $(DEPMT) $(SRC:$(SRCPATH)/%.c=%-10.o) $(DEPMM) 1>> .depend;)
endif
Steven Walters's avatar
Steven Walters committed
337
endif
Laurent Aimar's avatar
Laurent Aimar committed
338

339 340
config.mak:
	./configure
341

Laurent Aimar's avatar
Laurent Aimar committed
342 343 344 345 346
depend: .depend
ifneq ($(wildcard .depend),)
include .depend
endif

347
OBJPROF = $(OBJS) $(OBJSO) $(OBJCLI)
348
# These should cover most of the important codepaths
349
OPT0 = --crf 30 -b1 -m1 -r1 --me dia --no-cabac --direct temporal --ssim --no-weightb
Fiona Glaser's avatar
Fiona Glaser committed
350 351
OPT1 = --crf 16 -b2 -m3 -r3 --me hex --no-8x8dct --direct spatial --no-dct-decimate -t0  --slice-max-mbs 50
OPT2 = --crf 26 -b4 -m5 -r2 --me hex --cqm jvt --nr 100 --psnr --no-mixed-refs --b-adapt 2 --slice-max-size 1500
352
OPT3 = --crf 18 -b3 -m9 -r5 --me umh -t1 -A all --b-pyramid normal --direct auto --no-fast-pskip --no-mbtree
Fiona Glaser's avatar
Fiona Glaser committed
353
OPT4 = --crf 22 -b3 -m7 -r4 --me esa -t2 -A all --psy-rd 1.0:1.0 --slices 4
Fiona Glaser's avatar
Fiona Glaser committed
354
OPT5 = --frames 50 --crf 24 -b3 -m10 -r3 --me tesa -t2
355
OPT6 = --frames 50 -q0 -m9 -r2 --me hex -Aall
356
OPT7 = --frames 50 -q0 -m2 -r1 --me hex --no-cabac
357 358 359 360 361

ifeq (,$(VIDS))
fprofiled:
	@echo 'usage: make fprofiled VIDS="infile1 infile2 ..."'
	@echo 'where infiles are anything that x264 understands,'
Loren Merritt's avatar
Loren Merritt committed
362
	@echo 'i.e. YUV with resolution in the filename, y4m, or avisynth.'
363
else
Diego Biurrun's avatar
Diego Biurrun committed
364
fprofiled: clean
365
	$(MAKE) x264$(EXE) CFLAGSPROF="$(PROF_GEN_CC)" LDFLAGSPROF="$(PROF_GEN_LD)"
366
	$(foreach V, $(VIDS), $(foreach I, 0 1 2 3 4 5 6 7, ./x264$(EXE) $(OPT$I) --threads 1 $(V) -o $(DEVNULL) ;))
Steven Walters's avatar
Steven Walters committed
367 368 369 370
ifeq ($(COMPILER),CL)
# Because Visual Studio timestamps the object files within the PGD, it fails to build if they change - only the executable should be deleted
	rm -f x264$(EXE)
else
371
	rm -f $(OBJPROF)
Steven Walters's avatar
Steven Walters committed
372
endif
373
	$(MAKE) CFLAGSPROF="$(PROF_USE_CC)" LDFLAGSPROF="$(PROF_USE_LD)"
374
	rm -f $(OBJPROF:%.o=%.gcda) $(OBJPROF:%.o=%.gcno) *.dyn pgopti.dpi pgopti.dpi.lock *.pgd *.pgc
375 376
endif

Laurent Aimar's avatar
Laurent Aimar committed
377
clean:
378 379 380 381 382
	rm -f $(OBJS) $(OBJASM) $(OBJCLI) $(OBJSO) $(GENERATED) .depend TAGS
	rm -f $(SONAME) *.a *.lib *.exp *.pdb x264$(EXE) x264_lookahead.clbin
	rm -f checkasm8$(EXE) checkasm10$(EXE) $(OBJCHK) $(OBJCHK_8) $(OBJCHK_10)
	rm -f example$(EXE) $(OBJEXAMPLE)
	rm -f $(OBJPROF:%.o=%.gcda) $(OBJPROF:%.o=%.gcno) *.dyn pgopti.dpi pgopti.dpi.lock *.pgd *.pgc
Laurent Aimar's avatar
Laurent Aimar committed
383

Måns Rullgård's avatar
Måns Rullgård committed
384
distclean: clean
385 386
	rm -f config.mak x264_config.h config.h config.log x264.pc x264.def
	rm -rf conftest*
Laurent Aimar's avatar
Laurent Aimar committed
387

Nikoli's avatar
Nikoli committed
388
install-cli: cli
389 390
	$(INSTALL) -d $(DESTDIR)$(bindir)
	$(INSTALL) x264$(EXE) $(DESTDIR)$(bindir)
Nikoli's avatar
Nikoli committed
391 392

install-lib-dev:
Diego Biurrun's avatar
Diego Biurrun committed
393 394
	$(INSTALL) -d $(DESTDIR)$(includedir) $(DESTDIR)$(libdir)/pkgconfig
	$(INSTALL) -m 644 $(SRCPATH)/x264.h x264_config.h $(DESTDIR)$(includedir)
395
	$(INSTALL) -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
Nikoli's avatar
Nikoli committed
396 397

install-lib-static: lib-static install-lib-dev
Diego Biurrun's avatar
Diego Biurrun committed
398
	$(INSTALL) -d $(DESTDIR)$(libdir)
399
	$(INSTALL) -m 644 $(LIBX264) $(DESTDIR)$(libdir)
Steven Walters's avatar
Steven Walters committed
400
	$(if $(RANLIB), $(RANLIB) $(DESTDIR)$(libdir)/$(LIBX264))
Nikoli's avatar
Nikoli committed
401 402

install-lib-shared: lib-shared install-lib-dev
Diego Biurrun's avatar
Diego Biurrun committed
403
	$(INSTALL) -d $(DESTDIR)$(libdir)
404
ifneq ($(IMPLIBNAME),)
405 406 407
	$(INSTALL) -d $(DESTDIR)$(bindir)
	$(INSTALL) -m 755 $(SONAME) $(DESTDIR)$(bindir)
	$(INSTALL) -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir)
408 409
else ifneq ($(SONAME),)
	ln -f -s $(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX)
410
	$(INSTALL) -m 755 $(SONAME) $(DESTDIR)$(libdir)
Zuxy Meng's avatar
Zuxy Meng committed
411
endif
Loren Merritt's avatar
Loren Merritt committed
412

413 414 415 416 417 418
install-bashcompletion:
ifneq ($(BASHCOMPLETIONSDIR),)
	$(INSTALL) -d $(DESTDIR)$(BASHCOMPLETIONSDIR)
	$(INSTALL) -m 644 -T $(SRCPATH)/tools/bash-autocomplete.sh $(DESTDIR)$(BASHCOMPLETIONSDIR)/x264
endif

Loren Merritt's avatar
Loren Merritt committed
419
uninstall:
420
	rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(includedir)/x264_config.h $(DESTDIR)$(libdir)/libx264.a
421
	rm -f $(DESTDIR)$(bindir)/x264$(EXE) $(DESTDIR)$(libdir)/pkgconfig/x264.pc
422 423 424 425 426
ifneq ($(IMPLIBNAME),)
	rm -f $(DESTDIR)$(bindir)/$(SONAME) $(DESTDIR)$(libdir)/$(IMPLIBNAME)
else ifneq ($(SONAME),)
	rm -f $(DESTDIR)$(libdir)/$(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX)
endif
427 428 429
ifneq ($(BASHCOMPLETIONSDIR),)
	rm -f $(DESTDIR)$(BASHCOMPLETIONSDIR)/x264
endif
Loren Merritt's avatar
Loren Merritt committed
430

Diego Biurrun's avatar
Diego Biurrun committed
431
etags TAGS:
432
	etags $(SRCS) $(SRCS_X) $(SRCS_8)