User`s manual
NCR Build Tools
4-2 Single Board Computers SCSI Software UserÕs Manual
4
Example Usage of the NCR Build Utilities
What follows is an extract from a Makefile showing an example .n.o make rule
for compiling a SCRIPTS module. This example is specific to a SYSTEM V/68
host. For a SYSTEM V/88 host, N710P should be set to use n710p80k and N710C
should likewise be set to n710c80k.
TMPDIR = ./tmp_hdrs
INCDIR = ../incl
CPP = cc -E
N710C = n710c68k
N710P = n710p68k
PFLAGS = -Um68k -UsysV68 -Um88k -Uunix -I$(INCDIR)
EXTHDRS= $(INCDIR)/ncr.h \
$(INCDIR)/ncr710.h \
$(INCDIR)/scsi.h \
$(INCDIR)/scsi_err.h \
$(INCDIR)/sfw_cnfg.h
.n.o:
1 rm -rf $(TMPDIR); mkdir $(TMPDIR)
2 @for i in $(EXTHDRS); \
3 do \
4 j=‘basename $$i‘; \
5 grep ’^#.*[^\]$$’ $$i >$(TMPDIR)/$$j; \
6 done
7 $(CPP) $(PFLAGS) $*.n | \
8 sed -e ’s/ */ /g’ -e ’/^# *ident/d’ -e ’/^# *pragma/d’ \
9 -e ’/^# *[0-9][0-9]*/d’ -e ’s/\[ /\[/g’ \
10 -e ’s/ \]/\]/g’ > $*.i
11 $(N710P) $*.i
12 $(N710C) $*.i -u -o $*.j
13 sed “/typedef.*ULONG/s/long/int/g” $*.j > $*.c
14 $(CC) -c $*.c
15 rm -rf $(TMPDIR) $*.i $*.j $*.c