# # Makefile for tty class driver for Babylon # # Copyright (C) 1997-2000 SpellCaster Telecommunications Inc. # $Id: Makefile.in,v 1.2 2004/04/05 03:20:48 bcrl Exp $ # Released under the GNU Public License. See LICENSE file for details. TOPDIR=../.. include $(TOPDIR)/common.mak include ../common.kernel.mak LEX = flex YACC = bison -d -y K_OBJ = ldisc.o C_OBJ = chat.o #CFLAGS = -g -Wall -I../../include -DDEBUG CFLAGS = -O2 -Wall -I../../include MODDIR = /lib/modules/`uname -r`/misc/ INSTALL = /usr/bin/install MANDIR = /usr/man SBINDIR = /usr/sbin CHATDIR = /usr/sbin MAN4DIR = /usr/man/man4 MAN5DIR = /usr/man/man5 MAN8DIR = /usr/man/man8 CONFDIR = /etc/babylon all: btty.o battach bttyd ttyctrl chat chat: $(C_OBJ) $(CC) $(C_OBJ) -o $@ ttyctrl: ttyctrl.o ttyctrl.tab.o lex.yy.o ttyctrl.c $(CC) $(CFLAGS) ttyctrl.o ttyctrl.tab.o lex.yy.o -o $@ battach: battach.o ttyd.h battach.c $(CC) $(CFLAGS) battach.o -o $@ bttyd: ttyd.o y.tab.o lex.yy.o modem.o $(CC) $(CFLAGS) ttyd.o lex.yy.o y.tab.o modem.o -o $@ y.tab.o: config.y ttyd.h $(YACC) config.y $(CC) $(CFLAGS) -c y.tab.c -o y.tab.o ttyctrl.tab.o: config.y ttyd.h $(YACC) -b ttyctrl config.y $(CC) $(CFLAGS) -DTTYCTRL -c ttyctrl.tab.c -o ttyctrl.tab.o lex.yy.o: config.l ttyd.h $(LEX) config.l $(CC) $(CFLAGS) -c lex.yy.c -o lex.yy.o modem.o: modem.c ttyd.h $(CC) $(CFLAGS) -c modem.c -o modem.o ttyd.o: ttyd.c ttyd.h version.h $(CC) $(CFLAGS) -c ttyd.c -o ttyd.o ldisc.o: ldisc.c ldisc.h port.h msg.h version.h ifeq (alpha,$(ARCH)) $(CC) -ffixed-8 -mno-fp-regs $(CFLAGS) -I../../include -I/usr/src/linux/include -c -o ldisc.o ldisc.c else $(CC) $(CFLAGS) -I../../include -I/usr/src/linux/include -c -o ldisc.o ldisc.c endif btty.o: $(K_OBJ) ld -r $(K_OBJ) -o $@ clean: $(RM) *.o *.sw? core y.tab.* lex.yy.* ttyctrl.tab.* $(RM) chat btty.o bttyd battach ttyctrl distclean: clean $(RM) Makefile install: all $(INSTALL) -d -o root -g root -m755 $(MODDIR) $(INSTALL) -o root -g root -m644 btty.o $(MODDIR) $(INSTALL) -o root -g root -m755 battach $(SBINDIR) $(INSTALL) -o root -g root -m755 bttyd $(SBINDIR) $(INSTALL) -o root -g root -m755 chat $(CHATDIR) $(INSTALL) -o root -g root -m644 btty.4 $(MAN4DIR) $(INSTALL) -o root -g root -m644 bttyd.conf.5 $(MAN5DIR) $(INSTALL) -o root -g root -m644 bttyd.8 $(MAN8DIR) $(INSTALL) -o root -g root -m644 battach.8 $(MAN8DIR) $(INSTALL) -o root -g root -m644 chat.8 $(MAN8DIR) $(INSTALL) -o root -g root -m644 ttyctrl.8 $(MAN8DIR) if [ ! -e /etc/babylon/bttyd.conf ]; then $(INSTALL) -d -o root -g root -m755 $(CONFDIR); $(INSTALL) -o root -g root -m644 bttyd.conf $(CONFDIR); fi uninstall: clean rm -vf $(MODDIR)/btty.o rm -vf $(SBINDIR)/battach rm -vf $(SBINDIR)/bttyd rebuild: clean all