NAME	=	slog
MFILES	=	slog.m
CLASSES	=	SLogListener.m
# This next line means you should install this as root.  Otherwise,
# you cannot get the permissions and ownerships right.
INSTALLFLAGS =	-o root -g tty -c -m 6755
INSTALLDIR =	../Stuart.app

CFLAGS	=	-O -Wall $(ARCHITECTURES)
LDFLAGS =	-s
OFILES	=	SLogListener.o slog.o
LIBS	=	-lNeXT_s -lsys_s

$(NAME):	$(OFILES)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $(NAME) $(OFILES) $(LIBS)

clean::
	rm -f *.o slog

install::	$(INSTALLDIR) $(NAME)
	install $(INSTALLFLAGS) $(NAME) $(INSTALLDIR)

.c.o:
	$(CC) $(CFLAGS) -c $*.c -o $(OFILE_DIR)/$*.o
.m.o:
	$(CC) $(CFLAGS) $(OBJCFLAGS) -c $*.m -o $*.o

$(OFILE_DIR):
	mkdirs $(OFILE_DIR)

$(INSTALLDIR):
	mkdirs $(INSTALLDIR)
