# Makefile for getty 2.0.7 distribution
#

SHELL=	/bin/sh
CC=	gcc

CFLAGS=	-O2 -Wall -fpcc-struct-return
LFLAGS=	-s

LIBS=	-ltermcap
LLIBS=	

# where things go
BIN=	/etc
UUBIN=	/etc

# what are we making
SRC=	main.c funcs.c defaults.c table.c 
OBJ=	main.o funcs.o defaults.o table.o 
UUSRC=	uufuncs.c main.c funcs.c defaults.c table.c 
UUOBJ=	uufuncs.o uumain.o funcs.o defaults.o table.o 

# rules

all:	.depend getty uugetty

.depend: Makefile
	@echo "please make depend first"
	@false

getty:	$(OBJ)
	$(CC) $(LFLAGS) -o $@ $(OBJ) $(LIBS) 

uugetty: $(UUOBJ)
	$(CC) $(LFLAGS) -o $@ $(UUOBJ) $(LIBS) 

test: getty
	-mv $(BIN)/testgetty $(BIN)/testgetty-
	mv getty $(BIN)/testgetty

install:
	-mv $(BIN)/getty $(BIN)/getty-
	-mv $(UUBIN)/uugetty $(UUBIN)/uugetty-
	-cp getty $(BIN)
	-cp uugetty $(UUBIN)
	chmod 700 $(BIN)/getty $(UUBIN)/uugetty

clean:
	rm -f *.o core *.out *~ .depend Make.Log Makefile.old

clobber: clean
	rm -f getty uugetty

realclean: clobber

depend:	
	gcc -M *.c > .depend

uumain.o:
	$(CC) $(CFLAGS) -DUUGETTY -c main.c -o uumain.o


# include dependency file
ifeq (.depend,$(wildcard .depend))
include .depend
endif
