diff options
Diffstat (limited to 'libqueue/queue/Makefile')
| -rw-r--r-- | libqueue/queue/Makefile | 46 |
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) |
