# $Id: Makefile,v 1.1.1.1 1998/07/12 05:17:15 morgan Exp $
#
# Makefile for building sh_secret agent.
# Written 1998/01/25 by Andrey V. Savochkin <saw@msu.ru>.
#

##############################
# A tunable part goes from here ...
##############################

COPTFLAGS  = -O2
INCLUDEDIR = -I../include
CFLAGS     = $(COPTFLAGS) -pipe -g $(INCLUDEDIR)
#LOADLIBES  = -lg
MKDIR      = install -d -m0755
INSTALLBIN = install -m0755

##############################
# ... to here.
##############################

TITLE     = sh_secret

##############################
# PAMC dependent section goes from here ...
##############################

AGENTDIR  = $(ROOTDIR)/usr/sbin/pamc
AGENT     = $(TITLE).agent

##############################
# ... to here.
##############################

$(AGENT): sh_secret.o md5.o
	$(CC) -g -o $@ $^ $(LOADLIBES)

md5.o: md5.c endian.def
	$(CC) -g -O2 -pipe `cat endian.def` -o $@ -c $<

check_endian: check_endian.c

endian.def: check_endian
	@if ./check_endian; then echo "-DHIGHFIRST"; else echo; fi >endian.def

install: $(AGENT)
	$(MKDIR) $(AGENTDIR)
	$(INSTALLBIN) $(AGENT) $(AGENTDIR)

remove:
	rm -f $(AGENTDIR)/$(AGENT)

clean:
	rm -f $(AGENT) *.o core check_endian endian.def

extraclean: clean
	rm -f *~
