]> git.cameronkatri.com Git - trustcache.git/blob - Makefile
Fix workflows
[trustcache.git] / Makefile
1 OBJS = trustcache.o
2 OBJS += append.o create.o info.o remove.o
3 OBJS += machoparse/cdhash.o cache_from_tree.o sort.o
4 OBJS += uuid/gen_uuid.o uuid/pack.o uuid/unpack.o uuid/parse.o uuid/unparse.o uuid/copy.o
5 OBJS += compat_strtonum.o
6
7 DESTDIR ?=
8 PREFIX ?= ~/.local
9 BINDIR ?= $(DESTDIR)$(PREFIX)/bin
10 MANDIR ?= $(DESTDIR)$(PREFIX)/share/man
11
12 ifeq ($(shell uname -s),Darwin)
13 COMMONCRYPTO ?= 1
14 endif
15
16 ifeq ($(COMMONCRYPTO),1)
17 CFLAGS += -DCOMMONCRYPTO
18 else
19 LIBS += -lcrypto
20 endif
21
22 all: trustcache
23
24 install: trustcache trustcache.1
25 install -d $(BINDIR)
26 install -m 755 trustcache $(BINDIR)/
27 install -d $(MANDIR)/man1/
28 install -m 644 trustcache.1 $(MANDIR)/man1/
29
30 uninstall:
31 rm -i $(BINDIR)/trustcache $(MANDIR)/man1/trustcache.1
32
33 trustcache: $(OBJS)
34 $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
35
36 README.txt: trustcache.1
37 mandoc $^ | col -bx > $@
38
39 clean:
40 rm -f trustcache $(OBJS)
41
42 .PHONY: all clean install uninstall