# Makefile for CS734 lock manager project

# These are important gcc flags to help you find bugs
CFLAGS = -g -Wall -Wstrict-prototypes -Wmissing-prototypes \
		-Wno-uninitialized -Wshadow -ansi \
		-D__USE_FIXED_PROTOTYPES__ \
		-I../h

OFILES = lmdrive.o lm.o ll1.o ll2.o ht.o wfg.o
# to be replaced by your files--
OLDCYCLETEST_OFILES = adj_glue.o dfs_adj.o dfs_cycles.o 

OFILESALL = $(OFILES) $(OLDCYCLETEST_OFILES)

# executable is called "lma" to avoid name collision with "lm", in use
lma: $(OFILESALL)
	gcc -g -o lma $(OFILESALL)

# example program for LL2 lists
test_ll2: ll2.o test_ll2.o
	gcc -g -o test_ll2 test_ll2.o ll2.o

# exeample program for EDT hash tables
test_ht: ht.o test_ht.o
	gcc -g -o test_ht test_ht.o ht.o

# dependencies for OFILES: these use the default compile rule
# using CFLAGS defined above
# Add to these for any new source files
lmdrive.o: lmdrive.c lm.h
lm.o: lm.c edt.h ll1.h ll2.h ht.h lm.h lm_private.h wfg.h
wfg.o: wfg.c wfg.h wfg_private.h
ll1.o: ll1.c edt.h
ll2.o: ll2.c edt.h
ht.o: ht.c ht.h edt.h
test_ht.o: test_ht.c ht.h edt.h
test_ll2.o: test_ll2.c ll2.h edt.h

# special simple rules for building old-C provided cycletest files
# (no fancy warnings, OK since you won't be coding these anyway)
# replace with your own ANSI C cycletest files, that is, use
# the above CFLAGS in compilation, by simply not having a special
# build rule.
CFLAGS_OLD_C = -g -c -I../h

adj_glue.o: adj_glue.c
	gcc $(CFLAGS_OLD_C) adj_glue.c

dfs_adj.o: dfs_adj.c
	gcc $(CFLAGS_OLD_C) dfs_adj.c

dfs_cycles.o: dfs_cycles.c
	gcc $(CFLAGS_OLD_C) dfs_cycles.c

make clean: 
	rm -f *.o lm



