CC = @CC@
DEFS = @DEFS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@

GUILE_LIBS = @GUILE_LIBS@
XM_LIBS = @XM_LIBS@
GUILE_CFLAGS = @GUILE_CFLAGS@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
MOTIF_LIBS = @XLIBS@
MOTIF_FLAGS = @XFLAGS@
AUDIO_LIB = @AUDIO_LIB@
XMHTML_LIB = @XMHTML_LIB@
GTKHTML_LIB = @GTKHTML_LIB@
GTKHTML_FLAGS = @GTKHTML_FLAGS@
GSL_LIBS = @GSL_LIBS@
GSL_FLAGS = @GSL_CFLAGS@
GTKEXTRA_LIBS = @GTKEXTRA_LIBS@
GTKEXTRA_FLAGS = @GTKEXTRA_FLAGS@

GX_HEADERS = $(@GX_HEADERS@)
GX_FILES = $(@GX_FILES@)

LDSO_FLAGS = @LDSO_FLAGS@
SO_INSTALL = @SO_INSTALL@
SO_LD = @SO_LD@
A_LD = @A_LD@
A_LD_FLAGS = @A_LD_FLAGS@

SHELL = /bin/sh
top_srcdir = .
DESTDIR =

# this can't work in general -- any of the guile, gsl, motif, and gtk flags might be
#   general (i.e. /usr/local/include) or specific (i.e. /usr/local/include/gtk-2.0)
#   with older versions on the general area (gtk does this...).  We need a way to
#   put the most specific first.

.c.o:
	$(CC) -c $(DEFS) $(GTK_CFLAGS) $(CFLAGS) $(GUILE_CFLAGS) $(MOTIF_FLAGS) $(GSL_FLAGS) $(GTKEXTRA_FLAGS) $(GTKHTML_FLAGS) $<

include makesnd.files

INSTALL = @INSTALL@
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
srcdir = @srcdir@
mandir = @mandir@
VPATH = @srcdir@

main_target: @MAKE_TARGET@

snd: $(SNDLIB_HEADERS) $(SND_HEADERS) $(GX_HEADERS) $(SNDLIB_O_FILES) $(O_FILES) $(GX_FILES)
	$(CC) $(LDFLAGS) $(CFLAGS) $(SNDLIB_O_FILES) $(O_FILES) $(GX_FILES) -o snd $(GUILE_LIBS) $(GTK_LIBS) $(MOTIF_LIBS) $(AUDIO_LIB) $(GSL_LIBS) $(GTKEXTRA_LIBS) $(XMHTML_LIB) $(GTKHTML_LIB) $(LIBS)

xm: 	$(GM_FILES) xen.h
	$(SO_LD) $(GM_FILES) -o $(GM_SO_FILE) $(LDSO_FLAGS) $(XM_LIBS) $(MOTIF_LIBS) $(LIBS)

xg: 	$(GG_FILES) xen.h
	$(SO_LD) $(GG_FILES) -o $(GG_SO_FILE) $(LDSO_FLAGS) $(GTK_LIBS) $(LIBS)

widget: snd_widget.o

snd_widget.o: $(SNDLIB_HEADERS) $(SND_HEADERS) $(GX_HEADERS) $(SNDLIB_O_FILES) $(O_FILES) $(GX_FILES)
	$(LD) -r $(LDFLAGS) $(CFLAGS) $(SNDLIB_O_FILES) $(O_FILES) $(GX_FILES) -o snd_widget.o

include makesnd.back

Makefile: Makefile.in config.status
	./config.status

config.status: configure
	./config.status --recheck

configure: configure.in
	cd $(srcdir); autoconf

