Commit 451db983 authored by Måns Rullgård's avatar Måns Rullgård
Browse files

Simplify static/shared build rules

Originally committed as revision 22394 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 8c5239b3
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
# common bits used by all libraries # common bits used by all libraries
# #
all: # make "all" default target # first so "all" becomes default target
all: all-yes
ifndef SUBDIR ifndef SUBDIR
vpath %.c $(SRC_DIR) vpath %.c $(SRC_DIR)
...@@ -59,6 +60,7 @@ $(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh config.mak ...@@ -59,6 +60,7 @@ $(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh config.mak
$< $(SRC_PATH) $@ $(EXTRA_VERSION) $< $(SRC_PATH) $@ $(EXTRA_VERSION)
install: install-libs install-headers install: install-libs install-headers
install-libs: install-libs-yes
uninstall: uninstall-libs uninstall-headers uninstall: uninstall-libs uninstall-headers
......
...@@ -7,6 +7,9 @@ LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR) ...@@ -7,6 +7,9 @@ LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
INCINSTDIR := $(INCDIR)/lib$(NAME) INCINSTDIR := $(INCDIR)/lib$(NAME)
THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME) THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)
$(SUBDIR)%-test.o: $(SUBDIR)%.c $(SUBDIR)%-test.o: $(SUBDIR)%.c
$(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c $(CC_O) $^ $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c $(CC_O) $^
...@@ -20,10 +23,6 @@ $(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm ...@@ -20,10 +23,6 @@ $(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
$(OBJS) $(SUBDIR)%.ho $(SUBDIR)%-test.o $(TESTOBJS): CPPFLAGS += -DHAVE_AV_CONFIG_H $(OBJS) $(SUBDIR)%.ho $(SUBDIR)%-test.o $(TESTOBJS): CPPFLAGS += -DHAVE_AV_CONFIG_H
ifdef CONFIG_STATIC ifdef CONFIG_STATIC
all: $(SUBDIR)$(LIBNAME)
install-libs: install-lib$(NAME)-static
$(SUBDIR)$(LIBNAME): $(OBJS) $(SUBDIR)$(LIBNAME): $(OBJS)
$(RM) $@ $(RM) $@
$(AR) rc $@ $^ $(EXTRAOBJS) $(AR) rc $@ $^ $(EXTRAOBJS)
...@@ -32,6 +31,9 @@ endif ...@@ -32,6 +31,9 @@ endif
install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
define RULES define RULES
$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
$$(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS) $$(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
...@@ -46,10 +48,6 @@ distclean:: clean ...@@ -46,10 +48,6 @@ distclean:: clean
$(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
ifdef CONFIG_SHARED ifdef CONFIG_SHARED
all: $(SUBDIR)$(SLIBNAME)
install-libs: install-lib$(NAME)-shared
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME) $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment