--- Makefile.orig 2006-06-05 06:13:57.000000000 -0500 +++ Makefile 2008-06-17 20:56:10.000000000 -0500 @@ -15,12 +15,12 @@ TAR_FLAGS = --numeric-owner --exclude "*~" --exclude "debian/tmp*" #CC = /pkg/gcc-2.95.2-wg/bin/gcc -CC = cc +CC ?= cc SYS_FLAGS = -OPT_FLAGS = -g -O # -O2 +OPT_FLAGS = -O2 # -O2 WARN_FLAGS = #-Wall -Wstrict-prototypes -SH_FLAGS = -shared -fpic +SH_FLAGS = -shared -fPIC INC_FLAGS = -Isysdeps/generic @@ -35,6 +35,9 @@ THR_FLAGS = -DUSE_TSD_DATA_HACK -D_REENTRANT THR_LIBS = -lpthread +# Target libraries +LIBS= libmalloc.a malloc.so + RM = rm -f AR = ar RANLIB = ranlib @@ -46,12 +49,12 @@ TESTS = t-test1$(T_SUF) t-test2$(T_SUF) \ tst-mallocstate$(T_SUF) tst-mstats$(T_SUF) -CFLAGS = $(SYS_FLAGS) $(OPT_FLAGS) $(WARN_FLAGS) $(THR_FLAGS) $(INC_FLAGS) +CFLAGS += $(SYS_FLAGS) $(OPT_FLAGS) $(WARN_FLAGS) $(THR_FLAGS) $(INC_FLAGS) .c.o: $(CC) -c $(CFLAGS) $< -all: $(LIB_MALLOC) $(TESTS) +all: $(LIBS) $(TESTS) malloc.o: malloc.c malloc.h $(CC) -c $(CFLAGS) $(M_FLAGS) $< @@ -102,7 +105,7 @@ posix: $(MAKE) THR_FLAGS='-DUSE_TSD_DATA_HACK -D_REENTRANT' \ OPT_FLAGS='$(OPT_FLAGS)' SYS_FLAGS='$(SYS_FLAGS)' CC='$(CC)' \ - INC_FLAGS='-Isysdeps/pthread -Isysdeps/generic -I.' + INC_FLAGS='-Isysdeps/pthread -Isysdeps/generic -I.' \ THR_LIBS=-lpthread # posix threads with explicit initialization. Known to be needed on HPUX.