aboutsummaryrefslogtreecommitdiffstats
path: root/l4bds/Makefile
diff options
context:
space:
mode:
authorLAN-TW <lantw44@gmail.com>2012-12-17 11:17:09 +0800
committerLAN-TW <lantw44@gmail.com>2012-12-17 11:17:09 +0800
commit2e5766f6953821303a1c727c925b9b7e24e2d3d1 (patch)
tree21bc8ebda376cdbec41d0140413980c5813ccfa9 /l4bds/Makefile
parent9a8cf9bd8b7ad3c5ab119c82f10e76b6378dfed9 (diff)
downloadl4basic-2e5766f6953821303a1c727c925b9b7e24e2d3d1.tar
l4basic-2e5766f6953821303a1c727c925b9b7e24e2d3d1.tar.gz
l4basic-2e5766f6953821303a1c727c925b9b7e24e2d3d1.tar.bz2
l4basic-2e5766f6953821303a1c727c925b9b7e24e2d3d1.tar.lz
l4basic-2e5766f6953821303a1c727c925b9b7e24e2d3d1.tar.xz
l4basic-2e5766f6953821303a1c727c925b9b7e24e2d3d1.tar.zst
l4basic-2e5766f6953821303a1c727c925b9b7e24e2d3d1.zip
加入 install 和 uninstall 功能
Diffstat (limited to 'l4bds/Makefile')
-rw-r--r--l4bds/Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/l4bds/Makefile b/l4bds/Makefile
index 1691cee..915b3ed 100644
--- a/l4bds/Makefile
+++ b/l4bds/Makefile
@@ -1,9 +1,13 @@
CC=cc
AR=ar
-RM=rm
+RM=rm -f
+INSTALL=install -m 644
CFLAGS=-Wall -g -I.
OBJ=list.o
LIBFILE=libl4bds.a
+DESTDIR=/
+PREFIX=/usr/local
+LIBDIR=$(DESTDIR)/$(PREFIX)/lib
.PHONY: all clean
@@ -11,4 +15,9 @@ all: $(LIBFILE)
$(LIBFILE): $(OBJ)
$(AR) rcs $(LIBFILE) $(OBJ)
clean:
- $(RM) -f $(LIBFILE) $(OBJ)
+ $(RM) $(LIBFILE) $(OBJ)
+install:
+ mkdir -p $(LIBDIR)
+ $(INSTALL) -c $(LIBFILE) $(LIBDIR)
+uninstall:
+ $(RM) $(LIBDIR)/$(LIBFILE)