1# --------------------------------------------------------------------------------- 2# MM-AUDIO-OSS-8K-AENC-AAC 3# --------------------------------------------------------------------------------- 4 5# cross-compiler flags 6CFLAGS += -Wall 7CFLAGS += -Wundef 8CFLAGS += -Wstrict-prototypes 9CFLAGS += -Wno-trigraphs 10 11# cross-compile flags specific to shared objects 12CFLAGS_SO += -fpic 13 14# required pre-processor flags 15CPPFLAGS := -D__packed__= 16CPPFLAGS += -DIMAGE_APPS_PROC 17CPPFLAGS += -DFEATURE_Q_SINGLE_LINK 18CPPFLAGS += -DFEATURE_Q_NO_SELF_QPTR 19CPPFLAGS += -DFEATURE_LINUX 20CPPFLAGS += -DFEATURE_NATIVELINUX 21CPPFLAGS += -DFEATURE_DSM_DUP_ITEMS 22 23CPPFLAGS += -g 24CPPFALGS += -D_DEBUG 25CPPFLAGS += -Iinc 26 27# linker flags 28LDFLAGS += -L$(SYSROOT)/usr/lib 29 30# linker flags for shared objects 31LDFLAGS_SO := -shared 32 33# defintions 34LIBMAJOR := $(basename $(basename $(LIBVER))) 35LIBINSTALLDIR := $(DESTDIR)usr/lib 36INCINSTALLDIR := $(DESTDIR)usr/include 37BININSTALLDIR := $(DESTDIR)usr/bin 38 39# --------------------------------------------------------------------------------- 40# BUILD 41# --------------------------------------------------------------------------------- 42all: libOmxAacEnc.so.$(LIBVER) mm-aenc-omxaac-test 43 44install: 45 echo "intalling aenc-aac in $(DESTDIR)" 46 if [ ! -d $(LIBINSTALLDIR) ]; then mkdir -p $(LIBINSTALLDIR); fi 47 if [ ! -d $(INCINSTALLDIR) ]; then mkdir -p $(INCINSTALLDIR); fi 48 if [ ! -d $(BININSTALLDIR) ]; then mkdir -p $(BININSTALLDIR); fi 49 install -m 555 libOmxAacEnc.so.$(LIBVER) $(LIBINSTALLDIR) 50 cd $(LIBINSTALLDIR) && ln -s libOmxAacEnc.so.$(LIBVER) libOmxAacEnc.so.$(LIBMAJOR) 51 cd $(LIBINSTALLDIR) && ln -s libOmxAacEnc.so.$(LIBMAJOR) libOmxAacEnc.so 52 install -m 555 mm-aenc-omxaac-test $(BININSTALLDIR) 53 54# --------------------------------------------------------------------------------- 55# COMPILE LIBRARY 56# --------------------------------------------------------------------------------- 57LDLIBS := -lpthread 58LDLIBS += -lstdc++ 59LDLIBS += -lOmxCore 60 61SRCS := src/omx_aac_aenc.cpp 62SRCS += src/aenc_svr.c 63 64libOmxAacEnc.so.$(LIBVER): $(SRCS) 65 $(CC) $(CPPFLAGS) $(CFLAGS_SO) $(LDFLAGS_SO) -Wl,-soname,libOmxAacEnc.so.$(LIBMAJOR) -o $@ $^ $(LDFLAGS) $(LDLIBS) 66 67# --------------------------------------------------------------------------------- 68# COMPILE TEST APP 69# --------------------------------------------------------------------------------- 70TEST_LDLIBS := -lpthread 71TEST_LDLIBS += -ldl 72TEST_LDLIBS += -lOmxCore 73 74TEST_SRCS := test/omx_aac_enc_test.c 75 76mm-aenc-omxaac-test: libOmxAacEnc.so.$(LIBVER) $(TEST_SRCS) 77 $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS) 78 79# --------------------------------------------------------------------------------- 80# END 81# --------------------------------------------------------------------------------- 82