aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile61
1 files changed, 12 insertions, 49 deletions
diff --git a/Makefile b/Makefile
index 9d6ec3a46d..f4057c538c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+MAIN_MAKEFILE=1
include config.mak
vpath %.c $(SRC_PATH)
@@ -7,50 +8,6 @@ vpath %.asm $(SRC_PATH)
vpath %.v $(SRC_PATH)
vpath %.texi $(SRC_PATH)
-ifndef V
-Q = @
-ECHO = printf "$(1)\t%s\n" $(2)
-BRIEF = CC AS YASM AR LD HOSTCC
-SILENT = DEPCC YASMDEP RM RANLIB
-MSG = $@
-M = @$(call ECHO,$(TAG),$@);
-$(foreach VAR,$(BRIEF), \
- $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
-$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
-$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL))
-endif
-
-ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
-
-IFLAGS := -I. -I$(SRC_PATH)
-CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
-CFLAGS += $(ECFLAGS)
-CCFLAGS = $(CFLAGS)
-YASMFLAGS += $(IFLAGS) -Pconfig.asm
-HOSTCFLAGS += $(IFLAGS)
-LDFLAGS := $(ALLFFLIBS:%=-Llib%) $(LDFLAGS)
-
-define COMPILE
- $($(1)DEP)
- $($(1)) $(CPPFLAGS) $($(1)FLAGS) $($(1)_DEPFLAGS) -c $($(1)_O) $<
-endef
-
-COMPILE_C = $(call COMPILE,CC)
-COMPILE_S = $(call COMPILE,AS)
-
-%.o: %.c
- $(COMPILE_C)
-
-%.o: %.S
- $(COMPILE_S)
-
-%.ho: %.h
- $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
-
-%.ver: %.v
- $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
-
-%.c %.h: TAG = GEN
PROGS-$(CONFIG_FFMPEG) += ffmpeg
PROGS-$(CONFIG_FFPLAY) += ffplay
@@ -58,6 +15,7 @@ PROGS-$(CONFIG_FFPROBE) += ffprobe
PROGS-$(CONFIG_FFSERVER) += ffserver
PROGS := $(PROGS-yes:%=%$(EXESUF))
+PROGS_G = $(PROGS-yes:%=%_g$(EXESUF))
OBJS = $(PROGS-yes:%=%.o) cmdutils.o
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
HOSTPROGS := $(TESTTOOLS:%=tests/%)
@@ -66,6 +24,7 @@ TOOLS-$(CONFIG_ZLIB) += cws2fws
BASENAMES = ffmpeg ffplay ffprobe ffserver
ALLPROGS = $(BASENAMES:%=%$(EXESUF))
+ALLPROGS_G = $(BASENAMES:%=%_g$(EXESUF))
ALLMANPAGES = $(BASENAMES:%=%.1)
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
@@ -88,6 +47,10 @@ FF_DEP_LIBS := $(DEP_LIBS)
all: $(PROGS)
+$(PROGS): %$(EXESUF): %_g$(EXESUF)
+ $(CP) $< $@
+ $(STRIP) $@
+
$(TOOLS): %$(EXESUF): %.o
$(LD) $(LDFLAGS) -o $@ $< $(ELIBS)
@@ -117,10 +80,10 @@ endef
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
ffplay.o: CFLAGS += $(SDL_CFLAGS)
-ffplay$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
-ffserver$(EXESUF): LDFLAGS += $(FFSERVERLDFLAGS)
+ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
+ffserver_g$(EXESUF): LDFLAGS += $(FFSERVERLDFLAGS)
-$(PROGS): %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
+%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
OBJDIRS += tools
@@ -168,7 +131,7 @@ uninstall-data:
$(RM) -r "$(DATADIR)"
clean::
- $(RM) $(ALLPROGS)
+ $(RM) $(ALLPROGS) $(ALLPROGS_G)
$(RM) $(CLEANSUFFIXES)
$(RM) $(TOOLS)
$(RM) $(CLEANSUFFIXES:%=tools/%)
@@ -178,7 +141,7 @@ distclean::
$(RM) config.* .version version.h libavutil/avconfig.h
config:
- $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
+ $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
include $(SRC_PATH)/doc/Makefile
include $(SRC_PATH)/tests/Makefile