# Makefile
# Solitair V1.1

CFLAGS=-O3 -DPUTENV -Wall

all:    www

build:	table
	./solitair
	./pack_disktable soltable
	./gen_array
	make www

table: 	write gen_array pack_disktable

# build a version that only calculates the number of solutions from
# the starting position
calc:   symsol.c solitair.c solitair.h 
	gcc $(CFLAGS) -o solitair solitair.c symsol.c

# build a version that calculates and writes to disk the hash table
write: 	solitair.c solitair.h  symsol.c
	gcc -DWriteTable $(CFLAGS) -o solitair solitair.c symsol.c

# build a version that does the cgi-bin job but without using a table file
web:    symsol.c solitair.c solitair.h 
	gcc -DWWW $(CFLAGS) -o sol_help solitair.c symsol.c

# build a version that does the cgi-bin job using the table file
www:   symsol.c solitair.c solitair.h  scan_table.c
	gcc -DWWW -DUseIndexTab $(CFLAGS) -o sol_help \
	solitair.c symsol.c scan_table.c

# build the utility that generates the search index for the compressed
# table file
gen_array: gen_array.c 
	gcc $(CFLAGS) -o gen_array gen_array.c

# build the utility that compresses the table file
pack_disktable: pack_disktable.c 
	gcc $(CFLAGS) -o pack_disktable pack_disktable.c
