Makefile adjustments to get ready for adding docs
This commit is contained in:
parent
6ddcbd7a96
commit
58d620a977
2 changed files with 22 additions and 10 deletions
26
Makefile
26
Makefile
|
@ -39,13 +39,9 @@ CFLAGS += -Wall -Werror
|
|||
CFLAGS += -Iinclude
|
||||
CFLAGS += -fPIC
|
||||
|
||||
includedir = $(DESTDIR)$(PREFIX)/include
|
||||
libdir = $(DESTDIR)$(PREFIX)/lib
|
||||
|
||||
hdrs += include/bytes.h
|
||||
hdrs += include/haggis.h
|
||||
hdrs += include/jobq.h
|
||||
hdrs += include/linklist.h
|
||||
|
||||
srcs += bytes.c
|
||||
srcs += haggis.c
|
||||
|
@ -60,19 +56,28 @@ shared: libhaggis.so
|
|||
|
||||
static: libhaggis.a
|
||||
|
||||
$(srcs): $(hdrs)
|
||||
|
||||
libhaggis.a: $(objs)
|
||||
$(AR) rcs $@ $?
|
||||
|
||||
libhaggis.so: $(objs)
|
||||
$(CC) -shared -o $@ $? $(LIBS)
|
||||
|
||||
install: libhaggis.a libhaggis.so include/haggis.h
|
||||
[ -d $(includedir) ] || install -d $(includedir)
|
||||
[ -d $(libdir) ] || install -d $(libdir)
|
||||
install -m755 libhaggis.so $(libdir)/
|
||||
install -m644 libhaggis.a $(libdir)/
|
||||
install: install_include install_shared install_static
|
||||
|
||||
install_include: include/haggis.h
|
||||
@[ -d $(includedir) ] || install -d $(includedir)
|
||||
install -m644 include/haggis.h $(includedir)/
|
||||
|
||||
install_static: libhaggis.a
|
||||
@[ -d $(libdir) ] || install -d $(libdir)
|
||||
install -m644 libhaggis.a $(libdir)/
|
||||
|
||||
install_shared: libhaggis.so
|
||||
@[ -d $(libdir) ] || install -d $(libdir)
|
||||
install -m755 libhaggis.so $(libdir)/
|
||||
|
||||
test: libhaggis.a
|
||||
$(MAKE) -C test
|
||||
|
||||
|
@ -83,4 +88,5 @@ clean:
|
|||
rm -rf *.a *.so *.o
|
||||
$(MAKE) -C test clean
|
||||
|
||||
.PHONY: all shared static clean install testclean test
|
||||
.PHONY: all shared static clean install install_include install_static \
|
||||
install_shared testclean test
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
prefix ?= /usr/local
|
||||
bindir = $(DESTDIR)$(PREFIX)/bin
|
||||
includedir = $(DESTDIR)$(PREFIX)/include
|
||||
libdir = $(DESTDIR)$(PREFIX)/lib
|
||||
sharedir = $(DESTDIR)$(PREFIX)/share
|
||||
mandir = $(sharedir)/man
|
||||
docdir = $(sharedir)/doc/haggis
|
||||
# Comment this line if your OS ships libmd as part of libc
|
||||
# (NetBSD, OpenBSD)
|
||||
LIBS += -lmd
|
||||
|
|
Loading…
Add table
Reference in a new issue