CC     = @CC@
CFLAGS = @CFLAGS@
LIBS   = @LIBS@
LFLAGS = @LDFLAGS@
AR     = @AR@
RANLIB = @RANLIB@

SRCS =  sffe.c \
	sffe_cmplx_asm.c \
	sffe_cmplx_gsl.c 

OBJS = $(SRCS:.c=.o) @ASM_CMPLX_O@

TLIB = ../lib/libsffe.a

all:	$(TLIB)

asm/cmplx.o: asm/cmplx.asm
	nasm -f @CMPLX_O_TARGET@ asm/cmplx.asm -oasm/cmplx.o

$(TLIB):$(OBJS)
	rm -f $@
	$(AR) rc $@ $(OBJS) @ASM_CMPLX_O@
	$(RANLIB) $@ 

keywords.c: keywords.gperf
	gperf -t -p -D -C -a keywords.gperf > keywords.c

clean:
	rm -f $(TLIB)
	rm -f *.[oas] asm/*.o
	rm -f *~
	rm -f core 

distclean:clean
	rm  Makefile
