shrub/pkg/urcrypt/Makefile

33 lines
816 B
Makefile
Raw Normal View History

CC ?= cc
AR ?= ar
PREFIX ?= ./out
################################################################################
.PHONY: all install clean
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
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/
cp urcrypt.h $(PREFIX)/include/
clean:
rm urcrypt-static.o urcrypt-shared.o liburcrypt.a liburcrypt.so