Mercurial > mplayer.hg
annotate mpcommon.mak @ 26466:d4f4ce3534c3
Use directory name as library name template.
author | diego |
---|---|
date | Tue, 22 Apr 2008 21:51:41 +0000 |
parents | 7f5696224182 |
children | 8c35fde6cdca |
rev | line source |
---|---|
22528
8bcff5c7e387
Give more descriptive names to the source and library variables and split
diego
parents:
22526
diff
changeset
|
1 SRCS_COMMON += $(SRCS_COMMON-yes) |
8bcff5c7e387
Give more descriptive names to the source and library variables and split
diego
parents:
22526
diff
changeset
|
2 SRCS_MPLAYER += $(SRCS_MPLAYER-yes) |
8bcff5c7e387
Give more descriptive names to the source and library variables and split
diego
parents:
22526
diff
changeset
|
3 SRCS_MENCODER += $(SRCS_MENCODER-yes) |
21307 | 4 |
22848
82f06c55cf97
Append objects derived from sources to OBJS_*. This way the OBJS_* variables
diego
parents:
22814
diff
changeset
|
5 OBJS_COMMON += $(addsuffix .o, $(basename $(SRCS_COMMON)) ) |
82f06c55cf97
Append objects derived from sources to OBJS_*. This way the OBJS_* variables
diego
parents:
22814
diff
changeset
|
6 OBJS_MPLAYER += $(addsuffix .o, $(basename $(SRCS_MPLAYER)) ) |
82f06c55cf97
Append objects derived from sources to OBJS_*. This way the OBJS_* variables
diego
parents:
22814
diff
changeset
|
7 OBJS_MENCODER += $(addsuffix .o, $(basename $(SRCS_MENCODER)) ) |
21259
92b122592776
Merge common parts of all Makefiles into one file included by all.
diego
parents:
diff
changeset
|
8 |
23781
1955b4e60574
Revert include flag reordering, it does not fix the compilation problem.
diego
parents:
23773
diff
changeset
|
9 CFLAGS += $(CFLAGS-yes) $(OPTFLAGS) |
21259
92b122592776
Merge common parts of all Makefiles into one file included by all.
diego
parents:
diff
changeset
|
10 |
22528
8bcff5c7e387
Give more descriptive names to the source and library variables and split
diego
parents:
22526
diff
changeset
|
11 LIBS-$(MPLAYER) += $(LIBNAME_MPLAYER) |
8bcff5c7e387
Give more descriptive names to the source and library variables and split
diego
parents:
22526
diff
changeset
|
12 LIBS-$(MENCODER) += $(LIBNAME_MENCODER) |
8bcff5c7e387
Give more descriptive names to the source and library variables and split
diego
parents:
22526
diff
changeset
|
13 LIBS = $(LIBNAME_COMMON) $(LIBS-yes) |
21287
f423ce0a1c36
Move common code for generating multiple libraries to mpcommon.mak.
diego
parents:
21259
diff
changeset
|
14 |
22526
cbf425ba6a96
Give the library generation target a more sensible name.
diego
parents:
22522
diff
changeset
|
15 libs: $(LIBS) |
21259
92b122592776
Merge common parts of all Makefiles into one file included by all.
diego
parents:
diff
changeset
|
16 |
22528
8bcff5c7e387
Give more descriptive names to the source and library variables and split
diego
parents:
22526
diff
changeset
|
17 $(LIBNAME_COMMON): $(OBJS_COMMON) |
8bcff5c7e387
Give more descriptive names to the source and library variables and split
diego
parents:
22526
diff
changeset
|
18 $(LIBNAME_MPLAYER): $(OBJS_MPLAYER) |
8bcff5c7e387
Give more descriptive names to the source and library variables and split
diego
parents:
22526
diff
changeset
|
19 $(LIBNAME_MENCODER): $(OBJS_MENCODER) |
8bcff5c7e387
Give more descriptive names to the source and library variables and split
diego
parents:
22526
diff
changeset
|
20 $(LIBNAME_COMMON) $(LIBNAME_MPLAYER) $(LIBNAME_MENCODER): |
21287
f423ce0a1c36
Move common code for generating multiple libraries to mpcommon.mak.
diego
parents:
21259
diff
changeset
|
21 $(AR) r $@ $^ |
f423ce0a1c36
Move common code for generating multiple libraries to mpcommon.mak.
diego
parents:
21259
diff
changeset
|
22 $(RANLIB) $@ |
f423ce0a1c36
Move common code for generating multiple libraries to mpcommon.mak.
diego
parents:
21259
diff
changeset
|
23 |
21259
92b122592776
Merge common parts of all Makefiles into one file included by all.
diego
parents:
diff
changeset
|
24 clean:: |
26113 | 25 rm -f *.o *.a *.ho *~ |
21259
92b122592776
Merge common parts of all Makefiles into one file included by all.
diego
parents:
diff
changeset
|
26 |
92b122592776
Merge common parts of all Makefiles into one file included by all.
diego
parents:
diff
changeset
|
27 distclean:: clean |
26432
7f5696224182
per-file dependencies (for the non-recursive parts)
diego
parents:
26430
diff
changeset
|
28 rm -f *.d .depend test test2 |
21259
92b122592776
Merge common parts of all Makefiles into one file included by all.
diego
parents:
diff
changeset
|
29 |
26430
a6a95779d80b
Always generate dependency information. This also allows dropping the
diego
parents:
26412
diff
changeset
|
30 .depend: $(SRCS_COMMON) $(SRCS_MPLAYER) $(SRCS_MENCODER) |
a6a95779d80b
Always generate dependency information. This also allows dropping the
diego
parents:
26412
diff
changeset
|
31 $(MPDEPEND_CMD) > $@ |
21259
92b122592776
Merge common parts of all Makefiles into one file included by all.
diego
parents:
diff
changeset
|
32 |
26432
7f5696224182
per-file dependencies (for the non-recursive parts)
diego
parents:
26430
diff
changeset
|
33 %.d: %.c |
7f5696224182
per-file dependencies (for the non-recursive parts)
diego
parents:
26430
diff
changeset
|
34 $(MPDEPEND_CMD) > $@ |
7f5696224182
per-file dependencies (for the non-recursive parts)
diego
parents:
26430
diff
changeset
|
35 |
26113 | 36 %.ho: %.h |
37 $(CC) $(CFLAGS) -Wno-unused -c -o $@ -x c $< | |
38 | |
39 ALLHEADERS = $(wildcard *.h) | |
40 checkheaders: $(ALLHEADERS:.h=.ho) | |
41 | |
26432
7f5696224182
per-file dependencies (for the non-recursive parts)
diego
parents:
26430
diff
changeset
|
42 # Hack to keep .depend from being generated at the top level unnecessarily. |
7f5696224182
per-file dependencies (for the non-recursive parts)
diego
parents:
26430
diff
changeset
|
43 ifndef DEPS |
7f5696224182
per-file dependencies (for the non-recursive parts)
diego
parents:
26430
diff
changeset
|
44 DEPS = .depend |
7f5696224182
per-file dependencies (for the non-recursive parts)
diego
parents:
26430
diff
changeset
|
45 endif |
7f5696224182
per-file dependencies (for the non-recursive parts)
diego
parents:
26430
diff
changeset
|
46 -include $(DEPS) |
22522 | 47 |
26412 | 48 .PHONY: libs *clean dep depend |