STATIC=NO

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

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


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


.PHONY: clean veryclean


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

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


clean :
	-rm obj/*.o core

veryclean : clean
	-rm bin/main