shithub: opus-tools

ref: 009800ebea94f06726dada94cb5562f8b3715620
dir: /Makefile.unix/

View raw version
#Opus-tools should be built with autotools, not this makefile.
#Run ./configure to run autotools/autoconf.
#This makefile exists as a fallback where autotools isn't working.
#CC=gcc
CFLAGS := -DPACKAGE='"opus-tools"' -DVERSION='"0.1.6git"' -DOPUSTOOLS -O2 -g -c -Wall -Wextra -DHAVE_GETOPT_H -DSPX_RESAMPLE_EXPORT= -DRANDOM_PREFIX=opustools -DOUTSIDE_SPEEX -DFLOATING_POINT $(CFLAGS)
INCLUDES := -I../opus/include -I/usr/include/FLAC

ifneq (,$(findstring mingw,$(CC)))
  INCLUDES += -Iwin32
  COMMON_OBJS += win32/unicode_support.o
  CFLAGS += -DHAVE_WINMM
  LIBS += -lwinmm
endif

PROGS := opusenc opusdec opusinfo
all: $(PROGS)

clean:
	rm -f src/*.o win32/*.o $(PROGS) opusrtp

.PHONEY: all clean

.c.o:
	$(CC) $(CFLAGS) $(INCLUDES) $< -o $@

opusenc: src/opus_header.o src/opusenc.o src/resample.o src/audio-in.o src/diag_range.o src/lpc.o src/flac.o $(COMMON_OBJS)
	$(CC) $(LDFLAGS) $^ -o $@ ../opus/.libs/libopus.a -lm -logg -lFLAC $(LIBS)

opusdec: src/opus_header.o src/wav_io.o src/wave_out.o src/opusdec.o src/resample.o src/diag_range.o $(COMMON_OBJS)
	$(CC) $(LDFLAGS) $^ -o $@ ../opus/.libs/libopus.a -lm -logg $(LIBS)

opusinfo: src/opus_header.o src/opusinfo.o src/info_opus.o $(COMMON_OBJS)
	$(CC) $(LDFLAGS) $^ -o $@ -logg $(LIBS)

opusrtp: src/opusrtp.o
	$(CC) $(LDFLAGS) $^ -o $@ ../opus/.libs/libopus.a -logg -lm