summaryrefslogtreecommitdiff
path: root/libqueue/queue/Makefile
diff options
context:
space:
mode:
authorJohn Vogel <jvogel4@stny.rr.com>2024-07-07 12:06:29 -0400
committerJohn Vogel <jvogel4@stny.rr.com>2024-07-07 12:06:29 -0400
commite641fea471c85d267a22ac9ee431d07e4a5c8701 (patch)
tree7704a7c5fc3a51dd646352aae435ff087ba0a431 /libqueue/queue/Makefile
parentfa77c0dd7f3ce3f69c405ae9535941ffeff478ae (diff)
downloadmy-aports-e641fea471c85d267a22ac9ee431d07e4a5c8701.tar.gz
local/libqueue: new aport
Diffstat (limited to 'libqueue/queue/Makefile')
-rw-r--r--libqueue/queue/Makefile46
1 files changed, 46 insertions, 0 deletions
diff --git a/libqueue/queue/Makefile b/libqueue/queue/Makefile
new file mode 100644
index 0000000..d7d6a40
--- /dev/null
+++ b/libqueue/queue/Makefile
@@ -0,0 +1,46 @@
+# based heavily on mandoc's Makefile
+
+CFLAGS += -fPIC
+INSTALL = install
+INSTALL_LIB = $(INSTALL) -m 0644
+PREFIX = /usr/local
+LIBDIR = $(PREFIX)/lib
+INCLUDEDIR = $(PREFIX)/include/queue
+
+SRCS = dl.c sl.c sq.c stq.c tq.c
+
+OBJS = dl.o sl.o sq.o stq.o tq.o
+
+HDRS = dl.h sl.h sq.h stq.h tq.h
+
+LIBS = libqueue.a
+
+SOLIBS = libqueue.so
+
+all: $(LIBS) $(SOLIBS)
+
+libqueue.a: $(OBJS)
+ $(AR) rs $@ $(OBJS)
+
+libqueue.so: $(OBJS)
+ $(CC) $(LDFLAGS) -shared -o $@ $(OBJS)
+
+clean:
+ rm -f $(LIBS) $(SOLIBS) $(OBJS)
+
+install: $(LIBS) $(SOLIBS)
+ mkdir -p $(DESTDIR)$(LIBDIR)
+ mkdir -p $(DESTDIR)$(INCLUDEDIR)
+ $(INSTALL_LIB) $(LIBS) $(DESTDIR)$(LIBDIR)
+ $(INSTALL_LIB) $(SOLIBS) $(DESTDIR)$(LIBDIR)
+ $(INSTALL_LIB) $(HDRS) $(DESTDIR)$(INCLUDEDIR)
+
+uninstall:
+ rm -f $(DESTDIR)$(LIBDIR)/libqueue.a
+ rm -f $(DESTDIR)$(LIBDIR)/libqueue.so
+ rm -f $(DESTDIR)$(INCLUDEDIR)/dl.h
+ rm -f $(DESTDIR)$(INCLUDEDIR)/sl.h
+ rm -f $(DESTDIR)$(INCLUDEDIR)/sq.h
+ rm -f $(DESTDIR)$(INCLUDEDIR)/stq.h
+ rm -f $(DESTDIR)$(INCLUDEDIR)/tq.h
+ [ ! -e $(DESTDIR)$(INCLUDEDIR) ] || rmdir $(DESTDIR)$(INCLUDEDIR)