1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-01 01:17:02 +00:00
freebsd-ports/devel/ptmalloc/files/patch-Makefile
Greg Lehey c3c1895ccc Split out build targets into all (only libraries) and tests (only
tests).  The original Makefile built only the tests.

This solves a problem with (only slightly) older versions of FreeBSD
which don't have libpthreads.  This is required for the tests, and
since there are other issues, it doesn't seem to be worthwhile trying
to fix them.  If you want to build the tests on a release older than
5.3, you'll have to play around a bit.
2004-12-14 02:56:40 +00:00

58 lines
1.3 KiB
Plaintext

--- Makefile.orig Mon Dec 20 21:58:38 1999
+++ Makefile Tue Dec 14 13:22:01 2004
@@ -10,7 +10,7 @@
OPT_FLAGS = -O #-g
WARN_FLAGS = # -Wall
-SH_FLAGS = -shared
+SH_FLAGS = -shared -fpic
# Flags for the test programs
T_FLAGS = -DUSE_MALLOC=1 -DMALLOC_HOOKS -DTEST=1
@@ -27,6 +27,9 @@
THR_FLAGS = -DUSE_PTHREADS=1 -DUSE_TSD_DATA_HACK -D_REENTRANT
THR_LIBS = -lpthread
+# Target libraries
+LIBS= libptmalloc.a ptmalloc.so
+
RM = rm -f
# Don't need it for the Linux C library 6, see `glibc' target below.
@@ -40,7 +43,9 @@
.c.o:
$(CC) -c $(CFLAGS) $<
-all: $(TESTS)
+all: ${LIBS}
+
+tests: $(TESTS)
shared: ptmalloc.so
@@ -48,14 +53,14 @@
$(CC) -c $(CFLAGS) $(M_FLAGS) $<
ptmalloc.so: ptmalloc.c ptmalloc.h thread-m.h
- $(CC) $(SH_FLAGS) $(CFLAGS) $(M_FLAGS) $< -o $@
+ $(CC) $(SH_FLAGS) $(CFLAGS) $(M_FLAGS) ptmalloc.c -o $@
again:
$(RM) $(TESTS)
$(MAKE) $(TESTS)
clean:
- $(RM) ptmalloc.o ptmalloc.so $(TESTS) core
+ $(RM) ptmalloc.o ptmalloc.so $(TESTS) core lib*
t-test1$(T_SUF): t-test1.c t-test.h thread-m.h $(MALLOC)
$(CC) $(CFLAGS) $(T_FLAGS) t-test1.c $(MALLOC) $(THR_LIBS) -o $@
@@ -129,3 +134,7 @@
dist:
cd ..; tar cf - $(DIST_FILES2:%=ptmalloc/%) | \
gzip -9 >ptmalloc.tar.gz
+
+libptmalloc.a: ptmalloc.o
+ ar qcvf $@ ptmalloc.o
+ ranlib $@