xref: /original-bsd/usr.bin/f77/libU77/Makefile (revision 850c0003)
1#
2# Copyright (c) 1987 Regents of the University of California.
3# All rights reserved.  The Berkeley software License Agreement
4# specifies the terms and conditions for redistribution.
5#
6#	@(#)Makefile	5.4	(Berkeley)	05/10/89
7#
8CFLAGS=	-O
9LIBC=	/lib/libc.a
10DEST=	${DESTDIR}/usr/lib
11LIBRARY=	libU77.a
12LIBRARY_P=	libU77_p.a
13SRCS=	access_.c alarm_.c chdir_.c chmod_.c ctime_.c dtime_.c etime_.c \
14	f77lid_.c fdate_.c fgetc_.c fork_.c fputc_.c fseek_.c fstat_.c \
15	ftell_.c gerror_.c getarg_.c getc_.c getcwd_.c getenv_.c getgid_.c \
16	getlog_.c getpid_.c getuid_.c gmtime_.c hostnm_.c iargc_.c idate_.c \
17	ierrno_.c ioinit.f isatty_.c itime_.c kill_.c link_.c loc_.c \
18	lstat_.c ltime_.c malloc_.c perror_.c putc_.c qsort_.c rename_.c \
19	sleep_.c stat_.c symlnk_.c system_.c tapeio.c time_.c ttynam_.c \
20	unlink_.c wait_.c
21OBJS=	access_.o alarm_.o chdir_.o chmod_.o ctime_.o dtime_.o etime_.o \
22	f77lid_.o fdate_.o fgetc_.o fork_.o fputc_.o fseek_.o fstat_.o \
23	ftell_.o gerror_.o getarg_.o getc_.o getcwd_.o getenv_.o getgid_.o \
24	getlog_.o getpid_.o getuid_.o gmtime_.o hostnm_.o iargc_.o idate_.o \
25	ierrno_.o ioinit.o isatty_.o itime_.o kill_.o link_.o loc_.o \
26	lstat_.o ltime_.o malloc_.o perror_.o putc_.o qsort_.o rename_.o \
27	sleep_.o stat_.o symlnk_.o system_.o tapeio.o time_.o ttynam_.o \
28	unlink_.o wait_.o
29
30.c.o:
31	@${CC} -p ${CFLAGS} -c $*.c
32	@-ld -x -r $*.o
33	@mv a.out profiled/$*.o
34	${CC} ${CFLAGS} -c $*.c
35	@-ld -x -r $*.o
36	@mv a.out $*.o
37
38.f.o:
39	@${FC} -p ${FFLAGS} -c $*.f
40	@-ld -x -r $*.o
41	@mv a.out profiled/$*.o
42	${FC} ${FFLAGS} -c $*.f
43	@-ld -x -r $*.o
44	@mv a.out $*.o
45
46all: ${LIBRARY} ${LIBRARY_P}
47
48${LIBRARY}: ${OBJS} Version
49	@echo "Loading normal ${LIBRARY} ... "
50	@ar cru ${LIBRARY} ${OBJS} ioinit.f Version
51	ranlib ${LIBRARY}
52
53${LIBRARY_P}: ${OBJS} Version
54	@echo "Loading profiled ${LIBRARY_P} ... "
55	@cd profiled; ar cru ../${LIBRARY_P} ${OBJS} Version
56	ranlib ${LIBRARY_P}
57
58Version: ${SRCS} mkvers
59	@rm -f Version.c
60	./mkvers ${LIBRARY} ${SRCS} > Version.c
61	${CC} -c Version.c -o Version
62	@rm -f profiled/Version
63	ln Version profiled/Version
64
65mkvers: mkvers.c
66	${CC} mkvers.c -o $@
67
68clean:
69	rm -f ${OBJS} mkvers profiled/*.o core ${LIBRARY} ${LIBRARY_P}
70
71cleandir: clean
72	rm -f ${MAN} tags .depend
73
74depend: ${SRCS}
75	mkdep ${CFLAGS} ${SRCS}
76
77install: ${MAN}
78	install -o bin -g bin -m 644 ${LIBRARY} ${DEST}/${LIBRARY}
79	ranlib -t ${DEST}/${LIBRARY}
80	install -o bin -g bin -m 644 ${LIBRARY_P} ${DEST}/${LIBRARY_P}
81	ranlib -t ${DEST}/${LIBRARY_P}
82
83lint: ${SRCS}
84	lint ${CFLAGS} ${SRCS}
85
86tags: ${SRCS}
87	ctags ${SRCS}
88
89extract: FRC
90	@ar xo ${DEST}/${LIBRARY}; rm -f __.SYMDEF
91	@cd profiled; -ar xo ${DEST}/${LIBRARY_P}; rm -f __.SYMDEF
92
93update ${DEST}/${LIBRARY}: FRC
94	@-ar xo ${DEST}/${LIBRARY}
95	@cd profiled; -ar xo ${DEST}/${LIBRARY_P}
96	@make DEST=${DEST} all install clean
97
98FRC:
99