# Makefile -- Makefile for simpleinit-msb
# Created: Sat Dec 26 20:09:40 1992
# Revised: Fri Oct  6 21:37:30 1995 by r.faith@ieee.org
# Copyright 1992, 1993, 1994, 1995 Rickard E. Faith (faith@cs.unc.edu)
# May be distributed under the terms of the GNU GPL.
# butchered 5 Sep 2001 Matthias S. Benkmann <m.s.b@gmx.net>

include ./make_include
include ./mconfig

SUBDIRS=lib sysvtools login-utils

.PHONEY: all install clean now installfifo
all:	defines.h
	@for subdir in $(SUBDIRS); do \
		(cd $$subdir && $(MAKE) $@) || exit 1; \
	done

defines.h make_include:
	./configure

now:
	touch defines.h

$(SUBDIRS): defines.h now
	cd $@ && $(MAKE)

install:
	@if [ "`whoami`" = "root" ]; then umask 022; fi
	@for subdir in $(SUBDIRS); do \
		(cd $$subdir && $(MAKE) $@) || exit 1; \
	done

installfifo:
	$(MAKE) -C login-utils installfifo

clean:
	-rm -f *.o *~ omake conftest conftest.c core defines.h
	@for subdir in $(SUBDIRS); do \
		(cd $$subdir && $(MAKE) $@) || exit 1; \
	done

distclean: make_include clean
	-rm -f defines.h make_include

