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