seahag/Makefile
Nathan Fisher ed9648ff78 Replace linklist with linkmap and remove former completely. Also
remove generic hashmap implementation in favor of linkmap.
2023-08-18 12:37:24 -04:00

89 lines
2.8 KiB
Makefile

# _,.---._ .-._ .--.-. ,--.--------.
# _,..---._ ,-.' , - `. /==/ \ .-._/==/ //==/, - , -\
# /==/, - \ /==/_, , - \|==|, \/ /, |==\ -\\==\.-. - ,-./
# |==| _ _\==| .=. |==|- \| | \==\- \`--`\==\- \
# |==| .=. |==|_ : ;=: - |==| , | -| `--`-' \==\_ \
# |==|,| | -|==| , '=' |==| - _ | |==|- |
# |==| '=' /\==\ - ,_ /|==| /\ , | |==|, |
# |==|-, _`/ '.='. - .' /==/, | |- | /==/ -/
# `-.`.____.' `--`--'' `--`./ `--` `--`--`
# _ __ ,---. .-._ .=-.-. _,.----.
# .-`.' ,`..--.' \ /==/ \ .-._ /==/_ /.' .' - \
# /==/, - \==\-/\ \ |==|, \/ /, /==|, |/==/ , ,-'
# |==| _ .=. /==/-|_\ | |==|- \| ||==| ||==|- | .
# |==| , '=',\==\, - \ |==| , | -||==|- ||==|_ `-' \
# |==|- '..'/==/ - ,| |==| - _ ||==| ,||==| _ , |
# |==|, | /==/- /\ - \|==| /\ , ||==|- |\==\. /
# /==/ - | \==\ _.\=\.-'/==/, | |- |/==/. / `-.`.___.-'
# `--`---' `--` `--`./ `--``--`-`
#
# @(#)Copyright (c) 2023, Nathan D. Fisher.
#
# This is free software. It comes with NO WARRANTY.
# Permission to use, modify and distribute this source code
# is granted subject to the following conditions.
# 1/ that the above copyright notice and this notice
# are preserved in all copies and that due credit be given
# to the author.
# 2/ that any changes to this code are clearly commented
# as such so that the author does not get blamed for bugs
# other than his own.
#
-include config.mk
.SUFFIXES:
.SUFFIXES: .o .c
PREFIX ?= /usr/local
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
srcs += jobq.c
srcs += linkmap.c
objs = $(srcs:.c=.o)
CFLAGS += -Wall -Werror
CFLAGS += -Iinclude
CFLAGS += -fPIC
LIBS += -lmd -lpthread
all: libhaggis.a libhaggis.so
shared: libhaggis.so
static: libhaggis.a
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 -m644 include/haggis.h $(includedir)/
test: libhaggis.a
$(MAKE) -C test
testclean:
$(MAKE) -C test clean
clean:
rm -rf *.a *.so *.o
$(MAKE) -C test clean
.PHONY: all shared static clean install testclean test