# Extended Module Player Makefile.rules.in
# $Id: Makefile.rules.in,v 1.19 2001/01/20 01:51:28 claudio Exp $

VERSION	= 2.0.4d
DATE	= Fri Jun 14 20:06:08 CEST 2002

DEST_DIR=
prefix	= $(DEST_DIR)@prefix@
exec_prefix= $(DEST_DIR)@prefix@
BIN_DIR	= @bindir@
LIB_DIR = @libdir@
MAN_DIR	= @mandir@/man1

CC	= @CC@
CFLAGS	= -c @CFLAGS@ @DEFS@ @CINCS@
LD	= @CC@
LDFLAGS	= -o$@ @LDFLAGS@
RANLIB	= @RANLIB@
INSTALL	= @INSTALL@
LIBS	= @LIBS@ $(XLIBS)
SHELL	= /bin/sh
PLATFORM= @PLATFORM@

DRIVERS	= @DRIVERS@
MIXER	= @MIXER@
PLUGIN	= @PLUGIN@
DYNDRV	= @DYNDRV@

X_INC	= @X_CFLAGS@
X_LIB	= @X_LIBS@ @X_EXTRA_LIBS@
X_XMP	= @X_XMP@

.SUFFIXES: .c .o .a .S .so

.c.o:
	$(CC) $(CFLAGS) $(XCFLAGS) -o $*.o $<

.S.o:
	$(CC) $(CFLAGS) -o $*.o $<

#.o.so:
#	$(CC) -shared -Wl,-init,_xmp_init -o $*.so $<

dummy:

$(LIB):  CFLAGS += -fPIC

$(LIB): $(LIB)($(OBJS) $(XOBJS))
	$(RANLIB) $(LIB)

depend:
	@echo Building dependencies...
	@$(CC) $(CFLAGS) $(XCFLAGS) -MM -MG $(OBJS:.o=.c) $(XDEPS:.o=.c) >$@

clean distclean::
	rm -f *.o *.so core errlist depend $(CFILES)
ifdef DDIRS
	@for i in $(DDIRS); do \
		(cd $$i; [ -f Makefile ] && $(MAKE) $@) \
	done; true
endif

distclean::
	rm -f $(DCFILES)

install::
ifdef DDIRS
	@for i in $(DDIRS); do \
		(cd $$i; [ -f Makefile ] && $(MAKE) $@) \
	done; true 
endif

whatsout::
	@rlog -R -L RCS/* | sed 's/.*\/\([^\/]*\),v/\1/'
ifdef DDIRS
	@for i in $(DDIRS); do \
		( cd $$i; \
		if [ -f Makefile ]; then \
			$(MAKE) whatsout; \
		else
			@rlog -R -L RCS/* | sed 's/.*\/\([^\/]*\),v/\1/'; \
		fi; ) \
	done
endif

subdist::
	cp -dp $(DFILES) $(DISTDIR)
ifdef DDIRS
	for i in $(DDIRS); do \
		mkdir $(DISTDIR)/$$i; \
		( cd $$i; \
		if [ -f Makefile ]; then \
			$(MAKE) VERSION=$(VERSION) DISTDIR=../$(DISTDIR)/$$i \
			subdist; \
		else \
			for j in *; do \
				[ -f $$j ] && cp -dp $$j ../$(DISTDIR)/$$i; \
			done; \
		fi; ) \
	done
endif

