aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rw-r--r--l4arg/Makefile13
-rw-r--r--l4bds/Makefile13
-rw-r--r--l4darr/Makefile13
4 files changed, 41 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index cc3afdc..b0dd0c8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+
.PHONY: all clean install uninstall
all:
$(MAKE) -C l4darr all
@@ -8,5 +9,10 @@ clean:
$(MAKE) -C l4bds clean
$(MAKE) -C l4arg clean
install:
- @echo "You should statically link your program against it instead of installing it!"
-
+ $(MAKE) -C l4darr install
+ $(MAKE) -C l4bds install
+ $(MAKE) -C l4arg install
+uninstall:
+ $(MAKE) -C l4darr uninstall
+ $(MAKE) -C l4bds uninstall
+ $(MAKE) -C l4arg uninstall
diff --git a/l4arg/Makefile b/l4arg/Makefile
index 8c23687..e6502f3 100644
--- a/l4arg/Makefile
+++ b/l4arg/Makefile
@@ -1,9 +1,13 @@
CC=cc
AR=ar
-RM=rm
+RM=rm -f
+INSTALL=install -m 644
CFLAGS=-Wall -g -I. -I../l4darr
OBJ=toargv.o qarg.o
LIBFILE=libl4arg.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) $(LIBFILE) $(LIBDIR)
+uninstall:
+ $(RM) $(LIBDIR)/$(LIBFILE)
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)
diff --git a/l4darr/Makefile b/l4darr/Makefile
index 3bc40c7..6aa5428 100644
--- a/l4darr/Makefile
+++ b/l4darr/Makefile
@@ -1,9 +1,13 @@
CC=cc
AR=ar
-RM=rm
+RM=rm -f
+INSTALL=install -m 644
CFLAGS=-Wall -g -I.
OBJ=d1array.o d1arrstr.o d2array.o
LIBFILE=libl4darr.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)