forked from hcrypt-project/libScarab
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (28 loc) · 807 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
CC = gcc
SRCDIR = src
BINDIR = bin
BUILDDIR = build
PREFIX_LIB = /usr/local/lib
TARGET = $(BINDIR)/integer-fhe
LIBRARY_FILENAME = libscarab.so
LIBRARY = $(BUILDDIR)/$(LIBRARY_FILENAME)
CFLAGS = -Wall -g3 -ggdb -std=c99 -I/usr/local/include -I/usr/local/include/libflint -L/usr/local/lib
LDFLAGS += -lgmp -lflint
SOURCES = $(shell find $(SRCDIR) -name '*.c')
OBJECTS = $(SOURCES:.c=.o)
.PHONY: clean
all: $(TARGET) $(LIBRARY)
$(TARGET): $(OBJECTS)
mkdir -p $(BINDIR)
$(CC) -o $(TARGET) $(SOURCES) $(CFLAGS) $(LDFLAGS)
clean:
rm -r $(BINDIR) $(BUILDDIR)
$(LIBRARY):
mkdir -p $(BUILDDIR)
$(CC) -fPIC -shared -o $(LIBRARY) $(SOURCES) $(CFLAGS) $(LDFLAGS)
install:
cp $(LIBRARY) $(PREFIX_LIB)/
ldconfig
uninstall:
rm $(PREFIX_LIB)/$(LIBRARY_FILENAME)
ldconfig