1995-06-04 05:29:58 +00:00
|
|
|
# Makefile for Doug Lea's malloc
|
|
|
|
#
|
|
|
|
# (largely based on Mark Moreas' Makefile)
|
|
|
|
#
|
|
|
|
# Renamed dlmalloc
|
|
|
|
#
|
|
|
|
# A version of malloc/free/realloc written by Doug Lea and released to the
|
|
|
|
# public domain.
|
|
|
|
#
|
1999-04-04 15:16:26 +00:00
|
|
|
# preliminary VERSION 2.6.5
|
1995-06-04 05:29:58 +00:00
|
|
|
#
|
|
|
|
# working version; unreleased.
|
|
|
|
#
|
|
|
|
|
|
|
|
LIBDIR=${PREFIX}/lib
|
|
|
|
|
|
|
|
# for the shared lib stuff
|
1998-10-21 01:12:01 +00:00
|
|
|
.if ${PORTOBJFORMAT} == "elf"
|
|
|
|
VERSION=2
|
|
|
|
.else
|
1997-04-21 00:30:35 +00:00
|
|
|
VERSION=2.6
|
1998-10-21 01:12:01 +00:00
|
|
|
.endif
|
1995-06-04 05:29:58 +00:00
|
|
|
|
|
|
|
LIBMALLOC=libdlmalloc.a
|
|
|
|
LIBSMALLOC=libdlmalloc.so.${VERSION}
|
|
|
|
|
1999-04-04 15:16:26 +00:00
|
|
|
SRCS = malloc-2.6.5.c
|
1995-06-04 05:29:58 +00:00
|
|
|
|
1997-04-21 00:30:35 +00:00
|
|
|
OBJS = $(SRCS:.c=.o)
|
|
|
|
SOBJS = $(SRCS:.c=.so)
|
1995-06-04 05:29:58 +00:00
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
.SUFFIXES: .out .o .po .so .s .S .c .cc .cxx .m .C .f .y .l
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
${CC} -c ${CFLAGS} $< -o $@
|
|
|
|
|
|
|
|
.c.so:
|
|
|
|
${CC} -c -fpic ${CFLAGS} $< -o $@
|
|
|
|
ld -x -r $@
|
|
|
|
mv a.out $@
|
|
|
|
|
|
|
|
all: ${LIBMALLOC} ${LIBSMALLOC}
|
|
|
|
|
|
|
|
$(LIBMALLOC): $(OBJS)
|
|
|
|
rm -f $(LIBMALLOC)
|
|
|
|
$(AR) $(ARFLAGS) $(LIBMALLOC) $(OBJS)
|
|
|
|
-$(RANLIB) $(LIBMALLOC)
|
|
|
|
|
|
|
|
$(LIBSMALLOC): $(SOBJS)
|
|
|
|
rm -f $(LIBSMALLOC)
|
1998-10-21 01:12:01 +00:00
|
|
|
.if ${PORTOBJFORMAT} == "elf"
|
|
|
|
ld -Bshareable -soname $(LIBSMALLOC) -o $(LIBSMALLOC) $(SOBJS)
|
|
|
|
.else
|
1995-06-04 05:29:58 +00:00
|
|
|
ld -Bshareable -o $(LIBSMALLOC) $(SOBJS)
|
1998-10-21 01:12:01 +00:00
|
|
|
.endif
|
1995-06-04 05:29:58 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -f *.o \#* *~ *.core a.out gmon.out mon.out onefile.c *.sL prof.out
|
|
|
|
|
|
|
|
install:
|
|
|
|
install -c -m 644 ${LIBMALLOC} $(LIBDIR)
|
|
|
|
-$(RANLIB) $(LIBDIR)/${LIBMALLOC}
|
|
|
|
install -c -m 555 ${LIBSMALLOC} $(LIBDIR)
|
1998-10-21 01:12:01 +00:00
|
|
|
ln -sf ${LIBSMALLOC} $(LIBDIR)/libdlmalloc.so
|
1995-06-04 05:29:58 +00:00
|
|
|
|
1997-04-21 00:30:35 +00:00
|
|
|
$(OBJS): $(SRCS)
|
|
|
|
$(SOBJS): $(SRCS)
|