# Makefile for /usr/miro/src/bin/probe
#
#/*****************************************************************************
#                Copyright Carnegie Mellon University 1992
#
#                      All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of CMU not be
# used in advertising or publicity pertaining to distribution of the
# software without specific, written prior permission.
#
# CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
# CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
#*****************************************************************************/
#
#

include $(TOPLEVEL)/Makefile.include

PROBE_BIN=$(OBJECT_DIR)/probe
VF_BIN=$(OBJECT_DIR)/vf
IFF2VF_BIN=$(OBJECT_DIR)/iff2vf
CFLAGS=-g -I$(INCLUDE_DIR)
LDFLAGS = -L$(LIB_DIR)

all: $(PROBE_BIN) $(VF_BIN) $(IFF2VF_BIN)

$(PROBE_BIN): $(OBJECT_DIR)/ptest.o $(OBJECT_DIR)/prober.o \
	      $(OBJECT_DIR)/util.o $(OBJECT_DIR)/Tables.o $(OBJECT_DIR)/hash.o
	$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROBE_BIN) $(OBJECT_DIR)/ptest.o \
	      $(OBJECT_DIR)/prober.o $(OBJECT_DIR)/util.o \
	      $(OBJECT_DIR)/Tables.o $(OBJECT_DIR)/hash.o -lmwm

$(OBJECT_DIR)/ptest.o: ptest.c prober.h Tables.h hash.h util.h
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/ptest.o ptest.c

$(OBJECT_DIR)/prober.o: prober.c prober.h Tables.h hash.h util.h
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/prober.o prober.c

$(OBJECT_DIR)/util.o: util.c util.h
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/util.o util.c

$(OBJECT_DIR)/Tables.o: Tables.c Tables.h hash.h
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/Tables.o Tables.c

$(OBJECT_DIR)/hash.o: hash.c hash.h
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/hash.o hash.c

$(VF_BIN): $(OBJECT_DIR)/vf.o $(OBJECT_DIR)/vf_input.o \
	   $(OBJECT_DIR)/vf_msg.o $(OBJECT_DIR)/util.o \
	   $(OBJECT_DIR)/hash.o $(OBJECT_DIR)/list_type.o \
	   $(OBJECT_DIR)/fp2list.o
	cc $(CFLAGS) $(LDFLAGS) -o $(VF_BIN) $(OBJECT_DIR)/vf.o \
	   $(OBJECT_DIR)/vf_input.o $(OBJECT_DIR)/vf_msg.o \
	   $(OBJECT_DIR)/util.o $(OBJECT_DIR)/hash.o \
	   $(OBJECT_DIR)/list_type.o $(OBJECT_DIR)/fp2list.o -lmwm

$(OBJECT_DIR)/vf.o: vf.c vf.h Tables.h hash.h util.h
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/vf.o vf.c

$(OBJECT_DIR)/vf_input.o: vf_input.c vf.h hash.h util.h
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/vf_input.o vf_input.c

$(OBJECT_DIR)/vf_msg.o: vf_msg.c
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/vf_msg.o vf_msg.c

$(OBJECT_DIR)/list_type.o: list_type.c
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/list_type.o list_type.c

$(OBJECT_DIR)/fp2list.o: fp2list.c
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/fp2list.o fp2list.c

$(IFF2VF_BIN): $(OBJECT_DIR)/iff2vf.o $(OBJECT_DIR)/util.o \
	       $(OBJECT_DIR)/list_type.o $(OBJECT_DIR)/fp2list.o
	$(CC) $(CFLAGS) $(LDFLAGS) -o $(IFF2VF_BIN) $(OBJECT_DIR)/iff2vf.o \
	      $(OBJECT_DIR)/util.o $(OBJECT_DIR)/list_type.o \
	      $(OBJECT_DIR)/fp2list.o $(LIB_DIR)/parse.a $(LIB_DIR)/extract.a \
	      -ll -lmwm

$(OBJECT_DIR)/iff2vf.o: iff2vf.h util.h $(INCLUDE_DIR)/parser.h \
			$(INCLUDE_DIR)/parser.g \
			$(INCLUDE_DIR)/extract.h $(INCLUDE_DIR)/list_type.h \
			iff2vf.c
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/iff2vf.o iff2vf.c

$(OBJECT_DIR)/hashtest: $(OBJECT_DIR)/hashtest.o $(OBJECT_DIR)/hash.o
	$(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJECT_DIR)/hashtest \
	      $(OBJECT_DIR)/hashtest.o $(OBJECT_DIR)/hash.o

$(OBJECT_DIR)/hashtest.o: hashtest.c
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/hashtest.o hashtest.c

lint:
	lint ptest.c prober.c util.c Tables.c hash.c > $(OBJECT_DIR)/lint.out

$(OBJECT_DIR)/util_test: $(OBJECT_DIR)/util_test.o $(OBJECT_DIR)/util.o
	$(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJECT_DIR)/util_test \
	      $(OBJECT_DIR)/util_test.o $(OBJECT_DIR)/util.o -lmwm

$(OBJECT_DIR)/util_test.o: util_test.c util.h
	$(CC) $(CFLAGS) -c -o $(OBJECT_DIR)/util_test.o util_test.c

