head	1.5;
access;
symbols
	fedoracore3:1.1.1.1 fedora:1.1.1;
locks; strict;
comment	@# @;


1.5
date	2005.11.08.17.22.33;	author tcheun;	state Exp;
branches;
next	1.4;

1.4
date	2005.06.06.13.47.11;	author tcheun;	state Exp;
branches;
next	1.3;

1.3
date	2005.06.04.08.58.28;	author tcheun1;	state Exp;
branches;
next	1.2;

1.2
date	2005.06.04.07.31.24;	author tcheun1;	state Exp;
branches;
next	1.1;

1.1
date	2005.06.04.07.03.09;	author tcheun1;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2005.06.04.07.03.09;	author tcheun1;	state Exp;
branches;
next	;


desc
@@


1.5
log
@just update
@
text
@#
# Makefile	Makefile for the systemV init suite.
#		Targets:   all      compiles everything
#		           install  installs the binaries (not the scripts)
#                          clean    cleans up object files
#			   clobber  really cleans up
#
# Version:	@@(#)Makefile  2.83-3  06-Nov-2001  miquels@@cistron.nl
#

CC	= cc
CFLAGS	= -Wall -O2 -D_GNU_SOURCE
LDFLAGS	=
STATIC	= -static

# For Debian we do not build all programs, otherwise we do.
#PROGS	= init halt shutdown killall5 runlevel sulogin utmpdump \
#PROGS	= init halt shutdown killall5 runlevel sulogin last mesg
ifeq ($(DEBIAN),)
PROGS	= init shutdown killall5 runlevel sulogin utmpdump \
		last mesg wall
else
PROGS	= init shutdown killall5 runlevel sulogin last mesg
endif

BIN_OWNER	= root
BIN_GROUP	= root
BIN_COMBO	= $(BIN_OWNER).$(BIN_GROUP)
INSTALL		= install -o $(BIN_OWNER) -g $(BIN_GROUP)
MANDIR		= /usr/share/man

LCRYPT		= -lcrypt

all:		$(PROGS)

#init:		init.o init_utmp.o
init:		init.o init_utmp.o halt.o ifdown.o hddown.o reboot.h
		$(CC) $(LDFLAGS) $(STATIC) -o $@@ init.o init_utmp.o halt.o ifdown.o hddown.o -lsepol -lselinux
#		$(CC) $(LDFLAGS) $(STATIC) -o $@@ init.o init_utmp.o -lsepol -lselinux

#halt:		halt.o ifdown.o hddown.o utmp.o reboot.h
#		$(CC) $(LDFLAGS) -o $@@ halt.o ifdown.o hddown.o utmp.o

last:		last.o oldutmp.h
		$(CC) $(LDFLAGS) -o $@@ last.o

mesg:		mesg.o
		$(CC) $(LDFLAGS) -o $@@ mesg.o

utmpdump:	utmpdump.o
		$(CC) $(LDFLAGS) -o $@@ utmpdump.o

runlevel:	runlevel.o
		$(CC) $(LDFLAGS) -o $@@ runlevel.o

sulogin:	sulogin.o md5_broken.o md5_crypt_broken.o
		$(CC) $(LDFLAGS) $(STATIC) -DWITH_SELINUX -o $@@ $^ $(LCRYPT) -lselinux

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

shutdown:	dowall.o shutdown.o utmp.o reboot.h
		$(CC) $(LDFLAGS) -o $@@ dowall.o shutdown.o utmp.o

bootlogd:	bootlogd.o
		$(CC) $(LDFLAGS) -o $@@ bootlogd.o

sulogin.o:	sulogin.c 
		$(CC) -c $(CFLAGS) -DWITH_SELINUX sulogin.c

init.o:		init.c init.h set.h reboot.h
		$(CC) -c $(CFLAGS) -DWITH_SELINUX init.c

utmp.o:		utmp.c init.h
		$(CC) -c $(CFLAGS) utmp.c

init_utmp.o:	utmp.c init.h
		$(CC) -c $(CFLAGS) -DINIT_MAIN utmp.c -o init_utmp.o

md5_broken.o: md5.c
		$(CC) $(CFLAGS) -D'MD5Name(x)=Broken##x' -c $< -o $@@

md5_crypt_broken.o: md5_crypt.c
		$(CC) $(CFLAGS) -D'MD5Name(x)=Broken##x' -c $< -o $@@

cleanobjs:
		rm -f *.o *.bak

clean:		cleanobjs
		@@echo Type \"make clobber\" to really clean up.

clobber:	cleanobjs
		rm -f $(PROGS)

distclean:	clobber

install:
#		$(INSTALL) -m 755 halt init killall5 sulogin \
		$(INSTALL) -m 755 init killall5 sulogin \
			runlevel shutdown $(ROOT)/sbin
		# These are not installed by default
ifeq ($(DEBIAN),)
		$(INSTALL) -m 755 utmpdump wall $(ROOT)/usr/bin
endif
		# $(INSTALL) -m 755 etc/initscript.sample $(ROOT)/etc
		$(INSTALL) -m 755 mesg last $(ROOT)/usr/bin
#		cd $(ROOT)/sbin; ln -sf halt reboot; chown $(BIN_COMBO) reboot
#		cd $(ROOT)/sbin; ln -sf halt poweroff; chown $(BIN_COMBO) poweroff
		cd $(ROOT)/sbin; ln -sf init halt; chown $(BIN_COMBO) reboot
		cd $(ROOT)/sbin; ln -sf init reboot; chown $(BIN_COMBO) reboot
		cd $(ROOT)/sbin; ln -sf init poweroff; chown $(BIN_COMBO) poweroff
		cd $(ROOT)/sbin; ln -sf init telinit; chown $(BIN_COMBO) telinit
		cd $(ROOT)/usr/bin; ln -sf last lastb; chown $(BIN_COMBO) lastb
		$(INSTALL) -m 644 ../man/*.8 $(ROOT)$(MANDIR)/man8
		$(INSTALL) -m 644 ../man/*.5 $(ROOT)$(MANDIR)/man5
ifeq ($(DEBIAN),)
		$(INSTALL) -m 644 ../man/wall.1 $(ROOT)$(MANDIR)/man1
endif
		$(INSTALL) -m 644 ../man/last.1 ../man/lastb.1 ../man/mesg.1 \
			$(ROOT)$(MANDIR)/man1
		#
		# This part is skipped on debian systems, the
		# debian.preinst script takes care of it.
		@@if [ ! -p $(ROOT)/dev/initctl ]; then \
		 echo "Creating /dev/initctl"; \
		 rm -f $(ROOT)/dev/initctl; \
		 mknod -m 600 $(ROOT)/dev/initctl p; fi
@


1.4
log
@make static
@
text
@d36 1
d97 1
a98 4
#		cd $(ROOT)/sbin; ln -sf halt reboot; chown $(BIN_COMBO) reboot
#		cd $(ROOT)/sbin; ln -sf halt poweroff; chown $(BIN_COMBO) poweroff

install:
d107 3
a109 1
		cd $(ROOT)/sbin; ln -sf init halt; chown $(BIN_COMBO) halt
@


1.3
log
@bug in init
@
text
@d14 1
a14 1
STATIC	=
@


1.2
log
@rm halt
@
text
@d36 1
a36 1
init:		init.o init_utmp.o
@


1.1
log
@Initial revision
@
text
@d17 2
d20 1
a20 1
PROGS	= init halt shutdown killall5 runlevel sulogin utmpdump \
d23 1
a23 1
PROGS	= init halt shutdown killall5 runlevel sulogin last mesg
d37 2
a38 1
		$(CC) $(LDFLAGS) $(STATIC) -o $@@ init.o init_utmp.o -lsepol -lselinux
d40 2
a41 2
halt:		halt.o ifdown.o hddown.o utmp.o reboot.h
		$(CC) $(LDFLAGS) -o $@@ halt.o ifdown.o hddown.o utmp.o
d96 4
d101 1
a101 1
		$(INSTALL) -m 755 halt init killall5 sulogin \
d109 3
a111 2
		cd $(ROOT)/sbin; ln -sf halt reboot; chown $(BIN_COMBO) reboot
		cd $(ROOT)/sbin; ln -sf halt poweroff; chown $(BIN_COMBO) poweroff
@


1.1.1.1
log
@import sysvinit_2.84-186
@
text
@@
