New Makefiles for mkdep script.

This commit is contained in:
Jorrit Herder 2005-06-24 16:21:54 +00:00
parent 042c4ac395
commit 5654996c07
13 changed files with 114 additions and 127 deletions

View File

@ -13,7 +13,7 @@ usage:
@echo "" >&2 @echo "" >&2
build: all build: all
all install clean: all install depend clean:
cd ./libdriver && $(MAKE) $@ cd ./libdriver && $(MAKE) $@
cd ./libpci && $(MAKE) $@ cd ./libpci && $(MAKE) $@
cd ./tty && $(MAKE) $@ cd ./tty && $(MAKE) $@

View File

@ -38,18 +38,9 @@ install: /usr/sbin/drivers/$(DRIVER)
clean: clean:
rm -f $(DRIVER) *.o *.bak rm -f $(DRIVER) *.o *.bak
depend:
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
# dependencies # Include generated dependencies.
a = $d/drivers.h $b/interrupt.h $b/bios.h \ include .depend
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
$m/syslib.h $s/types.h \
$m/utils.h $m/devio.h
l = $d/libdriver/driver.h $d/libdriver/driver.c $m/partition.h $m/u64.h
at_wini.o: $a $l
$(LIBDRIVER): $a $l
$(LIBDRIVER): $s/ioc_disk.h

View File

@ -23,6 +23,8 @@
#include <ibm/ports.h> /* Well-known ports */ #include <ibm/ports.h> /* Well-known ports */
#include <string.h> #include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <limits.h> #include <limits.h>
#include <stddef.h> #include <stddef.h>
#include <errno.h> #include <errno.h>

View File

@ -37,18 +37,9 @@ install: /usr/sbin/drivers/$(DRIVER)
clean: clean:
rm -f $(DRIVER) *.o *.bak rm -f $(DRIVER) *.o *.bak
depend:
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
# dependencies # Include generated dependencies.
a = $d/drivers.h $b/interrupt.h $b/bios.h \ include .depend
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
$m/syslib.h $s/types.h \
$m/utils.h $m/devio.h
l = $d/libdriver/driver.h $d/libdriver/driver.c $m/partition.h $m/u64.h
floppy.o: $a $l
$(LIBDRIVER): $a $l
$(LIBDRIVER): $s/ioc_disk.h

View File

@ -36,12 +36,9 @@ install: /usr/sbin/drivers/$(DRIVER)
clean: clean:
rm -f *.o *.bak $(DRIVER) rm -f *.o *.bak $(DRIVER)
# Dependencies depend:
a = $d/drivers.h $b/interrupt.h $b/bios.h \ /usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libpci/*.c > .depend
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
$m/syslib.h $s/types.h \
$m/utils.h $m/devio.h
fxp.o: $a # Include generated dependencies.
include .depend

View File

@ -8,7 +8,7 @@ b = $i/ibm
m = $i/minix m = $i/minix
# Programs, flags, etc. # Programs, flags, etc.
CC = exec cc CC = exec cc
CFLAGS = -I$i CFLAGS = -I$i
LDFLAGS = -i LDFLAGS = -i
LIBS = -lsys -lutils LIBS = -lsys -lutils
@ -22,16 +22,9 @@ all build install: $(OBJECTS)
clean: clean:
rm -f *.o *.bak rm -f *.o *.bak
depend:
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
# Dependencies # Include generated dependencies.
a = $m/config.h $i/ansi.h $m/type.h $m/com.h $m/callnr.h $s/types.h \ include .depend
$m/const.h $m/syslib.h $m/utils.h \
$i/string.h $i/limits.h $i/stddef.h $i/errno.h \
$m/partition.h $m/u64.h
driver.o: driver.h $a
driver.o: $s/ioc_disk.h
drvlib.o: driver.h $a
drvlib.o: drvlib.h $b/partition.h

View File

@ -22,14 +22,9 @@ all build install: $(OBJECTS)
clean: clean:
rm -f *.o *.bak rm -f *.o *.bak
depend:
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
# Dependencies # Include generated dependencies.
a = $m/config.h $i/ansi.h $m/type.h $m/com.h $m/callnr.h $s/types.h \ include .depend
$m/const.h $m/syslib.h $m/utils.h \
$i/string.h $i/limits.h $i/stddef.h $i/errno.h \
$m/partition.h $m/u64.h
pci.o: $a
pci.o: pci.h
pci.o: pci_amd.h pci_intel.h pci_via.h pci_sis.h

View File

@ -39,17 +39,9 @@ clean:
rm -f $(DRIVER) *.o *.bak rm -f $(DRIVER) *.o *.bak
# dependencies depend:
a = $d/drivers.h $b/interrupt.h $b/bios.h \ /usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
$m/syslib.h $s/types.h \
$m/utils.h $m/devio.h
l = $d/libdriver/driver.h $d/libdriver/driver.c $m/partition.h $m/u64.h
# Include generated dependencies.
memory.o: $a $l include .depend
$(LIBDRIVER): $a $l
$(LIBDRIVER): $s/ioc_disk.h

View File

@ -21,23 +21,21 @@ OBJ = printer.o
all build: $(DRIVER) all build: $(DRIVER)
$(DRIVER): $(OBJ) $(DRIVER): $(OBJ)
$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS) $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
install -S 64w $(DRIVER) # install -S 64w $(DRIVER)
# install with other drivers # install with other drivers
install: /usr/sbin/drivers/$(DRIVER) install: /usr/sbin/drivers/$(DRIVER)
/usr/sbin/drivers/$(DRIVER): $(DRIVER) /usr/sbin/drivers/$(DRIVER): $(DRIVER)
install -o root -cs $? $@ install -o root -c $? $@
# install -o root -cs $? $@
# clean up local files # clean up local files
clean: clean:
rm -f *.o *.bak $(DRIVER) rm -f *.o *.bak $(DRIVER)
# Dependencies depend:
a = $d/drivers.h $b/interrupt.h $b/bios.h \ /usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
$m/syslib.h $s/types.h \
$m/utils.h $m/devio.h
printer.o: $a # Include generated dependencies.
include .depend

View File

@ -12,7 +12,7 @@
* DEV_CLOSE: does nothing * DEV_CLOSE: does nothing
* HARD_INT: interrupt handler has finished current chunk of output * HARD_INT: interrupt handler has finished current chunk of output
* DEV_WRITE: a process wants to write on a terminal * DEV_WRITE: a process wants to write on a terminal
* CANCEL: terminate a previous incomplete system call immediately * CANCEL: terminate a previous incomplete system call immediately
* *
* m_type TTY_LINE PROC_NR COUNT ADDRESS * m_type TTY_LINE PROC_NR COUNT ADDRESS
* |-------------+---------+---------+---------+---------| * |-------------+---------+---------+---------+---------|
@ -99,6 +99,8 @@ PRIVATE vir_bytes user_vir; /* address of remainder of user buf */
PRIVATE int writing; /* nonzero while write is in progress */ PRIVATE int writing; /* nonzero while write is in progress */
PRIVATE int irq_hook_id; /* id of irq hook at kernel */ PRIVATE int irq_hook_id; /* id of irq hook at kernel */
extern int errno; /* error number */
FORWARD _PROTOTYPE( void do_cancel, (message *m_ptr) ); FORWARD _PROTOTYPE( void do_cancel, (message *m_ptr) );
FORWARD _PROTOTYPE( void output_done, (void) ); FORWARD _PROTOTYPE( void output_done, (void) );
FORWARD _PROTOTYPE( void do_write, (message *m_ptr) ); FORWARD _PROTOTYPE( void do_write, (message *m_ptr) );
@ -106,6 +108,25 @@ FORWARD _PROTOTYPE( void prepare_output, (void) );
FORWARD _PROTOTYPE( void do_initialize, (void) ); FORWARD _PROTOTYPE( void do_initialize, (void) );
FORWARD _PROTOTYPE( void reply, (int code,int replyee,int proc,int status)); FORWARD _PROTOTYPE( void reply, (int code,int replyee,int proc,int status));
FORWARD _PROTOTYPE( void do_printer_output, (void) ); FORWARD _PROTOTYPE( void do_printer_output, (void) );
FORWARD _PROTOTYPE( void signal_handler, (int sig) );
/*===========================================================================*
* signal_handler *
*===========================================================================*/
PRIVATE void signal_handler(sig)
int sig; /* signal number */
{
/* Expect a SIGTERM signal when this server must shutdown. */
if (sig == SIGTERM) {
printf("Shutting down PRINTER driver\n");
exit(0);
} else {
printf("PRINTER got unknown signal\n");
}
}
/*===========================================================================* /*===========================================================================*
* printer_task * * printer_task *
@ -115,9 +136,18 @@ PUBLIC void main(void)
/* Main routine of the printer task. */ /* Main routine of the printer task. */
message pr_mess; /* buffer for all incoming messages */ message pr_mess; /* buffer for all incoming messages */
#if DEAD_CODE
printf("PRN: user-level printer driver is up and running\n"); struct sigaction sigact;
/* Install signal handler.*/
sigact.sa_handler = signal_handler;
sigact.sa_mask = ~0; /* block all other signals */
sigact.sa_flags = 0; /* default behaviour */
printf("PRINTER calls sigaction()\n");
if (sigaction(SIGTERM, &sigact, NULL) != OK)
report("PRINTER","warning, sigaction() failed", errno);
#endif
while (TRUE) { while (TRUE) {
receive(ANY, &pr_mess); receive(ANY, &pr_mess);
switch(pr_mess.m_type) { switch(pr_mess.m_type) {

View File

@ -38,17 +38,9 @@ install: /usr/sbin/drivers/$(DRIVER)
clean: clean:
rm -f $(DRIVER) *.o *.bak rm -f $(DRIVER) *.o *.bak
depend:
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libpci/*.c > .depend
# dependencies # Include generated dependencies.
a = $d/drivers.h $b/interrupt.h $b/bios.h \ include .depend
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
$m/syslib.h $s/types.h \
$m/utils.h $m/devio.h
l = $d/libpci/pci.h $d/libpci/pci.c $d/libpci/pci_table.c
rtl8139.o: $a $l
$(LIBPCI): $a $l

View File

@ -36,20 +36,10 @@ clean:
cd keymaps && $(MAKE) -$(MAKEFLAGS) $@ cd keymaps && $(MAKE) -$(MAKEFLAGS) $@
rm -f $(DRIVER) *.o *.bak rm -f $(DRIVER) *.o *.bak
depend:
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
# dependencies
a = $d/drivers.h $b/interrupt.h $b/bios.h \ # Include generated dependencies.
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \ include .depend
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
$m/syslib.h $s/types.h \
$m/utils.h $m/devio.h
tty.o: tty.h $a
console.o: tty.h $a
vidcopy.o: # nothing
keyboard.o: tty.h $a
rs232.o: tty.h $a $i/termios.h $i/signal.h

View File

@ -120,7 +120,7 @@ FORWARD _PROTOTYPE( void reprint, (tty_t *tp) );
FORWARD _PROTOTYPE( void dev_ioctl, (tty_t *tp) ); FORWARD _PROTOTYPE( void dev_ioctl, (tty_t *tp) );
FORWARD _PROTOTYPE( void setattr, (tty_t *tp) ); FORWARD _PROTOTYPE( void setattr, (tty_t *tp) );
FORWARD _PROTOTYPE( void tty_icancel, (tty_t *tp) ); FORWARD _PROTOTYPE( void tty_icancel, (tty_t *tp) );
FORWARD _PROTOTYPE( void tty_init, (tty_t *tp) ); FORWARD _PROTOTYPE( void tty_init, (void) );
#if ENABLE_SRCCOMPAT || ENABLE_BINCOMPAT #if ENABLE_SRCCOMPAT || ENABLE_BINCOMPAT
FORWARD _PROTOTYPE( int compat_getp, (tty_t *tp, struct sgttyb *sg) ); FORWARD _PROTOTYPE( int compat_getp, (tty_t *tp, struct sgttyb *sg) );
FORWARD _PROTOTYPE( int compat_getc, (tty_t *tp, struct tchars *sg) ); FORWARD _PROTOTYPE( int compat_getc, (tty_t *tp, struct tchars *sg) );
@ -160,17 +160,14 @@ PUBLIC void main(void)
/* Main routine of the terminal task. */ /* Main routine of the terminal task. */
message tty_mess; /* buffer for all incoming messages */ message tty_mess; /* buffer for all incoming messages */
register tty_t *tp;
unsigned line; unsigned line;
int s; int s;
char *types[] = {"task","driver","server", "user"}; char *types[] = {"task","driver","server", "user"};
register struct proc *rp; register struct proc *rp;
register tty_t *tp;
/* Initialize the terminal lines. */ /* Initialize the TTY driver. */
for (tp = FIRST_TTY,s=0; tp < END_TTY; tp++,s++) { tty_init();
tp->tty_index = s;
tty_init(tp);
}
/* Get kernel environment (protected_mode, pc_at and ega are needed). */ /* Get kernel environment (protected_mode, pc_at and ega are needed). */
if (OK != (s=sys_getmachine(&machine))) { if (OK != (s=sys_getmachine(&machine))) {
@ -1432,26 +1429,45 @@ register tty_t *tp;
/*==========================================================================* /*==========================================================================*
* tty_init * * tty_init *
*==========================================================================*/ *==========================================================================*/
PRIVATE void tty_init(tp) PRIVATE void tty_init()
tty_t *tp; /* TTY line to initialize. */
{ {
/* Initialize tty structure and call device initialization routines. */ /* Initialize tty structure and call device initialization routines. */
tmr_inittimer(&tp->tty_tmr); register tty_t *tp;
int s;
tp->tty_intail = tp->tty_inhead = tp->tty_inbuf; struct sigaction sigact;
tp->tty_min = 1;
tp->tty_termios = termios_defaults; /* Initialize the terminal lines. */
tp->tty_icancel = tp->tty_ocancel = tp->tty_ioctl = tp->tty_close = for (tp = FIRST_TTY,s=0; tp < END_TTY; tp++,s++) {
tp->tty_index = s;
tmr_inittimer(&tp->tty_tmr);
tp->tty_intail = tp->tty_inhead = tp->tty_inbuf;
tp->tty_min = 1;
tp->tty_termios = termios_defaults;
tp->tty_icancel = tp->tty_ocancel = tp->tty_ioctl = tp->tty_close =
tty_devnop; tty_devnop;
if (tp < tty_addr(NR_CONS)) { if (tp < tty_addr(NR_CONS)) {
scr_init(tp); scr_init(tp);
} else } else
if (tp < tty_addr(NR_CONS+NR_RS_LINES)) { if (tp < tty_addr(NR_CONS+NR_RS_LINES)) {
rs_init(tp); rs_init(tp);
} else { } else {
pty_init(tp); pty_init(tp);
}
} }
#if DEAD_CODE
/* Install signal handler to ignore SIGTERM. */
sigact.sa_handler = SIG_IGN;
sigact.sa_mask = ~0; /* block all other signals */
sigact.sa_flags = 0; /* default behaviour */
if (sigaction(SIGTERM, &sigact, NULL) != OK)
report("TTY","warning, sigaction() failed", errno);
#endif
} }
/*==========================================================================* /*==========================================================================*