# melon Makefile
#
# Copyright(C) 2001-2002 Elisa Manara <e@entropika.net>
# This code is released under the GPL License version 2 */

.SUFFIXES:
.SUFFIXES: .c .o

SHELL= /bin/sh
CC= %CC%
CFLAGS= -Wall -O2 -g 
GTK_FLAGS= %GTK_FLAGS%
GTK_LIBS= %GTK_LIBS%

CP= %CP%
MKDIR= %MKDIR%
CP_FLAGS= -dpR
DEST_DATA_DIR= %DIR_DATA%
DATA_DIRS= pix au voc
BIN_DIR= %BIN_DIR%

PROGRAMS= melon
MELON_OBJECTS= melon.o menu.o pix_selection.o mbox.o mbox_selection.o audio.o position.o gtk.o interval.o status.o colors.o signal.o my_strsep.o

all: .depend melon success

.depend:
	@$(CC) $(GTK_FLAGS) -MM *.c > .depend
	@echo Making dependences

.c.o:
	$(CC) -I. $(CFLAGS) $(GTK_FLAGS) -c $< -o $@

melon: $(MELON_OBJECTS)
	$(CC) $(LDFLAGS) $(GTK_LIBS) $^ -o $@

strip:
	strip $(PROGRAMS)
	@ls -l $(PROGRAMS)

install:
	$(MKDIR) -p $(DEST_DATA_DIR)
	$(CP) $(CP_FLAGS) $(DATA_DIRS) $(DEST_DATA_DIR)
	$(CP) $(CP_FLAGS) $(PROGRAMS) $(BIN_DIR)

clean:
	rm -f Makefile def.h *.o .depend $(PROGRAMS)

success:
	@echo
	@echo Compilation successful!
	@echo Now you can type "make install"

distclean:
mostlyclean:

dist: clean

ifeq (.depend,$(wildcard .depend))
include .depend
endif
