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


1.5
date	92.12.10.17.58.45;	author md;	state Exp;
branches;
next	1.4;

1.4
date	90.12.06.13.42.45;	author cks;	state Exp;
branches;
next	1.3;

1.3
date	90.11.19.22.41.39;	author cks;	state Exp;
branches;
next	1.2;

1.2
date	90.09.13.23.10.35;	author rayan;	state Exp;
branches;
next	1.1;

1.1
date	90.09.13.23.00.19;	author rayan;	state Exp;
branches;
next	;


desc
@aos
@


1.5
log
@add -c flag to install
@
text
@#	crt0	Normal C run time startoff
#	mcrt0	C run time start off for profiling, ``prof'' conventions
#	gcrt0	C run time start off for profiling, ``gprof'' conventions

CFLAGS=	-O -DLIBC_SCCS
OBJS=	crt0.o mcrt0.o gcrt0.o
FPOBJ=  fpglue.o
CLEANFILES+=	gmon.o mon.o moncrt0.o fpglue.o fpglue_p.o

# This awk script exit's 1 if any output is found.
# The ex scripts should be silent.
STDOUTCK= awk 'BEGIN{X=0}{X=1;print}END{exit X}'

all: ${OBJS}

crt0.o: crt0.c crt0.ex ${FPOBJ}
	${CC} -S -DCRT0 ${.IMPSRC}
#	sed -e 's;_start;start;g' -e '1s;$$;	j	start;' crt0.s >x.s
	${.CURDIR}/crt0.ex crt0.s | ${STDOUTCK}
	${AS} -o x.o crt0.s
	${LD} -x -r -o ${.TARGET} x.o ${FPOBJ}
	rm -f x.s x.o crt0.s

moncrt0.o: crt0.c moncrt0.ex ${FPOBJ} 
	${CC} -S -DMCRT0 ${.CURDIR}/crt0.c
#	sed -e 's;_start;start;g' -e '1s;$$;	j	start;' crt0.s >x.s
	${.CURDIR}/moncrt0.ex crt0.s | ${STDOUTCK}
	${AS} -o x.o crt0.s
	${LD} -x -r -o ${.TARGET} x.o fpglue_p.o
	rm -f x.s x.o crt0.s

mcrt0.o: moncrt0.o mon.o
	${LD} -x -r -o ${.TARGET} moncrt0.o mon.o

gcrt0.o: moncrt0.o gmon.o
	${LD} -x -r -o ${.TARGET} moncrt0.o gmon.o

mon.o:	mon.c mon.ex
	${CC} -S ${DEFS} ${.IMPSRC}
	${.CURDIR}/mon.ex mon.s | ${STDOUTCK}
	${AS} -o x.o mon.s
	${LD} -x -r -o ${.TARGET} x.o
	rm -f x.o mon.s

gmon.o: gmon.c gmon.h gmon.ex
	${CC} -S ${DEFS} ${.IMPSRC}
	${.CURDIR}/gmon.ex gmon.s | ${STDOUTCK}
	${AS} -o x.o gmon.s
	${LD} -x -r -o ${.TARGET} x.o
	rm -f x.o gmon.s

fpglue.o: fpglue.s
	${CPP} ${.IMPSRC} > $*.cpp.s
	${AS} -o $*.o $*.cpp.s
	rm $*.cpp.s
	${CPP} -DPROFILE ${.IMPSRC} > $*_p.cpp.s
	${AS} -o $*_p.o $*_p.cpp.s
	rm $*_p.cpp.s

install:
	install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \
	    ${DESTDIR}/usr/lib

depend lint tags:

.include <bsd.prog.mk>
@


1.4
log
@changed to work with the new Reno obj directory scheme.
@
text
@d61 1
a61 1
	install -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \
@


1.3
log
@changes from rayan.
@
text
@d17 1
a17 1
	${CC} -S -DCRT0 crt0.c
d19 1
a19 1
	./crt0.ex crt0.s | ${STDOUTCK}
d25 1
a25 1
	${CC} -S -DMCRT0 crt0.c
d27 1
a27 1
	./moncrt0.ex crt0.s | ${STDOUTCK}
d40 1
a40 1
	./mon.ex mon.s | ${STDOUTCK}
d47 1
a47 1
	./gmon.ex gmon.s | ${STDOUTCK}
d53 1
a53 1
	${CPP} $*.s > $*.cpp.s
d56 1
a56 1
	${CPP} -DPROFILE $*.s > $*_p.cpp.s
@


1.2
log
@reno mods
@
text
@d8 1
a8 2
CLEANFILES+=	gmon.o mon.o moncrt0.o core a.out
CPP=	cc -E
@


1.1
log
@Initial revision
@
text
@a0 10
#$Header:Makefile 12.0$
#$ACIS:Makefile 12.0$
#$Source: /ibm/acis/usr/src/lib/libc/ca/csu/RCS/Makefile,v $
#
# Copyright (c) 1980 Regents of the University of California.
# All rights reserved.  The Berkeley software License Agreement
# specifies the terms and conditions for redistribution.
#
#	@@(#)Makefile	5.4 (Berkeley) 9/5/85
#
d4 3
a6 3
DESTDIR=
SRCS=	crt0.c mon.c gmon.c
OBJS=	crt0.o mcrt0.o gcrt0.o mon.o gmon.o ${FPOBJ}
d8 2
a9 3
RM=rm -f
LD=/bin/ld
TAGSFILE=tags
a14 5
.s.o:
	/lib/cpp $*.s > $*.cpp.s
	as -o $*.o $*.cpp.s
	rm $*.cpp.s

d17 2
a18 16
install: all
	mv crt0.o ${DESTDIR}/lib/crt0.o
	mv mcrt0.o ${DESTDIR}/lib/mcrt0.o
	mv gcrt0.o ${DESTDIR}/usr/lib/gcrt0.o


fpglue.o: fpglue.s
	/lib/cpp $*.s > $*.cpp.s
	as -o $*.o $*.cpp.s
	rm $*.cpp.s
	/lib/cpp -DPROFILE $*.s > $*_p.cpp.s
	as -o $*_p.o $*_p.cpp.s
	rm $*_p.cpp.s

crt0.o:	crt0.c crt0.ex ${FPOBJ} 
	${CC} -S ${DFLAGS} -DCRT0 crt0.c
d22 2
a23 2
	ld -x -r -o crt0.o x.o ${FPOBJ}
	$(RM) x.o crt0.s
d26 1
a26 1
	${CC} -S ${DFLAGS} -DMCRT0 crt0.c
d30 2
a31 2
	ld -x -r -o moncrt0.o x.o fpglue_p.o
	$(RM) x.o crt0.s
d33 3
d37 1
a37 1
	ld -x -r -o gcrt0.o moncrt0.o gmon.o
d39 2
a40 5
mcrt0.o: moncrt0.o mon.o
	ld -x -r -o mcrt0.o moncrt0.o mon.o

mon.o: mon.c mon.ex
	${CC} -S ${DFLAGS} mon.c
d43 2
a44 2
	ld -x -r -o mon.o x.o
	$(RM) x.o mon.s
d47 1
a47 1
	${CC} -S ${DFLAGS} gmon.c
d50 2
a51 2
	ld -x -r -o gmon.o x.o
	$(RM) x.o gmon.s
d53 7
a59 5
tags:	
	cwd=`pwd`; \
	for i in ${SRCS}; do \
		ctags -a -f ${TAGSFILE} $$cwd/$$i; \
	done
d61 3
a63 2
clean:
	$(RM) ${OBJS} core errs moncrt0.o fpglue_p.o tags
d65 1
a65 4
lint:	crt0.c
	lint crt0.c -DMCRT0
	lint crt0.c -DGCRT0
	lint crt0.c -DCRT0
d67 1
a67 23
depend:
	for i in ${SRCS}; do \
	    cc -M ${DEFS} ${DFLAGS} $$i | awk ' { if ($$1 != prev) \
		{ if (rec != "") print rec; rec = $$0; prev = $$1; } \
		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
		else rec = rec " " $$2 } } \
		END { print rec } ' >> makedep; done
	sed -n '1,/^# DO NOT DELETE THIS LINE/p' Makefile > Makefile.tmp
	cat makedep >> Makefile.tmp
	rm makedep
	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile.tmp
	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile.tmp
	echo '# see make depend above' >> Makefile.tmp
	cp Makefile Makefile.bak
	mv Makefile.tmp Makefile

# DO NOT DELETE THIS LINE -- make depend uses it
crt0.o: crt0.c
mon.o: mon.c
gmon.o: gmon.c ./gmon.h
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
@
