BSD 4_4_Lite2 development
[unix-history] / usr / src / contrib / mprof / Makefile.mips
CommitLineData
470759fc
C
1# %M% %I% %G% %U%
2# Copyright (c) 1987, Benjamin G. Zorn
3#
4# Makefile for MPROF data generation
5#
6CC = /bin/cc
7
8# mips CFLAGS = -I. -g -DDEBUG
9# sun4 CFLAGS = -I. -g -Dsun4
10# sun3,vax CFLAGS = -I. -g
11
12# sun4 ASFLAGS = -P -Dsun4
13# sun3,vax,mips ASFLAGS =
14
15CFLAGS = -I. -g -DDEBUG
16ASFLAGS =
17BIN = .
18MPLIB = $(BIN)/libc_mp.a
19LINTFLAGS = -bhx
20
21# sun4,mips ASM_SRC = md.s
22# sun4,mips ASM_OBJ = md.o
23# vax,sun3 ASM_SRC =
24# vax,sun3 ASM_SRC =
25
26ASM_SRC = md.s
27ASM_OBJ = md.o
28
29MPROF_MON_SRCS = leak.c malloc.c mpattach.c mprof_mon.c mpstruct.c $(ASM_SRC)
30MPROF_MON_OBJS = leak.o malloc.o mpattach.o mprof_mon.o mpstruct.o $(ASM_OBJ)
31
32MPROF_SRCS = mprof.c mpstruct.c mpgraph.c
33MPROF_OBJS = mprof.o mpstruct.o mpgraph.o
34
35DOC_SRC = mprof.1
36DOC_OBJS = mprof.man
37
38DISTNAME = mprof30
39
40TEST_SRCS = test1.c test2.c
41TEST_OBJS = test1.o test2.o
42
43all: mprof $(MPROF_MON_OBJS) $(DOC_OBJS) $(MPLIB)
44
45#mips $(MPLIB): $(MPROF_OBJS)
46# ar cr libc_mp.a $(MPROF_MON_OBJS)
47# ranlib libc_mp.a
48
49# mips $(MPLIB): $(MPROF_MON_OBJS)
50# ar cr libc_mp.a $(MPROF_MON_OBJS)
51# ranlib libc_mp.a
52
53# sun3, sun4 LIB_REPLACE = memalign.o
54# vax LIB_REPLACE = exit.o
55# mips LIB_REPLACE =
56
57LIB_REPLACE =
58
59$(MPLIB): $(MPROF_MON_OBJS)
60 ar cr libc_mp.a $(MPROF_MON_OBJS)
61 ranlib libc_mp.a
62
63test: $(TEST_OBJS) test1-demo test2-demo
64
65mprof-mon-lint:
66 lint $(LINTFLAGS) $(MPROF_MON_SRCS) > mprof.lint
67
68mprof-lint:
69 lint $(LINTFLAGS) $(MPROF_SRCS) > mprof.lint
70
71clean:
72 rm -f *.o mprof.lint mprof-mon.lint \
73 $(DOC_OBJS) \
74 $(TEST_OBJS) \
75 test1 test1.data test1.mprof \
76 test2 test2.data test2.mprof \
77 libc_mp.a mprof mprof.data
78
79leak.o: leak.c
80mprof_mon.o: mprof_mon.c
81mpstruct.o: mpstruct.c
82mpgraph.o: mpgraph.c
83mprof.o: mprof.c
84md.o: md.s
85 $(AS) $(ASFLAGS) -o md.o md.s
86
87malloc.o: malloc.c
88 $(CC) $(CFLAGS) -Dmalloc=__malloc__ -Dfree=__free__ -Drealloc=__realloc__ malloc.c -c
89
90mprof: $(MPROF_OBJS)
91 $(CC) $(CFLAGS) -o mprof $(MPROF_OBJS)
92
93mprof.man: mprof.1
94 nroff -man mprof.1 > mprof.man
95
96dist: MANIFEST
97 tar cvf $(DISTNAME).tar `cat MANIFEST`
98 compress $(DISTNAME).tar
99
100#
101# Examples to test if MPROF is installed correctly
102#
103
104# A very simple test (tests calloc and valloc)
105
106test1-demo: test1.data
107 $(BIN)/mprof -normal test1 test1.data > test1.mprof
108
109test1.mprof: test1.data
110 $(BIN)/mprof -normal test1 test1.data > test1.mprof
111
112test1.data: test1
113 test1
114 cp mprof.data test1.data
115
116test1: test1.o $(MPLIB)
117 $(CC) $(CFLAGS) -o test1 test1.o $(MPLIB)
118
119test1.o: test1.c
120
121
122# test2 program (example from paper)
123
124test2-demo: test2.data
125 $(BIN)/mprof -normal test2 test2.data > test2.mprof
126
127test2.mprof: test2.data
128 $(BIN)/mprof -normal test2 test2.data > test2.mprof
129
130test2.data: test2
131 test2
132 cp mprof.data test2.data
133
134test2: test2.o $(MPLIB)
135 $(CC) $(CFLAGS) -o test2 test2.o $(MPLIB)
136
137test2.o: test2.c
138
139
140###
141leak.o: /usr/include/stdio.h mprof.h /usr/include/sys/types.h \
142 /usr/include/frame.h
143malloc.o: /usr/include/sys/types.h /usr/include/stdio.h
144mprof.o: /usr/include/stdio.h /usr/include/sys/file.h /usr/include/ctype.h \
145 /usr/include/a.out.h /usr/include/sys/exec.h /usr/include/stab.h \
146 mprof.h /usr/include/sys/types.h /usr/include/frame.h
147mprof_mon.o: /usr/include/stdio.h /usr/include/sys/file.h mprof.h \
148 /usr/include/sys/types.h /usr/include/frame.h
149mpstruct.o: /usr/include/stdio.h mprof.h /usr/include/sys/types.h \
150 /usr/include/frame.h
151mpgraph.o: /usr/include/stdio.h mprof.h /usr/include/sys/types.h \
152 /usr/include/frame.h