summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2001-10-23 03:47:06 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2001-10-23 03:47:06 (GMT)
commit7f292cecee3b603b5e1ccea57da0ba59dc113f3c (patch)
tree87249dc9279aae23614388c49ba3776e0ff34e25
parentcc4b12ea0755e60aa0a3e5e153f5c68eda12994b (diff)
downloadlpsm-7f292cecee3b603b5e1ccea57da0ba59dc113f3c.zip
lpsm-7f292cecee3b603b5e1ccea57da0ba59dc113f3c.tar.gz
lpsm-7f292cecee3b603b5e1ccea57da0ba59dc113f3c.tar.bz2
lpsm-7f292cecee3b603b5e1ccea57da0ba59dc113f3c.tar.xz
Add "make install" target
-rw-r--r--Makefile26
1 files changed, 23 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index fbbd173..61b2243 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
TEST = teststore test_mmap ftrunctest testbuddy testalloc testrecovery
SONAME = libpsm.so.0
VERSION = 0.1.4
-LIBPSM = libpsm.so libpsm.a
+LIBPSM = libpsm.so.$(VERSION) libpsm.a
CFILES = arena.c bitops.c \
mgmt.c malloc.c free.c realloc.c zalloc.c calloc.c stats.c
@@ -23,22 +23,42 @@ SOFLAGS = -shared
AR = ar cq
RANLIB = ranlib
+INSTALL = install -c
+
+prefix = /usr
+bindir = $(prefix)/bin
+sbindir = $(prefix)/sbin
+libdir = $(prefix)/lib
+includedir = $(prefix)/include
+mandir = $(prefix)/man
+man1dir = $(mandir)/man1
+man3dir = $(mandir)/man3
+
+
all: $(LIBPSM) $(TEST)
clean:
rm -f *.o *~ core *.dat *.log $(LIBPSM) $(TEST)
- rm -f libpsm.so.*
+ rm -f libpsm.so libpsm.so.*
distclean: clean
rm -f *~ \#* .depend
+install: all
+ mkdir -p $(INSTALLROOT)$(includedir) $(INSTALLROOT)$(libdir)
+ $(INSTALL) lpsm.h $(INSTALLROOT)$(includedir)
+ $(INSTALL) $(LIBPSM) $(INSTALLROOT)$(libdir)
+ cd $(INSTALLROOT)$(libdir) && ln -sf libpsm.so.$(VERSION) $(SONAME)
+ cd $(INSTALLROOT)$(libdir) && ln -sf libpsm.so.$(VERSION) libpsm.so
+ ldconfig
+
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
%.pic.o: %.c
$(CC) $(PICFLAGS) -o $@ -c $<
-libpsm.so: $(OSPICOBJ)
+libpsm.so.$(VERSION): $(OSPICOBJ)
$(CC) $(SOFLAGS) -Wl,-soname,$(SONAME) -o libpsm.so.$(VERSION) $(OSPICOBJ)
ln -sf libpsm.so.$(VERSION) $(SONAME)
ln -sf libpsm.so.$(VERSION) libpsm.so