aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2022-05-20 10:42:38 -0400
committerCameron Katri <me@cameronkatri.com>2022-05-20 10:42:38 -0400
commitaa035f73ce081b3f07247bd15860d72355a096b2 (patch)
tree170a83f5aa816f936df5ae906f20da3fb6b9404e /Makefile
downloadtrustcache-aa035f73ce081b3f07247bd15860d72355a096b2.tar.gz
trustcache-aa035f73ce081b3f07247bd15860d72355a096b2.tar.zst
trustcache-aa035f73ce081b3f07247bd15860d72355a096b2.zip
Initial import
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..364764d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
+OBJS = tc.o
+OBJS += append.o create.o info.o
+OBJS += machoparse/cdhash.o cache_from_tree.o sort.o
+OBJS += uuid/gen_uuid.o uuid/pack.o uuid/unpack.o uuid/parse.o uuid/unparse.o uuid/copy.o
+
+PREFIX ?= ~/.local
+BINDIR ?= $(PREFIX)/bin
+MANDIR ?= $(PREFIX)/share/man
+
+ifeq ($(shell uname -s),Darwin)
+ COMMONCRYPTO ?= 1
+endif
+
+ifeq ($(COMMONCRYPTO),1)
+ CFLAGS += -DCOMMONCRYPTO
+else
+ LIBS += -lcrypto
+endif
+
+all: tc
+
+install: tc tc.1
+ install -d $(BINDIR)
+ install -m 755 tc $(BINDIR)/
+ install -d $(MANDIR)/man1/
+ install -m 644 tc.1 $(MANDIR)/man1/
+
+uninstall:
+ rm -i $(BINDIR)/tc $(MANDIR)/man1/tc.1
+
+tc: $(OBJS)
+ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
+
+README.txt: tc.1
+ mandoc $^ | col -bx > $@
+
+clean:
+ rm -f tc $(OBJS)
+
+.PHONY: all clean install uninstall