STATIC=NO

SOURCES=$(shell ls *.c)
OBJETS=$(patsubst %.c, %.o, ${SOURCES})

LIBS=-lPpmMaker -lm
LLIBS=-L../../LibrairiePpm/lib/
INC=-I../../LibrairiePpm/include -I../include


ifeq ($(STATIC),YES)
FLAG=-static
else
FLAG=
endif


.PHONY: clean veryclean


main : ${OBJETS}
	gcc ${FLAG} -o $@ ${OBJETS} ${LLIBS} ${LIBS}

%.o : %.c
	gcc -o $@  -c $^  ${INC}


clean :
	-rm *.o core

veryclean : clean
	-rm main