#
# Itsy SA1100 Profiling Applications
# Copyright (c) Compaq Computer Corporation, 1999
#
# Use consistent with the GNU GPL is permitted,
# provided that this copyright notice is
# preserved in its entirety in all copies and derived works.
#
# COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
# AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
# FITNESS FOR ANY PARTICULAR PURPOSE.
#
# Author: Carl Waldspurger
#

VERSION=1.1

# includes from "../include/util"
LINUXHOME = ../../../kernel
LINUXHOME = /skiff/jamey/work4/linux/kernel
TOOLSHOME  = ../..

INCLUDES = -I${LINUXHOME}/include -I${TOOLSHOME}/include

PREFIX = arm-linux-

CC      = ${PREFIX}gcc 
LD	= $(PREFIX)gcc
AR      = ${PREFIX}ar
RANLIB  = ${PREFIX}ranlib
STRIP   = ${PREFIX}strip
RM	= /bin/rm -f

CFLAGS	= $(INCLUDES) -O2 -Wall 
LOADLIBES += -L$(TOOLSHOME)/util -lutilities

BINS =  testprof profd imageid
OBJS =  testprof.o profd.o htable_sample.o ihash.o imageid.o

all:	${BINS}

profd:		profd.o htable_sample.o ihash.o

imageid:	imageid.o ihash.o

clean:
	/bin/rm -f ${BINS} ${OBJS}

strip:
	$(STRIP) --strip-unneeded -p ${BINS}

ipkg:	profd imageid
	rm -fr profiling-daemon_$(VERSION)_arm.ipk
	mkdir -p ipkg/usr/sbin ipkg/usr/bin
	cp profd imageid ipkg/usr/sbin
	cp ../utilities/iprof ../utilities/iscan ipkg/usr/bin	
	echo "Package: profiling-daemon" > control
	echo "Priority: optional" >> control
	echo "Version: " ${VERSION} >> control
	echo "Architecture: arm" >> control
	echo "Maintainer: Debby Wallach <debby.wallach@compaq.com>" >> control
	echo "Packager: Jamey Hicks <jamey.hicks@compaq.com>" >> control
	echo "Depends:" >> control
	echo "Description: Daemon for the sampling profile for ARM Linux" >> control
	mkdir -p ipkg/CONTROL; mv control ipkg/CONTROL
	ipkg-build ipkg
	rm -fr ipkg
