#CFLAGS=-DDEBUG
OBJ = bin/mdebug.o bin/mlib.o bin/mstring.o bin/mhash.o bin/mvector.o bin/mlist.o bin/mcurses.o

all: mlib.a main

main: main.cpp mlib.a
	g++ -o main main.cpp -lcurses mlib.a

mlib.a: $(OBJ)
	ar rcs mlib.a $(OBJ)

bin/mdebug.o: ./mdebug.c
	gcc -c ./mdebug.c $(CFLAGS)
	mv mdebug.o bin/
      
bin/mlib.o: ./mlib.c
	gcc -c ./mlib.c $(CFLAGS)
	mv mlib.o bin/

bin/mstring.o: ./mstring.c
	gcc -c ./mstring.c $(CFLAGS)
	mv mstring.o bin/

bin/mhash.o: ./mhash.c
	gcc -c ./mhash.c $(CFLAGS)
	mv mhash.o bin/

bin/mvector.o: ./mvector.c
	gcc -c ./mvector.c $(CFLAGS)
	mv mvector.o bin/

bin/mlist.o: ./mlist.c
	gcc -c ./mlist.c $(CFLAGS)
	mv mlist.o bin/

bin/mcurses.o: ./mcurses.c ./mcurses.h
	gcc -c ./mcurses.c $(CFLAGS)
	mv mcurses.o bin/
   
clean:
	rm -f bin/* mlib.a
 
