Mercurial > jemalloc
diff Makefile @ 0:9a44d900ee55
initial import
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Mon, 05 Oct 2009 16:06:43 +0900 |
parents | |
children | daf7ce634fb2 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Mon Oct 05 16:06:43 2009 +0900 @@ -0,0 +1,46 @@ +PREFIX = /usr/local + +PRODUCT = libjemalloc +MAJOR = 1 +MINOR = 0 +REVISION = 0 +VER = ${MAJOR}.${MINOR}.${REVISION} + +CC = gcc + +SRCS = jemalloc.c +PUBHDRS = ${SRCS:.c=.h} +HDRS = jemalloc.h +OBJS = ${SRCS:.c=.o} + +LIBS = ${PRODUCT}.so ${PRODUCT}.a +CFLAGS += -fPIC -pg -g -DMOZ_MEMORY -DMOZ_MEMORY_LINUX +LDFLAGS += -shared -Wl,-soname,${SONAME} +SONAME = ${PRODUCT}.so.${MAJOR} + + +all: ${LIBS} + +${PRODUCT}.so: ${OBJS} + ${CC} -o $@ ${LDFLAGS} ${OBJS} + +${PRODUCT}.a: ${OBJS} + ar rc $@ ${OBJS} + ranlib $@ + +${OBJS} : ${SRCS} ${HDRS} + + +install: + install -m644 ${PUBHDRS} ${PREFIX}/include/jemalloc.h + rm -f ${PREFIX}/lib/${PRODUCT}.* + install -m755 ${PRODUCT}.so ${PREFIX}/lib/${PRODUCT}.so.${VER} + install -m644 ${PRODUCT}.a ${PREFIX}/lib + ln -sf ${PREFIX}/lib/${PRODUCT}.so.${VER} ${PREFIX}/lib/${PRODUCT}.so.${MAJOR} + ln -sf ${PREFIX}/lib/${PRODUCT}.so.${MAJOR} ${PREFIX}/lib/${PRODUCT}.so + +clean: + rm -f ${LIBS} ${OBJS} + +distclean: clean + rm -f *~ core*