# # common bits used by all libraries # SRC_DIR = $(SRC_PATH)/$(SUBDIR) VPATH = $(SRC_DIR) BINDIR = $(prefix)/lib/$(PROGNAME)/codecs CFLAGS += -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ -D_ISOC9X_SOURCE -I$(SRC_PATH) \ -I$(SRC_PATH)/libavutil -I$(SRC_PATH)/../mplayerxp/postproc $(OPTFLAGS) #FIXME: This should be in configure/config.mak ifeq ($(TARGET_OS),WIN32) #LDFLAGS = -Wl,--output-def,$(@:.dll=.def),--out-implib,lib$(SLIBNAME:$(SLIBSUF)=.dll.a) LDFLAGS+=--dll --disable-runtime-pseudo-reloc --disable-auto-import --gc-sections --sort-common endif ifeq ($(TARGET_GPROF),yes) CFLAGS+=-p LDFLAGS+=-p endif ifneq ($(TARGET_OS),WIN32) LDFLAGS+=-L${LOCALBASE}/lib -L${X11BASE}/lib -Xlinker -rpath=$(BINDIR) endif ifeq ($(TARGET_ARCH_SPARC64),yes) CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc endif CFLAGS += $(CFLAGS-yes) OBJS += $(OBJS-yes) ASM_OBJS += $(ASM_OBJS-yes) SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) $(CPPOBJS:.o=.cpp) OBJS := $(OBJS) $(ASM_OBJS) $(CPPOBJS) STATIC_OBJS := $(OBJS) $(STATIC_OBJS) SHARED_OBJS := $(OBJS) $(SHARED_OBJS) all: $(LIB) $(SLIBNAME) $(LIB): $(STATIC_OBJS) rm -f $@ $(AR) rc $@ $^ $(EXTRAOBJS) $(RANLIB) $@ $(SLIBNAME): $(SHARED_OBJS) #ifneq ($(TARGET_OS),WIN32) # install -d $(BINDIR) #endif $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $^ $(EXTRALIBS) $(EXTRAOBJS) #ifeq ($(TARGET_OS),WIN32) # -lib /machine:i386 /def:$(@:.dll=.def) #endif %.o: %.c $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< %.o: %.S $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings %.o: %.cpp g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< depend: $(SRCS) $(CC) -MM $(CFLAGS) $^ 1>.depend dep: depend clean:: rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll \ *.lib *.def *.dll.a *.exp distclean: clean rm -f .depend ifeq ($(BUILD_SHARED),yes) INSTLIBTARGETS += install-lib-shared endif ifeq ($(BUILD_STATIC),yes) INSTLIBTARGETS += install-lib-static endif install: install-libs install-headers install-libs: $(INSTLIBTARGETS) install-lib-shared: $(SLIBNAME) install -d $(BINDIR) install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \ $(BINDIR)/$(SLIBNAME) install-lib-static: $(LIB) install -m 644 $(LIB) "$(libdir)" install-headers: # # include dependency files if they exist # ifneq ($(wildcard .depend),) include .depend endif