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