annotate subdir.mak @ 31067:a4658190b9de

Revert accidental change to default CFLAGS.
author reimar
date Fri, 30 Apr 2010 21:18:17 +0000
parents bc094de7968e
children 0f9c3f446fc6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
1 SRC_DIR := $(SRC_PATH_BARE)/lib$(NAME)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
2
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
3 include $(SUBDIR)../common.mak
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
4
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
5 LIBVERSION := $(lib$(NAME)_VERSION)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
6 LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
7
29671
3f5e7b22b2a6 sync with FFmpeg build: BUILD_STATIC --> CONFIG_STATIC
diego
parents: 29136
diff changeset
8 ifeq ($(CONFIG_STATIC),yes)
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
9 all: $(SUBDIR)$(LIBNAME)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
10
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
11 install-libs: install-lib$(NAME)-static
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
12
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
13 $(SUBDIR)$(LIBNAME): $(OBJS)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
14 rm -f $@
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
15 $(AR) rc $@ $^ $(EXTRAOBJS)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
16 $(RANLIB) $@
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
17 endif
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
18
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
19 INCINSTDIR := $(INCDIR)/lib$(NAME)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
20
29671
3f5e7b22b2a6 sync with FFmpeg build: BUILD_STATIC --> CONFIG_STATIC
diego
parents: 29136
diff changeset
21 THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
22
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
23 define RULES
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
24 $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29671
diff changeset
25 $(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
26
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
27 $(SUBDIR)%-test.o: $(SUBDIR)%.c
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29671
diff changeset
28 $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
29
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
30 $(SUBDIR)%-test.o: $(SUBDIR)%-test.c
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29671
diff changeset
31 $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
32
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
33 $(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29671
diff changeset
34 $(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$@ $$< > $$(@:.o=.d)
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
35 $(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
36
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
37 clean::
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29671
diff changeset
38 rm -f $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
39 $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
40
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
41 distclean:: clean
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
42 rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
43 $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
44
29671
3f5e7b22b2a6 sync with FFmpeg build: BUILD_STATIC --> CONFIG_STATIC
diego
parents: 29136
diff changeset
45 ifdef CONFIG_SHARED
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
46 all: $(SUBDIR)$(SLIBNAME)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
47
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
48 install-libs: install-lib$(NAME)-shared
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
49
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
50 $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
51 cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
52
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
53 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
54 $(SLIB_CREATE_DEF_CMD)
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29671
diff changeset
55 $(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
56 $(SLIB_EXTRA_CMD)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
57
26317
955f4b8ac094 Merge simplifications from FFmpeg r12764.
diego
parents: 26315
diff changeset
58 ifdef SUBDIR
26403
c7c1cc069961 Sync with latest FFmpeg changes.
diego
parents: 26317
diff changeset
59 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
60 endif
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
61 endif
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
62
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
63 install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
64 install -d "$(SHLIBDIR)"
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
65 install -m 755 $$< "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
66 $(STRIP) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
67 cd "$(SHLIBDIR)" && \
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
68 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
69 cd "$(SHLIBDIR)" && \
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
70 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
71 $(SLIB_INSTALL_EXTRA_CMD)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
72
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
73 install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
74 install -d "$(LIBDIR)"
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
75 install -m 644 $$< "$(LIBDIR)"
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
76 $(LIB_INSTALL_EXTRA_CMD)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
77
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
78 install-headers::
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
79 install -d "$(INCINSTDIR)"
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
80 install -d "$(LIBDIR)/pkgconfig"
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
81 install -m 644 $(addprefix "$(SRC_DIR)"/,$(HEADERS)) "$(INCINSTDIR)"
27999
84982bf9adbf Sync with latest FFmpeg changes.
diego
parents: 26403
diff changeset
82 install -m 644 $(BUILD_ROOT)/lib$(NAME)/lib$(NAME).pc "$(LIBDIR)/pkgconfig"
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
83
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
84 uninstall-libs::
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
85 -rm -f "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
86 "$(SHLIBDIR)/$(SLIBNAME)" \
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
87 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
88 -$(SLIB_UNINSTALL_EXTRA_CMD)
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
89 -rm -f "$(LIBDIR)/$(LIBNAME)"
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
90
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
91 uninstall-headers::
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
92 rm -f $(addprefix "$(INCINSTDIR)/",$(HEADERS))
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
93 rm -f "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
94 -rmdir "$(INCDIR)"
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
95 endef
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
96
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
diff changeset
97 $(eval $(RULES))
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
98
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
99 $(EXAMPLES) $(TESTPROGS): $(THIS_LIB) $(DEP_LIBS)
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
100
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
101 examples: $(EXAMPLES)
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
102 testprogs: $(TESTPROGS)