#-------------------------------------------------------------------------------
#
# Where to install ezfm files
#
DEST_DIR=/usr/local
#
#
EZFM_MAGIC=$(DEST_DIR)/lib/ezfm/ezfmMagic
EZFM_EXTENSION=$(DEST_DIR)/lib/ezfm/ezfmExtension
#
# Where to install default initialization file
# this file is consulted if ~/.ezfmrc $EZFMRC
# are not found.
#
EZFM_RC=$(DEST_DIR)/lib/ezfm/ezfmrc

#
# Where to install the icons
#
EZFM_ICONS=$(DEST_DIR)/lib/ezfm/ezfmIcons
#
# Where to install the binary
#
BIN=$(DEST_DIR)/bin
#
#----------------------------------------------------------------------------------
#
CC= gcc  -g -DLINUX -I../include

#
#----------------------------------------------------------------------------------
LIBS = libfile.a -L../EZWGL/lib -lEZ -L/usr/X11R6/lib -lX11 -lXext  -ljpeg -ltiff -lpng -lz -lm  -lc
STATICLIBS = libfile.a /usr/local/lib/libEZ.a -L/usr/X11R6/lib -lX11 -lXext  -lm  -lc

SRC= action.c folder.c atoms.c clientMessage.c main.c icons.c items.c finfo.c \
     signal.c info.c infoBtn.c printer.c misc.c mbtnFile.c mbtnView.c mbtnHelp.c popup.c\
     viewFile.c mnt1.c bgn.c trashBtn.c  btnBox.c drives.c toolBox.c extension.c\
     hash.c dnda.c dndb.c dndc.c dndd.c dnde.c dndr.c rc.c state.c mbtnOption.c\
     mbtnSelection.c netscape.c	 transparent.c

OBJECTS = $(SRC:.c=.o)

#----------------------------------------------------------------------------------

all: ezfm  ezfmMagic

ezfm: libfile.a $(OBJECTS)
	$(CC) $(CFLAG)  -o ezfm $(OBJECTS) $(LIBS) $(JPEG_LIB)

ezfm-static: libfile.a $(OBJECTS)
	$(CC) $(CFLAG)  -o ezfm $(OBJECTS) $(STATICLIBS) $(JPEG_LIB)


install: ezfm ezfmMagic ezfmExtension ezfmrc ezfmIcons
	- mkdir $(DEST_DIR)/lib/ezfm
	cp ezfmMagic $(EZFM_MAGIC)
	cp ezfmExtension $(EZFM_EXTENSION)
	cp ezfmrc  $(EZFM_RC)
	- mkdir $(EZFM_ICONS)
	(cd ezfmIcons; tar cf - . | (cd $(EZFM_ICONS); tar xf -))
	- strip ezfm
	cp ezfm $(BIN)

libfile.a:
	(cd libfile; make libfile.a CC="gcc -O"; mv libfile.a ../ )
	- ranlib libfile.a

ezfmMagic:
	(cd libfile/Magdir; make all)


mbtnHelp.c: aboutEZFM.h
	touch mbtnHelp.c


clean:
	$(RM)  libfile.a
	(cd libfile; make clean;)
	$(RM)  $(OBJECTS) ezfm
 
.c.o:
	$(CC) $(CFLAG) -c $<

.o:
	$(CC) $<  -o $@  $(LIBS) $(JPEG_LIB)

.c:
	$(CC) $(CFLAG)  $< -o $@  $(LIBS) $(JPEG_LIB)

#
#  That's all folks,
#
#----------------------------------------------------------------------------------
