Mercurial > mplayer.hg
annotate common.mak @ 27771:15df1f217e6d
Convert typeof keyword into __typeof__
typeof is a gcc extension and the former is not accepted in C99 without
GNU extensions enabled (e.g. via -fasm).
This fixes compilation on PPC.
author | conrad |
---|---|
date | Sun, 19 Oct 2008 18:56:35 +0000 |
parents | 24e6708e030c |
children | c4913507c4ba |
rev | line source |
---|---|
17627
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
1 # |
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
2 # common bits used by all libraries |
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
3 # |
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
4 |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
5 all: # make "all" default target |
26155 | 6 |
26317 | 7 ifndef SUBDIR |
26246 | 8 vpath %.c $(SRC_DIR) |
9 vpath %.h $(SRC_DIR) | |
10 vpath %.S $(SRC_DIR) | |
26155 | 11 |
12 ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale | |
17627
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
13 |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
14 CFLAGS = -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ |
26671 | 15 -D_ISOC9X_SOURCE -I$(BUILD_ROOT) -I$(SRC_PATH) $(OPTFLAGS) |
17627
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
16 |
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
17 %.o: %.c |
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
18 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< |
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
19 |
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
20 %.o: %.S |
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
21 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< |
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
22 |
24775 | 23 %.ho: %.h |
24 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $< | |
25 | |
26403 | 26 %.d: %.c |
27 $(DEPEND_CMD) > $@ | |
28 | |
29 %.d: %.S | |
30 $(DEPEND_CMD) > $@ | |
31 | |
32 %.d: %.cpp | |
33 $(DEPEND_CMD) > $@ | |
34 | |
26671 | 35 %$(EXESUF): %.c |
36 | |
17627
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
37 install: install-libs install-headers |
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
38 |
19016 | 39 uninstall: uninstall-libs uninstall-headers |
40 | |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
41 .PHONY: all depend dep clean distclean install* uninstall* tests |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
42 endif |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
43 |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
44 CFLAGS += $(CFLAGS-yes) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
45 OBJS += $(OBJS-yes) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
46 ASM_OBJS += $(ASM_OBJS-yes) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
47 CPP_OBJS += $(CPP_OBJS-yes) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
48 FFLIBS := $(FFLIBS-yes) $(FFLIBS) |
26317 | 49 TESTS += $(TESTS-yes) |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
50 |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
51 FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
52 FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(FFLIBS)) $(LDFLAGS) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
53 |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
54 SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) $(CPP_OBJS:.o=.cpp) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
55 OBJS := $(OBJS) $(ASM_OBJS) $(CPP_OBJS) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
56 |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
57 SRCS := $(addprefix $(SUBDIR),$(SRCS)) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
58 OBJS := $(addprefix $(SUBDIR),$(OBJS)) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
59 TESTS := $(addprefix $(SUBDIR),$(TESTS)) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
60 |
26403 | 61 DEP_LIBS:=$(foreach NAME,$(FFLIBS),lib$(NAME)/$($(BUILD_SHARED:yes=S)LIBNAME)) |
62 | |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
63 ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h)) |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
64 checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho)) |
19016 | 65 |
26403 | 66 DEPS := $(OBJS:.o=.d) |
67 depend dep: $(DEPS) | |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
68 |
26403 | 69 CLEANSUFFIXES = *.o *~ *.ho |
70 LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map | |
71 DISTCLEANSUFFIXES = *.d | |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
72 |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
73 define RULES |
26671 | 74 $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o |
75 $(CC) $(FFLDFLAGS) -o $$@ $$^ $(SUBDIR)$(LIBNAME) $(FFEXTRALIBS) | |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
76 |
26671 | 77 $(SUBDIR)%-test.o: $(SUBDIR)%.c |
78 $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^ | |
79 | |
80 $(SUBDIR)%-test.o: $(SUBDIR)%-test.c | |
81 $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^ | |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
82 |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
83 clean:: |
26403 | 84 rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \ |
85 $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) | |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
86 |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
87 distclean:: clean |
26403 | 88 rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \ |
89 $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) | |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
90 endef |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
91 |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
92 $(eval $(RULES)) |
19016 | 93 |
26155 | 94 tests: $(TESTS) |
95 | |
26403 | 96 -include $(DEPS) |