#-------------------------------------------------------------------------------
# Main target
# this file is use to Output xxxx.so
#-------------------------------------------------------------------------------
VAD=VAD1
AMR_FLAGS =-fno-builtin -D$(VAD) -pedantic
CFLAGS += -fPIC -Wall -Wextra -O2 -g $(AMR_FLAGS)
LDFLAGS += -shared
LIBADD +=
RM = rm -f
TARGET_LIB = libwamrnb.so

SRCS = agc.o \
	autocorr.o \
	az_lsp.o \
	bits2prm.o \
	cl_ltp.o \
	convolve.o \
	c1035pf.o \
	d_plsf.o \
          d_plsf_5.o \
          d_gain_c.o \
          d_gain_p.o \
          dec_lag6.o \
          d1035pf.o \
          cor_h.o \
          enc_lag3.o \
          enc_lag6.o \
          g_code.o \
          g_pitch.o \
          int_lpc.o \
          inter_36.o \
          inv_sqrt.o \
          lag_wind.o \
          levinson.o \
          lsp_az.o \
          lsp_lsf.o \
          ol_ltp.o \
          pitch_fr.o \
          pitch_ol.o \
          pow2.o \
          pre_big.o \
          pre_proc.o \
          pred_lt.o \
          preemph.o \
          prm2bits.o \
          pstfilt.o \
          q_gain_c.o \
          q_gain_p.o \
          q_plsf.o \
          q_plsf_5.o \
          lsfwt.o \
          reorder.o \
          residu.o \
          lsp.o \
          lpc.o \
          ec_gains.o \
          spreproc.o \
          syn_filt.o \
          weight_a.o \
          qua_gain.o \
          gc_pred.o \
          q_plsf_3.o \
          post_pro.o \
          dec_lag3.o \
          dec_gain.o \
          d_plsf_3.o \
          d4_17pf.o \
          c4_17pf.o \
          d3_14pf.o \
          c3_14pf.o \
          d2_11pf.o \
          c2_11pf.o \
          d2_9pf.o \
          c2_9pf.o \
          cbsearch.o \
          spstproc.o \
          gain_q.o \
          cod_amr.o \
          dec_amr.o \
          sp_enc.o \
          sp_dec.o \
          ph_disp.o \
          g_adapt.o \
          calc_en.o \
          qgain795.o \
          qgain475.o\
          sqrt_l.o \
          set_sign.o\
          s10_8pf.o \
          bgnscd.o \
          gmed_n.o \
          mac_32.o \
          ex_ctrl.o \
          c_g_aver.o \
          lsp_avg.o \
          int_lsf.o \
          c8_31pf.o \
          d8_31pf.o \
          p_ol_wgh.o \
          ton_stab.o\
          vad1.o \
          dtx_enc.o \
          dtx_dec.o \
          a_refl.o \
          b_cn_cod.o \
          calc_cor.o\
          hp_max.o\
          vadname.o \
          vad2.o \
          r_fft.o \
          lflg_upd.o \
          e_homing.o \
          d_homing.o \
          sid_sync.o \
          count.o \
          basicop2.o \
          oper_32b.o \
          set_zero.o \
          log2.o \
          copy.o \
          wamr.o
OBJS = $(SRCS:.c=.o)

.PHONY: all
all: ${TARGET_LIB}


$(TARGET_LIB): $(OBJS)
	$(CC) ${LDFLAGS} -o $@ $^


.PHONY: clean
clean:
	-${RM} ${TARGET_LIB} ${OBJS}