Niranjan Yadla | 19336af | 2018-04-19 12:19:27 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2018 Cadence Design Systems, Inc. |
| 3 | # |
| 4 | # Permission is hereby granted, free of charge, to any person obtaining |
| 5 | # a copy of this software and associated documentation files (the |
| 6 | # "Software"), to use this Software with Cadence processor cores only and |
| 7 | # not with any other processors and platforms, subject to |
| 8 | # the following conditions: |
| 9 | # |
| 10 | # The above copyright notice and this permission notice shall be included |
| 11 | # in all copies or substantial portions of the Software. |
| 12 | # |
| 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 14 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 15 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 16 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 17 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 18 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 19 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 20 | # |
| 21 | |
| 22 | |
| 23 | .PHONY: all install clean HIKEY960 |
| 24 | |
| 25 | NOSTRIP = 1 |
| 26 | XF_TRACE = 1 |
| 27 | |
| 28 | ROOTDIR = .. |
| 29 | CODEC_NAME = hikey |
| 30 | |
| 31 | PLUGINO2OBJS = |
| 32 | PLUGINLIBS = |
| 33 | PLUGININCLUDES = |
| 34 | |
| 35 | XA_MP3_DECODER ?= 0 |
| 36 | XA_VORBIS_DECODER ?= 1 |
| 37 | XA_MIXER ?= 1 |
| 38 | XA_PCM ?= 1 |
| 39 | |
| 40 | |
| 41 | vpath %.c $(ROOTDIR)/ipc/xt-shmem/hikey |
| 42 | vpath %.c $(ROOTDIR)/ipc/xt-shmem |
| 43 | vpath %.c $(ROOTDIR)/core/util |
| 44 | vpath %.c $(ROOTDIR)/core/util/gdbstub |
| 45 | vpath %.c $(ROOTDIR)/core |
| 46 | vpath %.c $(ROOTDIR)/app |
| 47 | vpath %.c $(ROOTDIR)/audio |
| 48 | |
| 49 | vpath %.S $(ROOTDIR)/ipc/xt-shmem/hikey |
| 50 | vpath %.S $(ROOTDIR)/core/util/gdbstub |
| 51 | |
| 52 | vpath %.c $(ROOTDIR)/plugins/cadence/mixer |
| 53 | |
| 54 | LIBXAFASMOBJS = \ |
| 55 | reset.o \ |
| 56 | int_vector.o \ |
| 57 | arch_hifi330.o \ |
| 58 | gdbstub-entry.o |
| 59 | |
| 60 | LIBXAFO2OBJS = \ |
| 61 | cpu_c.o \ |
| 62 | dsp_debug.o \ |
| 63 | dsp_comm.o \ |
| 64 | mutex.o \ |
| 65 | rbtree.o \ |
| 66 | xf-core.o \ |
| 67 | xf-io.o \ |
| 68 | xf-mem.o \ |
| 69 | xf-msg.o \ |
| 70 | xf-sched.o \ |
| 71 | xa-factory.o \ |
| 72 | xf-shmem.o \ |
| 73 | tinyvprintf.o \ |
| 74 | xf-isr.o \ |
| 75 | gdbstub.o \ |
| 76 | xa-class-base.o \ |
| 77 | xa-class-audio-codec.o \ |
| 78 | xa-class-mixer.o \ |
| 79 | xf-main.o |
| 80 | |
| 81 | ifeq ($(XF_TRACE),1) |
| 82 | CFLAGS += -DXF_TRACE=1 |
| 83 | CFLAGS += -DXAF_PROFILE_DSP=1 |
| 84 | endif |
| 85 | |
| 86 | ifeq ($(XA_MP3_DECODER),1) |
| 87 | vpath %.c $(ROOTDIR)/plugins/cadence/mp3_dec |
| 88 | CFLAGS += -DXA_MP3_DECODER=1 |
| 89 | PLUGINO2OBJS += xa-mp3-decoder.o |
| 90 | PLUGINLIBS += $(ROOTDIR)/plugins/cadence/mp3_dec/lib/hifi2/xa_mp3_dec.a |
| 91 | PLUGININCLUDES += -I$(ROOTDIR)/plugins/cadence/mp3_dec |
| 92 | endif |
| 93 | |
| 94 | ifeq ($(XA_PCM),1) |
| 95 | vpath %.c $(ROOTDIR)/plugins/cadence/pcm_proc |
| 96 | CFLAGS += -DXA_PCM=1 |
| 97 | PLUGINO2OBJS += xa-pcm.o |
| 98 | PLUGINLIBS += |
| 99 | PLUGININCLUDES += -I$(ROOTDIR)/plugins/cadence/pcm_proc |
| 100 | endif |
| 101 | |
| 102 | ifeq ($(XA_VORBIS_DECODER),1) |
| 103 | vpath %.c $(ROOTDIR)/plugins/cadence/vorbis_dec |
| 104 | CFLAGS += -DXA_VORBIS_DECODER=1 |
| 105 | PLUGINO2OBJS += xa-vorbis-decoder.o |
| 106 | PLUGINLIBS += $(ROOTDIR)/plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a |
| 107 | PLUGININCLUDES += -I$(ROOTDIR)/plugins/cadence/vorbis_dec |
| 108 | endif |
| 109 | |
| 110 | ifeq ($(XA_MIXER),1) |
| 111 | vpath %.c $(ROOTDIR)/plugins/cadence/mixer |
| 112 | CFLAGS += -DXA_MIXER=1 |
| 113 | PLUGINO2OBJS += xa-mixer.o |
| 114 | PLUGINLIBS += |
| 115 | PLUGININCLUDES += -I$(ROOTDIR)/plugins/cadence/mixer |
| 116 | endif |
| 117 | |
| 118 | LIBO2OBJS = $(LIBXAFO2OBJS) $(LIBMP3DECO2OBJS) $(LIBMIXERO2OBJS) $(PLUGINO2OBJS) |
| 119 | LIBASMOBJS = $(LIBXAFASMOBJS) |
| 120 | |
| 121 | INCLUDES += \ |
| 122 | -I$(ROOTDIR)/include \ |
| 123 | -I$(ROOTDIR)/include/audio \ |
| 124 | -I$(ROOTDIR)/include/sys/xt-shmem \ |
| 125 | -I$(ROOTDIR)/include/sys/xt-shmem/board-hikey \ |
| 126 | -I$(ROOTDIR)/plugins/cadence/mp3_dec |
| 127 | |
| 128 | INCLUDES += $(PLUGININCLUDES) |
| 129 | |
| 130 | LDFLAGS += -nostdlib -lhal -lhandlers-board -lc -lgcc |
| 131 | LDFLAGS += -mlsp="./hifi_hikey_lsp" |
| 132 | |
| 133 | HIKEY960: $(CODEC_NAME) |
| 134 | |
| 135 | include $(ROOTDIR)/build_hikey/common.mk |