-BINS := @srcroot@bin/pprof
-CHDRS := @objroot@include/jemalloc/jemalloc@install_suffix@.h \
- @objroot@include/jemalloc/jemalloc_defs@install_suffix@.h
-CSRCS := @srcroot@src/jemalloc.c @srcroot@src/arena.c @srcroot@src/atomic.c \
- @srcroot@src/base.c @srcroot@src/bitmap.c @srcroot@src/chunk.c \
- @srcroot@src/chunk_dss.c @srcroot@src/chunk_mmap.c \
- @srcroot@src/chunk_swap.c @srcroot@src/ckh.c @srcroot@src/ctl.c \
- @srcroot@src/extent.c @srcroot@src/hash.c @srcroot@src/huge.c \
- @srcroot@src/mb.c @srcroot@src/mutex.c @srcroot@src/prof.c \
- @srcroot@src/rtree.c @srcroot@src/stats.c @srcroot@src/tcache.c
-ifeq (macho, @abi@)
-CSRCS += @srcroot@src/zone.c
+BINS := $(srcroot)bin/pprof $(objroot)bin/jemalloc.sh
+CHDRS := $(objroot)include/jemalloc/jemalloc$(install_suffix).h \
+ $(objroot)include/jemalloc/jemalloc_defs$(install_suffix).h
+CSRCS := $(srcroot)src/jemalloc.c $(srcroot)src/arena.c $(srcroot)src/atomic.c \
+ $(srcroot)src/base.c $(srcroot)src/bitmap.c $(srcroot)src/chunk.c \
+ $(srcroot)src/chunk_dss.c $(srcroot)src/chunk_mmap.c \
+ $(srcroot)src/ckh.c $(srcroot)src/ctl.c $(srcroot)src/extent.c \
+ $(srcroot)src/hash.c $(srcroot)src/huge.c $(srcroot)src/mb.c \
+ $(srcroot)src/mutex.c $(srcroot)src/prof.c $(srcroot)src/quarantine.c \
+ $(srcroot)src/rtree.c $(srcroot)src/stats.c $(srcroot)src/tcache.c \
+ $(srcroot)src/util.c $(srcroot)src/tsd.c
+ifeq (macho, $(ABI))
+CSRCS += $(srcroot)src/zone.c
+endif
+ifeq ($(IMPORTLIB),$(SO))
+STATIC_LIBS := $(objroot)lib/$(LIBJEMALLOC).$(A)
+endif
+ifdef PIC_CFLAGS
+STATIC_LIBS += $(objroot)lib/$(LIBJEMALLOC)_pic.$(A)
+else
+STATIC_LIBS += $(objroot)lib/$(LIBJEMALLOC)_s.$(A)