Commit | Line | Data |
---|---|---|
63abb1e7 FF |
1 | # |
2 | # Makefile | |
3 | # Copyright (C) 1992 Cygnus Support | |
4 | # | |
5 | # This file is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 2 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program; if not, write to the Free Software | |
17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
18 | # | |
19 | ||
20 | # | |
21 | # Makefile for mmalloc directory | |
22 | # | |
23 | ||
24 | # Directory containing source files. Don't clean up the spacing, | |
25 | # this exact string is matched for by the "configure" script. | |
26 | srcdir = . | |
27 | ||
28 | prefix = /usr/local | |
29 | ||
30 | bindir = $(prefix)/bin | |
31 | datadir = $(prefix)/lib | |
32 | libdir = $(prefix)/lib | |
33 | mandir = $(datadir)/man | |
34 | man1dir = $(mandir)/man1 | |
35 | man2dir = $(mandir)/man2 | |
36 | man3dir = $(mandir)/man3 | |
37 | man4dir = $(mandir)/man4 | |
38 | man5dir = $(mandir)/man5 | |
39 | man6dir = $(mandir)/man6 | |
40 | man7dir = $(mandir)/man7 | |
41 | man8dir = $(mandir)/man8 | |
42 | man9dir = $(mandir)/man9 | |
43 | infodir = $(datadir)/info | |
44 | includedir = $(prefix)/include | |
45 | docdir = $(datadir)/doc | |
46 | ||
47 | SHELL = /bin/sh | |
48 | ||
49 | INSTALL = install -c | |
50 | INSTALL_PROGRAM = $(INSTALL) | |
51 | INSTALL_DATA = $(INSTALL) | |
52 | ||
53 | AR = ar | |
54 | AR_FLAGS = qv | |
55 | BISON = bison | |
56 | MAKEINFO = makeinfo | |
57 | RANLIB = ranlib | |
58 | RM = rm | |
59 | ||
60 | TARGETLIB = libmmalloc.a | |
61 | ||
62 | MINUS_G = -g | |
63 | CFLAGS = $(MINUS_G) -I. -I$(srcdir)/../include $(HDEFINES) | |
64 | ||
65 | CFILES = mcalloc.c mfree.c mmalloc.c mmcheck.c mmemalign.c mmstats.c \ | |
66 | mmtrace.c mrealloc.c mvalloc.c mmap-sup.c attach.c detach.c \ | |
67 | keys.c sbrk-sup.c | |
68 | ||
69 | HFILES = mmalloc.h | |
70 | ||
71 | OFILES = mcalloc.o mfree.o mmalloc.o mmcheck.o mmemalign.o mmstats.o \ | |
72 | mmtrace.o mrealloc.o mvalloc.o mmap-sup.o attach.o detach.o \ | |
73 | keys.o sbrk-sup.o | |
74 | ||
75 | #### Host, target, and site specific Makefile fragments come in here. | |
76 | ### | |
77 | ||
78 | # Do we want/need any config overrides? | |
79 | # | |
80 | ||
81 | STAGESTUFF = $(TARGETLIB) *.o | |
82 | ||
83 | all: $(TARGETLIB) | |
84 | ||
85 | install: all | |
86 | $(INSTALL_DATA) $(TARGETLIB) $(libdir)/$(TARGETLIB).n | |
87 | $(RANLIB) $(libdir)/$(TARGETLIB).n | |
88 | mv -f $(libdir)/$(TARGETLIB).n $(libdir)/$(TARGETLIB) | |
89 | ||
90 | $(TARGETLIB): $(OFILES) | |
91 | $(RM) -rf $@ | |
92 | $(AR) $(AR_FLAGS) $@ $(OFILES) | |
93 | $(RANLIB) $@ | |
94 | ||
95 | $(OFILES) : $(HFILES) | |
96 | ||
97 | .always.: | |
98 | # Do nothing. | |
99 | ||
100 | .PHONEY: all etags tags ls clean stage1 stage2 .always. | |
101 | ||
102 | stage1: force | |
103 | -mkdir stage1 | |
104 | -mv -f $(STAGESTUFF) stage1 | |
105 | ||
106 | stage2: force | |
107 | -mkdir stage2 | |
108 | -mv -f $(STAGESTUFF) stage2 | |
109 | ||
110 | stage3: force | |
111 | -mkdir stage3 | |
112 | -mv -f $(STAGESTUFF) stage3 | |
113 | ||
114 | stage4: force | |
115 | -mkdir stage4 | |
116 | -mv -f $(STAGESTUFF) stage4 | |
117 | ||
118 | against=stage2 | |
119 | ||
120 | comparison: force | |
121 | for i in *.o ; do cmp $$i $(against)/$$i || exit 1 ; done | |
122 | ||
123 | de-stage1: force | |
124 | -(cd stage1 ; mv -f * ..) | |
125 | -rmdir stage1 | |
126 | ||
127 | de-stage2: force | |
128 | -(cd stage2 ; mv -f * ..) | |
129 | -rmdir stage2 | |
130 | ||
131 | de-stage3: force | |
132 | -(cd stage3 ; mv -f * ..) | |
133 | -rmdir stage3 | |
134 | ||
135 | de-stage4: force | |
136 | -(cd stage4 ; mv -f * ..) | |
137 | -rmdir stage4 | |
138 | ||
139 | etags tags: TAGS | |
140 | ||
141 | TAGS: $(CFILES) | |
142 | etags $(HFILES) $(CFILES) | |
143 | ||
144 | ls: | |
145 | @echo Makefile $(HFILES) $(CFILES) | |
146 | ||
147 | # Need to deal with profiled libraries, too. | |
148 | ||
149 | clean: | |
150 | rm -f *.a *.o core errs *~ \#* TAGS *.E a.out errors | |
151 | ||
152 | force: | |
153 | ||
154 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) \ | |
155 | $(target_makefile_frag) | |
156 | $(SHELL) ./config.status |