# Makefile for testhill local search program for SAT
# Copyright (C) 1993 by Fred Annexstein, John Franco, Humberto
# Ortiz-Zuazaga, Manian Swaminathan.
#
NOTANGLE= notangle
NOWEAVE	= noweave -index
TEX	= latex

CC	= gcc
CFLAGS	= -ansi -pedantic $(DEBUG) $(OPTIMIZE) $(WARNINGS)
DEBUG	= -DNDEBUG
#DEBUG	= -DVERBOSE -g $(PROF)
PROF	= #-pg
OPTIMIZE= -O2
WARNINGS= -Wall $(EXTRAWARNINGS)
EXTRAWARNINGS= -Wstrict-prototypes -Wmissing-prototypes -Wimplicit -Wformat -Wconversion

## Noweb make rules
#.SUFFIXES: .nw .tex .dvi .h
#.nw.tex: ;	$(NOWEAVE) $*.nw >$*.tex
#.nw.c: ;	$(NOTANGLE) -L $*.nw >$*.c
#.nw.o: ;	$(NOTANGLE) -L $*.nw >$*.c
#		$(CC) $(CFLAGS) -c $*.c
#.nw.h: ;	$(NOTANGLE) -Rheader $*.nw | cpif $*.h
#.tex.dvi: ;	$(TEX) $*.tex
#.c.o: ;		$(CC) $(CFLAGS) -c $*.c

DOCS=cnf.tex hill.tex
DVIS=cnf.dvi hill.dvi
HDRS=cnf.h hill.h
SRCS=cnf.c hill.c
OBJS=cnf.o cnfparse.o
WEBS=cnf.nw hill.nw

all: testhill
## noweb make rules.
#doc: $(DOCS)
#dvi: $(DOCS) $(DVIS)

testhill: testhill.o hill.o $(OBJS)

## noweb make rules.
#testhill.c: hill.nw
#	$(NOTANGLE) -Rtesthill.c -L $< | cpif $@

## parser make rules.  See the README.
#cnfparse.o: cnfparse.y
#	bison -y cnfparse.y
#	$(CC) $(DEBUG) $(OPTIMIZE) -c y.tab.c
#	mv y.tab.o cnfparse.o
#	rm y.tab.c

# Dependencies
#cnf.c: cnf.nw
#hill.c: hill.nw
#cnf.h: cnf.nw
#hill.h: hill.nw

testhill.o: $(HDRS)
$(OBJS) : $(HDRS)
