## $Id: Makefile.am,v 1.26 2011/04/04 09:42:34 aleidinger Exp $

AUTOMAKE_OPTIONS = foreign $(top_srcdir)/ansi2knr

DEFS = @DEFS@ @CONFIG_DEFS@

ECHO ?= echo

nasm_sources = \
	choose_table.nas \
	cpu_feat.nas \
	fft3dn.nas \
	fftsse.nas

if HAVE_NASM
noinst_LTLIBRARIES = liblameasmroutines.la
liblameasmroutines_la_SOURCES = $(nasm_sources)
am_liblameasmroutines_la_OBJECTS = \
	choose_table$U.lo \
	cpu_feat$U.lo \
	fft3dn$U.lo \
	fftsse$U.lo
endif

noinst_HEADERS = nasm.h

INCLUDES = @INCLUDES@ -I$(top_srcdir)/libmp3lame/@CPUTYPE@

SUFFIXES = .nas .lo

EXTRA_liblameasmroutines_la_SOURCES = $(nasm_sources)

CLEANFILES = \
	choose_table.o.lst \
	choose_table.lo.lst \
	cpu_feat.o.lst \
	cpu_feat.lo.lst \
	fft3dn.o.lst \
	fft3dn.lo.lst \
	fftsse.o.lst \
	fftsse.lo.lst

EXTRA_DIST = \
	fft.nas \
	fftfpu.nas \
	ffttbl.nas \
	scalar.nas

NASM = @NASM@
NASMFLAGS=@NASM_FORMAT@ -i $(top_srcdir)/libmp3lame/@CPUTYPE@/

.nas.o: $< nasm.h
	$(NASM) $(NASMFLAGS) $< -o $@ -l $@.lst

.nas.lo: $< nasm.h
	mkdir -p .libs
	$(ECHO) '# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)' >$@
	$(ECHO) "pic_object='.libs/$*.o'" >>$@
	$(ECHO) "non_pic_object='.libs/$*.o'" >>$@
	$(NASM) $(NASMFLAGS) $< -o .libs/$*.o -l $@.lst

COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
	$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
	$(AM_LDFLAGS) $(LDFLAGS) -o $@


#$(OBJECTS): libtool
#libtool: $(LIBTOOL_DEPS)
#	$(SHELL) $(top_builddir)/config.status --recheck
