1 # Skeleton Makefile for the GNU malloc code
4 # Copyright (C) 1996 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
23 BUILD_DIR = @BUILD_DIR@
26 INSTALL_PROGRAM = @INSTALL_PROGRAM@
27 INSTALL_DATA = @INSTALL_DATA@
39 PROFILE_FLAGS = @PROFILE_FLAGS@
42 LOCAL_CFLAGS = @LOCAL_CFLAGS@
47 LOCAL_DEFS = @LOCAL_DEFS@
49 LIBBUILD = ${BUILD_DIR}/lib
51 BASHINCDIR = ${topdir}/include
53 INTL_LIBSRC = ${topdir}/lib/intl
54 INTL_BUILDDIR = ${LIBBUILD}/intl
56 LIBINTL_H = @LIBINTL_H@
58 INCLUDES = -I. -I../.. -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib $(INTL_INC)
60 CCFLAGS = ${PROFILE_FLAGS} ${INCLUDES} $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) \
61 $(CFLAGS) $(MALLOC_CFLAGS) $(CPPFLAGS)
64 $(CC) $(CCFLAGS) -c $<
67 $(CC) $(CCFLAGS) -c $<
69 MALLOC_SOURCE = malloc.c
72 ALLOCA_SOURCE = alloca.c
73 ALLOCA_OBJECT = alloca.o
75 MALLOC_SRC = @MALLOC_SRC@
79 MALLOC_OBJS = malloc.o $(ALLOCA) trace.o stats.o table.o watch.o
80 STUB_OBJS = $(ALLOCA) stub.o
82 .PHONY: malloc stubmalloc
86 malloc: ${MALLOC_OBJS}
88 ${AR} ${ARFLAGS} libmalloc.a ${MALLOC_OBJS}
89 -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a
91 stubmalloc: ${STUB_OBJS}
93 ${AR} ${ARFLAGS} libmalloc.a ${STUB_OBJS}
94 -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a
98 ${AR} ${ARFLAGS} libmalloc.a ${ALLOCA}
99 -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a
101 alloca.o: $(srcdir)/$(ALLOCA_SOURCE)
102 $(CC) $(CCFLAGS) -c $(srcdir)/$(ALLOCA_SOURCE)
103 @- if test "$(ALLOCA_OBJECT)" != alloca.o ; then \
104 mv $(ALLOCA_OBJECT) alloca.o >/dev/null 2>&1 ; \
108 $(RM) *.o libmalloc.a
110 distclean realclean maintainer-clean: clean
113 alloca.o: $(BUILD_DIR)/config.h
114 malloc.o: $(BUILD_DIR)/config.h $(topdir)/bashtypes.h getpagesize.h
115 xmalloc.o: $(BUILD_DIR)/config.h $(BASHINCDIR)/ansi_stdlib.h
116 trace.o: ${BUILD_DIR}/config.h
117 table.o: ${BUILD_DIR}/config.h
119 malloc.o: ${srcdir}/imalloc.h ${srcdir}/mstats.h
120 malloc.o: ${srcdir}/table.h ${srcdir}/watch.h
121 stats.o: ${srcdir}/imalloc.h ${srcdir}/mstats.h
122 trace.o: ${srcdir}/imalloc.h
123 table.o: ${srcdir}/imalloc.h ${srcdir}/table.h
124 watch.o: ${srcdir}/imalloc.h ${srcdir}/watch.h
126 malloc.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h
127 stats.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h
128 trace.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h
129 table.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h
130 watch.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h
132 # Rules for deficient makes, like SunOS and Solaris