#
# Makefile for init, shutdown, halt and wall.
# All written by Miquel van Smoorenburg
#

CC	= cc
CFLAGS	= -Wall -D_POSIX_SOURCE -O6
LDFLAGS	= -s

all:		init halt last mesg shutdown wall

init:		init.c

halt:		halt.c

last:		last.c

mesg:		mesg.c

wall:		dowall.o wall.o

shutdown:	dowall.o shutdown.o

dowall.o:	dowall.c

wall.o:		wall.c

shutdown.o:	shutdown.c

install:	all
		@sh install.sh

clean:
		rm -f *.o *.s *.bak init shutdown halt reboot wall \
		last mesg inittab.new

tar:
		@echo Creating tar archive...
		@tar cvf init.tar Makefile Readme brc dowall.c halt.8 \
		halt.c install.sh init.8 init.c inittab inittab.tst \
		inittab.5 last.1 last.c mesg.1 mesg.c rc \
		shutdown.8 shutdown.c wall.1 wall.c
		@echo Compressing...
		@compress init.tar
		@echo Tar archive created

