#
# Makefile for project fdaz
#
# Written by Tormod Tjaberg 
# 
CC=gcc
CFLAGS=-pedantic -Wall  
DEFS=
LD=gcc 
EXE=fdaz.exe

OBJS = fdaz.o arg_func.o fsa.o scandir.o unzip.o rb_funcs.o rbtree.o

$(EXE): $(OBJS)
	$(LD) $(OBJS) -o $@ 

fdaz.o: fdaz.c unzip.h arg_func.h rbtree.h scandir.h fsa.h fdaz.h

	$(CC) $(DEFS) $(CFLAGS) $< -c -o $@

scandir.o: scandir.c scandir.h
	$(CC) $(DEFS) $(CFLAGS) $< -c -o $@

fsa.o: fsa.c fsa.h
	$(CC) $(DEFS) $(CFLAGS) $< -c -o $@

arg_func.o: arg_func.c arg_func.h
	$(CC) $(DEFS) $(CFLAGS) $< -c -o $@

unzip.o: unzip.c unzip.h 
	$(CC) $(DEFS) $(CFLAGS) $< -c -o $@

rb_funcs.o: rb_funcs.c  unzip.h rbtree.h fsa.h fdaz.h
	$(CC) $(DEFS) $(CFLAGS) $< -c -o $@

rbtree.o: rbtree.c rbtree.h
	$(CC) $(DEFS) $(CFLAGS) $< -c -o $@

clean:
	rm $(EXE) *.o
