head	1.5;
access;
symbols;
locks; strict;
comment	@# @;


1.5
date	94.05.22.13.06.13;	author roger;	state Exp;
branches;
next	1.4;

1.4
date	94.05.13.20.12.23;	author roger;	state Exp;
branches;
next	1.3;

1.3
date	92.11.19.22.37.41;	author md;	state Exp;
branches;
next	1.2;

1.2
date	92.11.16.13.05.21;	author md;	state Exp;
branches;
next	1.1;

1.1
date	91.07.08.20.56.33;	author md;	state Exp;
branches;
next	;


desc
@original version
@


1.5
log
@header file/directory layout changes.
@
text
@#$Header: /sys/rt/stand/RCS/samakefile,v 1.4 1994/05/13 20:12:23 roger Exp roger $
#$ACIS:samakefile 12.0$
#$Source: /sys/rt/stand/RCS/samakefile,v $
#
# generic makefile for generating standalone code
#
# following flags are expected to overriden by the user
#

# kernel source tree is located via $S relative to the compilation directory
S=	../..

FLAGS=
HOST=ws
# override CRT0 to get relsrt0
CRT0=srt0
RELOC = 100000		# relocation address
# START=_start
START=start
# use LDFLAGS for loader flags
XFLAG=-x
LDFLAGS = -N $(XFLAG) -e $(START)
#
#
.SUFFIXES: .ws .out .o .b .s .c .i
# home of most everything
PREFIX=
STANDIR=/usr/src/sys/rtstand
HDIR=$(.CURDIR)/${S}
# use flags for extra compile time flags (-g etc.)
INCLUDES = -I$(.CURDIR) -I${STANDIR} -I${HDIR} -I${HDIR}/sys
CFLAGS = ${INCLUDES} -I${HDIR}/sys $(FLAGS) -DTRACE -DNOINT
# AFLAGS is for CPP on .s files
CPP=/usr/bin/cpp
AFLAGS= ${INCLUDES}
LIBSA=libsa.a
LIBC=-lc
LIBS=$(LIB) $(LIBSA) $(LIBC)
LD=ld

.c.o:
	$(CC) -c $(CFLAGS) $(.CURDIR)/$*.c

.c.i:
	$(CC) -E $(CFLAGS) $(.CURDIR)/$*.c >$*.i

.s.o:
	$(CPP) $(AFLAGS) $(FLAGS) $(.CURDIR)/$*.s >$*.S
	$(AS) -o $*.o $*.S
	rm -f $*.S

.c.s:
	$(CC) -S -xl $(CFLAGS) $(.CURDIR)/$*.c

.o.out:
	$(LD) $(LDFLAGS) -T $(RELOC) $(STANDIR)/$(CRT0).o $*.o -o $*.out $(LIBS)

.c.out:
	$(CC) -c $(CFLAGS) $*.c
	$(LD) $(LDFLAGS) -T $(RELOC) $(STANDIR)/$(CRT0).o $*.o -o $*.out $(LIBS)

.out.ws:
		cp $*.out $*.ws

all:
	@@echo "to make a program whose source is in prog.c do"
	@@echo "	samake prog.out"
	@@echo "and if that suceeds then do"
	@@echo "	samake prog.ws"

clean:
	rm -f *.lis *.b
@


1.4
log
@Fixes so that everything *still* compiles cleanly and remains
small in size.
@
text
@d1 1
a1 1
#$Header: /usr/src/sys/rt/stand/RCS/samakefile,v 1.3 1992/11/19 22:37:41 md Exp roger $
d3 1
a3 1
#$Source: /usr/src/sys/rt/stand/RCS/samakefile,v $
d31 2
a32 1
CFLAGS = -I$(.CURDIR) -I${STANDIR} -I${HDIR} -I${HDIR}/sys $(FLAGS) -DTRACE -DNOINT
d35 1
a35 1
AFLAGS= 
@


1.3
log
@better version -md
@
text
@d1 1
a1 1
#$Header: /usr/src/sys/rtstand/RCS/samakefile,v 1.2 91/07/08 20:56:31 rayan Exp $
d3 1
a3 1
#$Source: /usr/src/sys/rtstand/RCS/samakefile,v $
d9 4
d29 1
a29 1
HDIR=$(.CURDIR)/..
@


1.2
log
@mods to allow objects to be in obj directory
@
text
@d27 1
a27 1
CFLAGS = -I${STANDIR} -I${HDIR} -I${HDIR}/sys $(FLAGS) -DTRACE -DNOINT
d37 1
a37 1
	$(CC) -c $(CFLAGS) -I$(.CURDIR) $(.CURDIR)/$*.c
d40 1
a40 1
	$(CC) -E $(CFLAGS) -I$(.CURDIR) $(.CURDIR)/$*.c >$*.i
d43 1
a43 1
	$(CPP) $(AFLAGS) $(FLAGS) -I$(.CURDIR) $(.CURDIR)/$*.s >$*.S
d48 1
a48 1
	$(CC) -S -xl $(CFLAGS) -I$(.CURDIR) $(.CURDIR)/$*.c
@


1.1
log
@Initial revision
@
text
@d25 1
a25 1
HDIR=..
d37 1
a37 1
	$(CC) -c $(CFLAGS) $*.c
d40 1
a40 1
	$(CC) -E $(CFLAGS) $*.c >$*.i
d43 1
a43 1
	$(CPP) $(AFLAGS) $(FLAGS) $*.s >$*.S
d48 1
a48 1
	$(CC) -S -xl $(CFLAGS) $*.c
@
