Mercurial > libavcodec.hg
comparison Makefile @ 3124:00b0af60fe53 libavcodec
move common parts of makefiles into common.mak
author | mru |
---|---|
date | Mon, 13 Feb 2006 12:53:25 +0000 |
parents | 1d184d61e714 |
children | 0ebbd476ba32 |
comparison
equal
deleted
inserted
replaced
3123:fc43390719fc | 3124:00b0af60fe53 |
---|---|
2 # libavcodec Makefile | 2 # libavcodec Makefile |
3 # (c) 2000-2005 Fabrice Bellard | 3 # (c) 2000-2005 Fabrice Bellard |
4 # | 4 # |
5 include ../config.mak | 5 include ../config.mak |
6 | 6 |
7 VPATH=$(SRC_PATH)/libavcodec | |
8 | |
9 # NOTE: -I.. is needed to include config.h | 7 # NOTE: -I.. is needed to include config.h |
10 CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavutil -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE $(AMR_CFLAGS) | 8 CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavutil -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE $(AMR_CFLAGS) |
11 | |
12 #FIXME: This should be in configure/config.mak | |
13 ifeq ($(CONFIG_WIN32),yes) | |
14 LDFLAGS=-Wl,--output-def,$(@:.dll=.def),--out-implib,lib$(SLIBNAME:$(SLIBSUF)=.dll.a) | |
15 endif | |
16 | 9 |
17 OBJS= bitstream.o utils.o mem.o allcodecs.o \ | 10 OBJS= bitstream.o utils.o mem.o allcodecs.o \ |
18 mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\ | 11 mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\ |
19 mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o \ | 12 mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o \ |
20 motion_est.o imgconvert.o imgresample.o \ | 13 motion_est.o imgconvert.o imgresample.o \ |
22 ratecontrol.o adpcm.o eval.o error_resilience.o \ | 15 ratecontrol.o adpcm.o eval.o error_resilience.o \ |
23 fft.o mdct.o raw.o golomb.o cabac.o\ | 16 fft.o mdct.o raw.o golomb.o cabac.o\ |
24 dpcm.o adx.o faandct.o parser.o g726.o \ | 17 dpcm.o adx.o faandct.o parser.o g726.o \ |
25 vp3dsp.o h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o \ | 18 vp3dsp.o h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o \ |
26 opt.o | 19 opt.o |
20 | |
21 HEADERS = avcodec.h dsputil.h | |
27 | 22 |
28 ifeq ($(CONFIG_AASC_DECODER),yes) | 23 ifeq ($(CONFIG_AASC_DECODER),yes) |
29 OBJS+= aasc.o | 24 OBJS+= aasc.o |
30 endif | 25 endif |
31 ifeq ($(CONFIG_ALAC_DECODER),yes) | 26 ifeq ($(CONFIG_ALAC_DECODER),yes) |
324 | 319 |
325 ifeq ($(CONFIG_LIBGSM),yes) | 320 ifeq ($(CONFIG_LIBGSM),yes) |
326 OBJS += libgsm.o | 321 OBJS += libgsm.o |
327 endif | 322 endif |
328 | 323 |
329 ifeq ($(TARGET_GPROF),yes) | |
330 CFLAGS+=-p | |
331 LDFLAGS+=-p | |
332 endif | |
333 | |
334 # i386 mmx specific stuff | 324 # i386 mmx specific stuff |
335 ifeq ($(TARGET_MMX),yes) | 325 ifeq ($(TARGET_MMX),yes) |
336 OBJS += i386/fdct_mmx.o i386/cputest.o \ | 326 OBJS += i386/fdct_mmx.o i386/cputest.o \ |
337 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \ | 327 i386/dsputil_mmx.o i386/mpegvideo_mmx.o \ |
338 i386/idct_mmx.o i386/motion_est_mmx.o \ | 328 i386/idct_mmx.o i386/motion_est_mmx.o \ |
398 ifeq ($(TARGET_ARCH_SPARC),yes) | 388 ifeq ($(TARGET_ARCH_SPARC),yes) |
399 OBJS+=sparc/dsputil_vis.o | 389 OBJS+=sparc/dsputil_vis.o |
400 sparc/%.o: sparc/%.c | 390 sparc/%.o: sparc/%.c |
401 $(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $< | 391 $(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $< |
402 endif | 392 endif |
403 ifeq ($(TARGET_ARCH_SPARC64),yes) | |
404 CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc | |
405 endif | |
406 | |
407 SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) | |
408 OBJS := $(OBJS) $(ASM_OBJS) | |
409 | 393 |
410 NAME=avcodec | 394 NAME=avcodec |
395 SUBDIR=libavcodec | |
411 LIBAVUTIL= $(SRC_PATH)/libavutil/$(LIBPREF)avutil$(LIBSUF) | 396 LIBAVUTIL= $(SRC_PATH)/libavutil/$(LIBPREF)avutil$(LIBSUF) |
412 ifeq ($(BUILD_SHARED),yes) | 397 ifeq ($(BUILD_SHARED),yes) |
413 LIBVERSION=$(LAVCVERSION) | 398 LIBVERSION=$(LAVCVERSION) |
414 LIBMAJOR=$(LAVCMAJOR) | 399 LIBMAJOR=$(LAVCMAJOR) |
415 endif | 400 endif |
416 TESTS= imgresample-test dct-test motion-test fft-test | 401 TESTS= imgresample-test dct-test motion-test fft-test |
417 | 402 |
418 all: $(LIB) $(SLIBNAME) | 403 EXTRAOBJS = $(AMREXTRALIBS) |
404 | |
405 include $(SRC_PATH)/common.mak | |
406 | |
407 $(LIB): $(AMRLIBS) | |
419 | 408 |
420 amrlibs: | 409 amrlibs: |
421 $(MAKE) -C amr spclib fipoplib | 410 $(MAKE) -C amr spclib fipoplib |
422 | 411 |
423 tests: apiexample cpuid_test $(TESTS) | 412 tests: apiexample cpuid_test $(TESTS) |
424 | 413 |
425 $(LIB): $(OBJS) $(AMRLIBS) | |
426 rm -f $@ | |
427 $(AR) rc $@ $(OBJS) $(AMREXTRALIBS) | |
428 $(RANLIB) $@ | |
429 | |
430 $(SLIBNAME): $(OBJS) | |
431 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) | |
432 ifeq ($(CONFIG_WIN32),yes) | |
433 -lib /machine:i386 /def:$(@:.dll=.def) | |
434 endif | |
435 | |
436 dsputil.o: dsputil.c dsputil.h | 414 dsputil.o: dsputil.c dsputil.h |
437 | 415 |
438 %.o: %.c | 416 clean:: $(CLEANAMR) |
439 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< | 417 rm -f \ |
440 | |
441 %.o: %.S | |
442 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< | |
443 | |
444 depend: $(SRCS) | |
445 $(CC) -MM $(CFLAGS) $^ 1>.depend | |
446 | |
447 dep: depend | |
448 | |
449 clean: $(CLEANAMR) | |
450 rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll \ | |
451 *.dll.a *.def *.exp \ | |
452 i386/*.o i386/*~ \ | 418 i386/*.o i386/*~ \ |
453 armv4l/*.o armv4l/*~ \ | 419 armv4l/*.o armv4l/*~ \ |
454 mlib/*.o mlib/*~ \ | 420 mlib/*.o mlib/*~ \ |
455 alpha/*.o alpha/*~ \ | 421 alpha/*.o alpha/*~ \ |
456 ppc/*.o ppc/*~ \ | 422 ppc/*.o ppc/*~ \ |
458 sh4/*.o sh4/*~ \ | 424 sh4/*.o sh4/*~ \ |
459 sparc/*.o sparc/*~ \ | 425 sparc/*.o sparc/*~ \ |
460 liba52/*.o liba52/*~ \ | 426 liba52/*.o liba52/*~ \ |
461 apiexample $(TESTS) | 427 apiexample $(TESTS) |
462 | 428 |
463 distclean: clean | |
464 rm -f .depend | |
465 | |
466 cleanamr: | 429 cleanamr: |
467 $(MAKE) -C amr clean | 430 $(MAKE) -C amr clean |
468 | 431 |
469 cleanamrfloat: | 432 cleanamrfloat: |
470 rm -f amr_float/*.o | 433 rm -f amr_float/*.o |
491 motion-test: motion_test.o $(LIB) | 454 motion-test: motion_test.o $(LIB) |
492 $(CC) -o $@ $^ -lm | 455 $(CC) -o $@ $^ -lm |
493 | 456 |
494 fft-test: fft-test.o $(LIB) | 457 fft-test: fft-test.o $(LIB) |
495 $(CC) -o $@ $^ $(LIBAVUTIL) -lm | 458 $(CC) -o $@ $^ $(LIBAVUTIL) -lm |
496 | |
497 | |
498 install-lib-shared: $(SLIBNAME) | |
499 ifeq ($(CONFIG_WIN32),yes) | |
500 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)" | |
501 else | |
502 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \ | |
503 $(libdir)/$(SLIBNAME_WITH_VERSION) | |
504 ln -sf $(SLIBNAME_WITH_VERSION) \ | |
505 $(libdir)/$(SLIBNAME_WITH_MAJOR) | |
506 ln -sf $(SLIBNAME_WITH_VERSION) \ | |
507 $(libdir)/$(SLIBNAME) | |
508 endif | |
509 | |
510 install-lib-static: $(LIB) | |
511 install -m 644 $(LIB) "$(libdir)" | |
512 | |
513 install-headers: | |
514 install -m 644 avcodec.h dsputil.h "$(incdir)" | |
515 install -m 644 $(SRC_PATH)/libavcodec.pc "$(libdir)/pkgconfig" | |
516 | |
517 # | |
518 # include dependency files if they exist | |
519 # | |
520 ifneq ($(wildcard .depend),) | |
521 include .depend | |
522 endif |