# $Source: /hpux/shared/supp//usr/src/cmd/ps/./makefile,v $
# $Revision: 76.1 $            $Author: ssa $
# $State: Exp $               $Locker:  $
# $Date: 95/07/25 19:44:43 $
#
#
# Makefile for the 'ps' command, and other system-info related commands,
# such as top, w, uptime, and readmem.
#
# The command w, a link to uptime, is now installed by the Common Build
# process.  The command readmem is installed (by the Common Build) on
# the s300 only.
#
# "w" now installed by Common Build

MAKE_TARGET = ps readmem top uptime
MAKE_TARGET_M = ps.M readmem.M top.M uptime.M

#SHELL=/usr/bin/sh

FINDMSG  = /usr/bin/findmsg      #  /* DSDe407248 */
GENCAT   = /usr/bin/gencat       #  /* DSDe407248 */

default: $(MAKE_TARGET)

metrics: $(MAKE_TARGET_M)

ps: ps.o
	if ifdef SecureWare || ifdef B1 || ifdef TRUSTED; then	\
	    libs="$$libs -lscmd -lsec -lHcurses";		\
	fi;							\
	$(CC) $@.o -o $@ $$libs;				\
	$(FINDMSG) ps.c > ps.msg; # DSDe407248			\
	$(GENCAT) ps.cat ps.msg

ps.M: ps.c
	$(METRICS) $(CFLAGS) ps.c -o ps.M

uptime: uptime.o
	if ifdef SecureWare || ifdef B1 || ifdef TRUSTED; then	\
	    libs="$$libs -lscmd -lsec -lHcurses";		\
	fi;							\
	$(CC) $@.o -o $@ $$libs

uptime.M: uptime.c
	$(METRICS) $(CFLAGS) uptime.c -o uptime.M

top: top.o find_ttys.o
	$(CC) $@.o find_ttys.o -o $@ -lm -lHcurses

top.M: top.c
	$(METRICS) top.c -o top.M find_ttys.c -lm -lHcurses

readmem: readmem.o
	$(CC) $@.o -o $@

readmem.M: readmem.c
	$(METRICS) $(CFLAGS) -o readmem.M readmem.c

uptime.o: uptime.c
	$(CC) -DW $< -c -o $@

.c.o:
	$(CC) $(CFLAGS) -Wp,-H200000 -DBUILT_ON='"@(#)Built on: '`uname -r`'"' -c $< -o $@

clean:
	rm -f *.o kdefs.h kernelvars.h

clobber:  clean
	rm -f $(MAKE_TARGET) ps.msg ps.cat   # DSDe407248 #
