# makefile pour la compilation de la bibliotheque TPinformatique

LIBS=-g 
CFLAGS=-g 



all : libtpinfo.a


#sous-bibliotheque hasard

hasard.o : hasard.c hasard.h
	gcc hasard.c -c ${CFLAGS} -Wall


#sous-bibliotheque graphisme

graphisme.o : graphisme.c graphisme.h
	gcc graphisme.c -c ${CFLAGS} `allegro-config --cflags` -Wall

echelles.o : echelles.c echelles.h graphisme.h
	gcc -I.. echelles.c -c ${CFLAGS} `allegro-config --cflags` -Wall


#sous-bibliotheque port_parallele

port_parallele.o : port_parallele.c port_parallele.h
	gcc port_parallele.c -c ${CFLAGS} -Wall


#sous-bibliotheque fichier_population

fichier.o : fichier.c fichier.h
	gcc fichier.c -c ${CFLAGS} -Wall



#creation de la bibliotheque
OBJETS= hasard.o graphisme.o echelles.o port_parallele.o fichier.o 
EN_TETES=hasard.h graphisme.h echelles.h port_parallele.h fichier.h


libtpinfo.a : $(OBJETS)
	ar rvs libtpinfo.a $(OBJETS)


#installation
#BASE_INSTALL= ~/TPInfo-0.2/usr/local
BASE_INSTALL= /usr/local


install : libtpinfo.a $(EN_TETES)
	install -d $(BASE_INSTALL)/include/TPInfo
	install $(EN_TETES) $(BASE_INSTALL)/include/TPInfo
	install -d $(BASE_INSTALL)/lib
	install libtpinfo.a $(BASE_INSTALL)/lib/libtpinfo.a


clean :
	rm -f *.o *~

cleanclean : clean
	rm -f libtpinfo.a

