diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-05-08 23:50:26 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-05-08 23:50:26 +0300 |
commit | 1db1773ec27fc4e7c9d44ad02ccfa7eaf364ce07 (patch) | |
tree | c5e99bfe0e69cd37fb8ac70fadf00ce54a1cbe3c /subdir.mak | |
parent | f2864e9a072f53c38a04dd7c44392521777dc908 (diff) | |
parent | 86c9fb2e8930de031807513c9b93d47394d2d2fa (diff) | |
download | mpv-1db1773ec27fc4e7c9d44ad02ccfa7eaf364ce07.tar.bz2 mpv-1db1773ec27fc4e7c9d44ad02ccfa7eaf364ce07.tar.xz |
Merge svn changes up to r29277
Diffstat (limited to 'subdir.mak')
-rw-r--r-- | subdir.mak | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/subdir.mak b/subdir.mak index df5bb8a09a..9c02815fe0 100644 --- a/subdir.mak +++ b/subdir.mak @@ -18,7 +18,30 @@ endif INCINSTDIR := $(INCDIR)/lib$(NAME) +THIS_LIB := $(SUBDIR)$($(BUILD_SHARED:yes=S)LIBNAME) + define RULES +$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o + $(CC) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS) + +$(SUBDIR)%-test.o: $(SUBDIR)%.c + $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^ + +$(SUBDIR)%-test.o: $(SUBDIR)%-test.c + $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^ + +$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm + $(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$< + $(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$@ $$< > $$(@:%.o=%.d) + +clean:: + rm -f $(EXAMPLES) $(addprefix $(SUBDIR),*-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \ + $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) + +distclean:: clean + rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \ + $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) + ifdef BUILD_SHARED all: $(SUBDIR)$(SLIBNAME) @@ -39,7 +62,7 @@ endif install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME) install -d "$(SHLIBDIR)" - install -m 755 $(SUBDIR)$(SLIBNAME) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)" + install -m 755 $$< "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)" $(STRIP) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)" cd "$(SHLIBDIR)" && \ $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR) @@ -49,7 +72,7 @@ install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME) install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME) install -d "$(LIBDIR)" - install -m 644 $(SUBDIR)$(LIBNAME) "$(LIBDIR)" + install -m 644 $$< "$(LIBDIR)" $(LIB_INSTALL_EXTRA_CMD) install-headers:: @@ -72,3 +95,8 @@ uninstall-headers:: endef $(eval $(RULES)) + +$(EXAMPLES) $(TESTPROGS): $(THIS_LIB) $(DEP_LIBS) + +examples: $(EXAMPLES) +testprogs: $(TESTPROGS) |