#
# Copyright (c) 1998, Guylhem AZNAR <guylhem@oeil.qc.ca>
#

@MAKEFILEDEFINES@

.PHONY: install.pix install.man install.bin uninstall

all:            $(PROG)

install:	install.bin install.man install.pix

install.bin:	$(PROG)
		$(STRIP) $(PROG)
		$(INSTALL_DIR) $(AFTER_BIN_DIR)
		$(INSTALL_PROGRAM) $(PROG) $(AFTER_BIN_DIR)

install.man:
		$(INSTALL_DIR) $(AFTER_MAN_DIR)
		$(INSTALL_DATA) $(PROG).man $(AFTER_MAN_DIR)/$(PROG).1x
		$(INSTALL_DIR) $(AFTER_RCMAN_DIR)
		$(INSTALL_DATA) asmailrc.man $(AFTER_RCMAN_DIR)/asmailrc.5x

install.pix:
		$(INSTALL_DIR) $(AFTER_SHAREDIR)
		$(INSTALL_DIR) $(AFTER_PIXDIR)
		$(INSTALL_DATA) pixmaps/cloud-e/* $(AFTER_PIXDIR)
		$(INSTALL_DIR) $(AFTER_SOUNDDIR)
		$(INSTALL_DATA) sounds/* $(AFTER_SOUNDDIR)

uninstall:
		$(RMF) $(AFTER_BIN_DIR)/$(PROG)
		$(RMF) $(AFTER_MAN_DIR)/$(PROG).1x
		$(RMF) $(AFTER_RCMAN_DIR)/asmailrc.5x
		$(RMF) -r $(AFTER_SHAREDIR)

clean:
		$(RMF) $(PROG) *.o *~ *% *.bak \#* core

distclean:
		$(RMF) $(PROG) config.cache config.log config.status Makefile.bak Makefile config.h configure.h *.o *~ *% *.bak \#* core autoconf/Makefile.common autoconf/Makefile.common.lib autoconf/Makefile.defines

indent:
		SRCS=`echo "$(OBJS) " | sed "s/.o /.c /g"`; \
		for i in $$SRCS; do \
		  if (indent < $$i > /tmp/$$i); then \
		    mv /tmp/$$i $$i; \
		  fi; \
		done

$(PROG):        $(OBJS)
		$(CC) $(OBJS) $(LIBRARIES) $(EXTRA_LIBRARIES) -o $(@)

.c.o:
		$(CC) $(CCFLAGS) $(EXTRA_DEFINES) $(INCLUDES) $(EXTRA_INCLUDES) -c $*.c

#
# End of Make.common
#
