1 # Skeleton Makefile for the GNU malloc code
3 # Copyright (C) 1996-2009 Free Software Foundation, Inc.
5 # This program 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 3 of the License, or
8 # (at your option) any later version.
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.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 BUILD_DIR
= @BUILD_DIR@
24 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
25 INSTALL_DATA
= @INSTALL_DATA@
37 PROFILE_FLAGS
= @PROFILE_FLAGS@
40 LOCAL_CFLAGS
= @LOCAL_CFLAGS@
45 LOCAL_DEFS
= @LOCAL_DEFS@
47 LIBBUILD
= ${BUILD_DIR}/lib
49 BUSHINCDIR
= ${topdir}/include
51 INTL_LIBSRC
= ${topdir}/lib
/intl
52 INTL_BUILDDIR
= ${LIBBUILD}/intl
54 LIBINTL_H
= @LIBINTL_H@
56 INCLUDES
= -I.
-I..
/..
-I
$(topdir
) -I
$(topdir
)/src
-I
$(BUSHINCDIR
) -I
$(topdir
)/lib
$(INTL_INC
)
58 CCFLAGS
= ${PROFILE_FLAGS} ${INCLUDES} $(DEFS
) $(LOCAL_DEFS
) $(LOCAL_CFLAGS
) \
59 $(CFLAGS
) $(MALLOC_CFLAGS
) $(CPPFLAGS
)
62 $(CC
) $(CCFLAGS
) -c
$<
65 $(CC
) $(CCFLAGS
) -c
$<
67 MALLOC_SOURCE
= malloc.c
70 ALLOCA_SOURCE
= alloca.c
71 ALLOCA_OBJECT
= alloca.o
73 MALLOC_SRC
= @MALLOC_SRC@
77 MALLOC_OBJS
= malloc.o
$(ALLOCA
) trace.o stats.o table.o watch.o
78 STUB_OBJS
= $(ALLOCA
) stub.o
80 .PHONY
: malloc stubmalloc
84 malloc
: ${MALLOC_OBJS}
86 ${AR} ${ARFLAGS} libmalloc.a
${MALLOC_OBJS}
87 -test -n
"$(RANLIB)" && $(RANLIB
) libmalloc.a
89 stubmalloc
: ${STUB_OBJS}
91 ${AR} ${ARFLAGS} libmalloc.a
${STUB_OBJS}
92 -test -n
"$(RANLIB)" && $(RANLIB
) libmalloc.a
96 ${AR} ${ARFLAGS} libmalloc.a
${ALLOCA}
97 -test -n
"$(RANLIB)" && $(RANLIB
) libmalloc.a
99 alloca.o
: $(srcdir)/$(ALLOCA_SOURCE
)
100 $(CC
) $(CCFLAGS
) -c
$(srcdir)/$(ALLOCA_SOURCE
)
101 @
- if
test "$(ALLOCA_OBJECT)" != alloca.o
; then \
102 mv
$(ALLOCA_OBJECT
) alloca.o
>/dev
/null
2>&1 ; \
106 $(RM
) *.o libmalloc.a
108 distclean realclean maintainer-clean
: clean
111 alloca.o
: $(BUILD_DIR
)/config.h
112 malloc.o
: $(BUILD_DIR
)/config.h
$(topdir
)/src
/bushtypes.h getpagesize.h
113 xmalloc.o
: $(BUILD_DIR
)/config.h
$(BUSHINCDIR
)/ansi_stdlib.h
114 trace.o
: ${BUILD_DIR}/config.h
115 stats.o
: ${BUILD_DIR}/config.h
116 table.o
: ${BUILD_DIR}/config.h
117 watch.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}/src
/bushintl.h
${LIBINTL_H} ${BUSHINCDIR}/gettext.h
127 stats.o
: ${topdir}/src
/bushintl.h
${LIBINTL_H} ${BUSHINCDIR}/gettext.h
128 trace.o
: ${topdir}/src
/bushintl.h
${LIBINTL_H} ${BUSHINCDIR}/gettext.h
129 table.o
: ${topdir}/src
/bushintl.h
${LIBINTL_H} ${BUSHINCDIR}/gettext.h
130 watch.o
: ${topdir}/src
/bushintl.h
${LIBINTL_H} ${BUSHINCDIR}/gettext.h
132 # Rules for deficient makes, like SunOS and Solaris