mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +03:00
33 lines
816 B
Makefile
33 lines
816 B
Makefile
CC ?= cc
|
|
AR ?= ar
|
|
PREFIX ?= ./out
|
|
|
|
################################################################################
|
|
|
|
.PHONY: all install clean
|
|
|
|
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/
|
|
cp liburcrypt.so $(PREFIX)/lib/
|
|
cp urcrypt.h $(PREFIX)/include/
|
|
|
|
clean:
|
|
rm urcrypt-static.o urcrypt-shared.o liburcrypt.a liburcrypt.so
|