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 += -Iinclude
|
||||||
CFLAGS += -fPIC
|
CFLAGS += -fPIC
|
||||||
|
|
||||||
includedir = $(DESTDIR)$(PREFIX)/include
|
|
||||||
libdir = $(DESTDIR)$(PREFIX)/lib
|
|
||||||
|
|
||||||
hdrs += include/bytes.h
|
hdrs += include/bytes.h
|
||||||
hdrs += include/haggis.h
|
hdrs += include/haggis.h
|
||||||
hdrs += include/jobq.h
|
hdrs += include/jobq.h
|
||||||
hdrs += include/linklist.h
|
|
||||||
|
|
||||||
srcs += bytes.c
|
srcs += bytes.c
|
||||||
srcs += haggis.c
|
srcs += haggis.c
|
||||||
|
@ -60,19 +56,28 @@ shared: libhaggis.so
|
||||||
|
|
||||||
static: libhaggis.a
|
static: libhaggis.a
|
||||||
|
|
||||||
|
$(srcs): $(hdrs)
|
||||||
|
|
||||||
libhaggis.a: $(objs)
|
libhaggis.a: $(objs)
|
||||||
$(AR) rcs $@ $?
|
$(AR) rcs $@ $?
|
||||||
|
|
||||||
libhaggis.so: $(objs)
|
libhaggis.so: $(objs)
|
||||||
$(CC) -shared -o $@ $? $(LIBS)
|
$(CC) -shared -o $@ $? $(LIBS)
|
||||||
|
|
||||||
install: libhaggis.a libhaggis.so include/haggis.h
|
install: install_include install_shared install_static
|
||||||
[ -d $(includedir) ] || install -d $(includedir)
|
|
||||||
[ -d $(libdir) ] || install -d $(libdir)
|
install_include: include/haggis.h
|
||||||
install -m755 libhaggis.so $(libdir)/
|
@[ -d $(includedir) ] || install -d $(includedir)
|
||||||
install -m644 libhaggis.a $(libdir)/
|
|
||||||
install -m644 include/haggis.h $(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
|
test: libhaggis.a
|
||||||
$(MAKE) -C test
|
$(MAKE) -C test
|
||||||
|
|
||||||
|
@ -83,4 +88,5 @@ clean:
|
||||||
rm -rf *.a *.so *.o
|
rm -rf *.a *.so *.o
|
||||||
$(MAKE) -C test clean
|
$(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
|
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
|
# Comment this line if your OS ships libmd as part of libc
|
||||||
# (NetBSD, OpenBSD)
|
# (NetBSD, OpenBSD)
|
||||||
LIBS += -lmd
|
LIBS += -lmd
|
||||||
|
|
Loading…
Add table
Reference in a new issue