# 
# Prospect: a developer's system profiler.
# System Tests: symbol discrimination.
#
# COPYRIGHT (C) 2001-2004 Hewlett-Packard Company
#
# Author: Bob Montgomery, HP
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#

# $Id: Makefile,v 1.2 2004/01/09 20:29:28 type2 Exp $

SUBCOUNT=20
CFLAGS=-O2

run: progs
	./symstest.sh

progs: syms symsd

symsd: syms.o libsubs.so
	gcc $(CFLAGS) -o $@ -L . -Wl,-rpath,. syms.o -lsubs

syms: syms.o subs.o
	gcc $(CFLAGS) -o syms syms.o subs.o

syms.o: syms.c
	gcc $(CFLAGS) -c syms.c

subs.o: subs.c
	gcc $(CFLAGS) -c subs.c

libsubs.so: subs.o
	# -s to strip
	ld -shared -o $@ subs.o

subs.c: gen
	gen $(SUBCOUNT) > subs.c

gen: gen.c
	gcc $(CFLAGS) -o gen gen.c

distclean:
clean:
	-rm syms symsd gen subs.c
	-rm syms.o subs.o
	-rm libsubs.so
	-rm cmd.log
	-rm test*.out

