#
# Makefile for init, shutdown, halt and wall.
# All written by Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>.
# 

NAME  = SysVinit-2.50

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

all:		init halt last mesg shutdown wall dump powerd pidof runlevel

init:		init.c

shutdown.o:	shutdown.c

halt:		halt.c
		$(CC) $(LDFLAGS) -N -o $@ $<

last:		last.c

mesg:		mesg.c

dump:		dump.c

powerd:		powerd.c

wall:		dowall.o wall.o
		$(CC) $(CFLAGS) $(LDFLAGS) -o $@ dowall.o wall.o

shutdown:	dowall.o shutdown.o
		$(CC) $(CFLAGS) $(LDFLAGS) -o $@ dowall.o shutdown.o

dowall.o:	dowall.c

wall.o:		wall.c

runlevel:	runlevel.c

pidof:		pidof.c

clean:
		rm -f *.o *.s *.bak init shutdown halt reboot wall \
		last dump mesg powerd pidof runlevel *.tar.Z *.tar.z *.lzh

tgz:
		@echo Creating tar archive...
		@tar cvfz $(NAME).tgz *
		@echo Tar archive created
