aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2001-10-20 02:32:11 +0000
committerH. Peter Anvin <hpa@zytor.com>2001-10-20 02:32:11 +0000
commitbe9d8ab8ec452c46777b2eb4ae925843d7361c7b (patch)
treeaad187010f9d0f268698c53273a86dc392207eb1 /Makefile
parent50cedb0ff19233273ef33cb5b5e8725025a35024 (diff)
downloadlpsm-be9d8ab8ec452c46777b2eb4ae925843d7361c7b.tar.gz
lpsm-be9d8ab8ec452c46777b2eb4ae925843d7361c7b.tar.xz
lpsm-be9d8ab8ec452c46777b2eb4ae925843d7361c7b.zip
Add calloc(), break alloc.c into free/malloc/mgmt files, add
automatic dependency generation.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 19 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index f67108f..7208ca4 100644
--- a/Makefile
+++ b/Makefile
@@ -3,8 +3,10 @@ SONAME = libpsm.so.0
VERSION = 0.1.2
LIBPSM = libpsm.so libpsm.a
-OSOBJ = arena.o bitops.o alloc.o realloc.o zalloc.o stats.o
-OSPICOBJ = $(patsubst %.o,%.pic.o,$(OSOBJ))
+CFILES = arena.c bitops.c \
+ mgmt.c malloc.c free.c realloc.c zalloc.c calloc.c stats.c
+OSOBJ = $(patsubst %.c,%.o,$(CFILES))
+OSPICOBJ = $(patsubst %.c,%.pic.o,$(CFILES))
CC = gcc
# This is a reasonable set of flags for production
@@ -27,6 +29,9 @@ clean:
rm -f *.o *~ core *.dat *.log $(LIBPSM) $(TEST)
rm -f libpsm.so.*
+distclean: clean
+ rm -f *~ \#* .depend
+
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
@@ -60,3 +65,15 @@ test_mmap: test_mmap.o
ftrunctest: ftrunctest.o
$(CC) $(LDFLAGS) -o $@ $<
+
+.depend:
+ rm -f .depend
+ for cf in $(CFILES); do \
+ $(CC) $(CFLAGS) -E -Wp,-MM $$cf >> .depend ; \
+ $(CC) $(CFLAGS) -E -Wp,-MM $$cf | sed -e 's/\.o/\.pic\.o/' >> .depend ; \
+ done
+
+dep: .depend
+
+-include .depend
+