2020-07-28 05:19:17 +03:00
|
|
|
CC ?= cc
|
|
|
|
AR ?= ar
|
|
|
|
PREFIX ?= ./out
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2020-08-01 00:21:02 +03:00
|
|
|
.PHONY: all install clean
|
2020-07-28 05:19:17 +03:00
|
|
|
|
2020-07-30 23:07:13 +03:00
|
|
|
CFLAGS := $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99
|
|
|
|
SOURCES = urcrypt.c urcrypt.h
|
|
|
|
|
|
|
|
liburcrypt.a: $(SOURCES)
|
|
|
|
$(CC) $(CFLAGS) -c urcrypt.c -o urcrypt-static.o
|
|
|
|
$(AR) rcs liburcrypt.a urcrypt-static.o
|
|
|
|
|
|
|
|
liburcrypt.so: $(SOURCES)
|
|
|
|
$(CC) $(CFLAGS) -fPIC -c urcrypt.c -o urcrypt-shared.o
|
|
|
|
$(CC) -shared urcrypt-shared.o -o liburcrypt.so \
|
|
|
|
-led25519 -lge-additions \
|
|
|
|
-Wl,--no-undefined
|
|
|
|
|
|
|
|
all: liburcrypt.a liburcrypt.so
|
2020-07-28 05:19:17 +03:00
|
|
|
|
|
|
|
install: all
|
|
|
|
@mkdir -p $(PREFIX)/lib/
|
|
|
|
@mkdir -p $(PREFIX)/include/
|
|
|
|
cp liburcrypt.a $(PREFIX)/lib/
|
2020-07-30 23:07:13 +03:00
|
|
|
cp liburcrypt.so $(PREFIX)/lib/
|
2020-07-28 05:19:17 +03:00
|
|
|
cp urcrypt.h $(PREFIX)/include/
|
|
|
|
|
|
|
|
clean:
|
2020-08-01 00:21:02 +03:00
|
|
|
rm urcrypt-static.o urcrypt-shared.o liburcrypt.a liburcrypt.so
|