.PHONY: libstatic libdynamic all clean veryclean install

ObjetsLib=PpmMaker1.o PpmMaker2.o
Objets=main.o ${ObjetsLib} 


all : libstatic libdynamic main main-static main-dynamic


main : ${Objets}
	gcc -o $@ ${Objets}

%.o : %.c 
	gcc -c $^


libstatic : libPpmMaker.a

libPpmMaker.a : ${ObjetsLib}
	ar -rv $@ $^ 


libdynamic : libPpmMaker.so

libPpmMaker.so : ${ObjetsLib}
	gcc -o $@ -shared $^


main-static : libPpmMaker.a main.o
	gcc -o $@ main.o -static -L. -lPpmMaker

main-dynamic : libPpmMaker.so main.o
	gcc -o $@ main.o -L. -lPpmMaker


clean:
	-rm *.o

veryclean: clean
	-rm main main-static main-dynamic libPpmMaker.*

install: all
	-cp libPpmMaker.* ../LibrairiePpm/lib
	-cp main main-static main-dynamic ../LibrairiePpm/bin
	-cp PpmMaker.h ../LibrairiePpm/include