# makefile for uptime
#
#Uptime v1.1d - Show node uptime, system load, # of users.
#Copyright (C) 1994 Trever Miller 
#
#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., 675 Mass Ave, Cambridge, MA 02139, USA.                   
#
#If you have any suggestions or changes to this program, please send them
#to the author at :
#
#            quics    - tamiller
#            internet - trever.miller@cyberdex.cuug.ab.ca

CC = cc

# You may comment out the "GPL=" line to prevent compiling in 
# the GNU Public License.
#
# NOTE:  If you do this, you MUST provide the GPL in another format to
#        anyone you pass this program along to. (See the file "License")

GPL= -DGPL_INCLUDED

CFLAGS = -O -3 -w3 $(GPL)

SRC = uptime.c show_gpl.c

OBJ = $(SRC:.c=.o)

ERR = $(SRC:.c=.err)

INSTALL_BIN = /usr/local/bin
OWNER       = bin
GROUP       = bin
MODE        = 555

TARGET= uptime

all: $(TARGET)

$(TARGET): $(OBJ)
	$(CC) $(CFLAGS) -o $@ $(OBJ)
	usemsg $(TARGET) $(TARGET).c

install: $(TARGET)
	cp $(TARGET) $(INSTALL_BIN)/uptime
	chmod $(MODE) $(INSTALL_BIN)/uptime
	chown $(OWNER):$(GROUP) $(INSTALL_BIN)/uptime
	ln -is $(INSTALL_BIN)/uptime $(INSTALL_BIN)/ruptime

clean:
	@rm -f $(OBJ)

spotless: clean
	@rm -f $(ERR)
	@rm -f $(TARGET) 

rebuild: spotless all
