# differents types de fichiers 
.SUFFIXES:.o.c


#---------------------------------
# INITIALISATION DES VARIABLES 
#---------------------------------

# Indiquer le compilateur (cc ou gcc)
CC=/opt/gnu/bin/gcc

# Les chemins ou se trouvent les fichiers a inclure
INCLUDES=-I/usr/openwin/include -I/usr/dt/include -I/u/essi2/eymery/Projet/ImageMagick/magick


# Options de compilation. Mettre -ggdb (gcc) ou -g pour debugger
CFLAGS=  ${INCLUDES} -ggdb -Wall -c

# Options pour le linker. Mettre -g -static (gcc) ou -g -Bstatic (cc) pour
# debugger
LFLAGS=  -ggdb


# Les librairies avec lesquelle on va effectueller l'edition de liens
LIBDIRS=-L/usr/lib/openwin -L/usr/dt/lib -L/usr/openwin/lib -L/u/essi2/eymery/Projet/ImageMagick/magick -L/u/essi2/eymery/Projet/ImageMagick/jpeg
LIBS= $(LIBDIRS) -lm -lXm -lXt -lX11 -lXext -lMagick -ljpeg

# Les fIchiers sources de l'application
FILES=main.c object.c fileCB.c surfCB.c interface.c graphics.c matrix.c color.c line_command_options.c \
      zbuff.c vimage.c creation.c implicit.c texture.c pr_time.c

#-----------
# LES CIBLES
#-----------

visu:  $(FILES:.c=.o)
	$(CC) $(LFLAGS) -o visu $(FILES:.c=.o) ${LIBS}

clean:
	/bin/rm $(FILES:.c=.o) visu

#-----------------------------------------------------------------------------
# LES REGLES DE DEPENDANCE. Certaines sont implicites mais je recommande d'en 
# mettre une par fichier source. 
#-----------------------------------------------------------------------------

main.o: main.c graphics.h

interface.o: interface.c interface.h

object.o: object.c object.h

fileCB.o: fileCB.c fileCB.h object.h vimage.h graphics.h

surfCB.o: surfCB.c surfCB.h creation.h object.h graphics.h

graphics.o: graphics.c graphics.h zbuff.h object.h color.h param.h vimage.h creation.h implicit.h texture.h

matrix.o: matrix.c matrix.h 

color.o: color.c color.h

zbuff.o: zbuff.c zbuff.h color.h object.h vimage.h texture.h 

vimage.o: vimage.c vimage.h color.h

creation.o: creation.c creation.h matrix.h object.h vimage.h

implicit.o: implicit.c implicit.h object.h matrix.h object.h

texture.o: texture.c texture.h object.h color.h vimage.h

line_command_options.o: line_command_options.c line_command_options.h

pr_time.o: pr_time.c

#---------------------------------
# REGLES DE COMPILATION IMPLICITES
#---------------------------------

.c.o:; ${CC} ${CFLAGS} $*.c

